[android-porting] Re: Calling a class in a .jar library from a system level service

2018-01-29 Thread Drunczyk
I fixed that error by adding the extender.jar library 
to PRODUCT_SYSTEM_SERVER_JARS in the product .mk file.

Now I'm trying to understand the build problem: services.jar references my 
prebuilt static java library newservice, newservice uses prebuilt 
extender.jar. If I do a full product build, newservice gets compiled into 
services.jar, but extender.jar isn't installed into /system/frameworks and 
thus isn't found in the final FW image. Adding LOCAL_REQUIRED_MODULES 
doesn't seem to help.

I suspect the problem here is the the build doesn't think extender.jar is 
part of the built product.

Android.mk:
==
$ LOCAL_PATH := $(call my-dir)

include $(CLEAR_VARS)
LOCAL_MODULE := newservice
LOCAL_MODULE_TAGS := eng optional
LOCAL_SRC_FILES := javalib.jar
LOCAL_REQUIRED_MODULES := extender
LOCAL_MODULE_CLASS := JAVA_LIBRARIES
LOCAL_MODULE_SUFFIX := $(COMMON_JAVA_PACKAGE_SUFFIX)
include $(BUILD_PREBUILT)

include $(CLEAR_VARS)
LOCAL_MODULE := extender
LOCAL_MODULE_TAGS := eng optional
LOCAL_SRC_FILES := extender.jar
LOCAL_MODULE_CLASS := JAVA_LIBRARIES
LOCAL_MODULE_SUFFIX := $(COMMON_JAVA_PACKAGE_SUFFIX)
include $(BUILD_PREBUILT)

==

Drunczyk 



On Thursday, January 25, 2018 at 11:38:51 AM UTC-5, Christopher McClellan 
wrote:
>
>  Can you share the Android.mk (or Android.bp) for extender.jar and 
> service.jar?
>

-- 
-- 
unsubscribe: android-porting+unsubscr...@googlegroups.com
website: http://groups.google.com/group/android-porting

--- 
You received this message because you are subscribed to the Google Groups 
"android-porting" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to android-porting+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[android-porting] Calling a class in a .jar library from a system level service

2018-01-19 Thread Drunczyk
Hello,

I have a service added into the framework with the other standard services 
(services.jar). I want the service to be able to call some methods in a 
.jar library (extender.jar). When the platform builds, everything is fine, 
references to the library get resolved correctly, the library gets into 
/system/framework, but when the service tries to call a method in the 
library, it gets Error: 0xffe0 "Broken pipe" and logcat shows:

E/AndroidRuntime( 1104): *** FATAL EXCEPTION IN SYSTEM PROCESS: Binder_B
E/AndroidRuntime( 1104): java.lang.NoClassDefFoundError: Failed resolution 
of: Lcom/android/server/extender/TestExtender;
E/AndroidRuntime( 1104):  at 
com.android.server.newservice.NewService.onTransact(NewService.java:79)
E/AndroidRuntime( 1104):  at android.os.Binder.execTransact(Binder.java:446)
E/AndroidRuntime( 1104): Caused by: java.lang.ClassNotFoundException: 
Didn't find class "com.android.server.extender.TestExtender" on path: 
DexPathList[[zip file "/system/framework/services.jar", zip file 
"/system/framework/ethernet-service.jar", zip file 
"/system/framework/wifi-service.jar"],nativeLibraryDirectories=[/vendor/lib, 
/system/lib]]
E/AndroidRuntime( 1104):  at 
dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:56)
E/AndroidRuntime( 1104):  at 
java.lang.ClassLoader.loadClass(ClassLoader.java:511)
E/AndroidRuntime( 1104):  at 
java.lang.ClassLoader.loadClass(ClassLoader.java:469)
E/AndroidRuntime( 1104):  ... 2 more
E/AndroidRuntime( 1104):  Suppressed: java.lang.ClassNotFoundException: 
Didn't find class "com.android.server.extender.TestExtender" on path: 
DexPathList[[directory "."],nativeLibraryDirectories=[/vendor/lib, 
/system/lib]]
E/AndroidRuntime( 1104):  at 
dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:56)
E/AndroidRuntime( 1104):  at 
java.lang.ClassLoader.loadClass(ClassLoader.java:511)
E/AndroidRuntime( 1104):  at 
java.lang.ClassLoader.loadClass(ClassLoader.java:504)
E/AndroidRuntime( 1104):  ... 3 more
E/AndroidRuntime( 1104):  Suppressed: java.lang.ClassNotFoundException: 
com.android.server.extender.TestExtender
E/AndroidRuntime( 1104):  at java.lang.Class.classForName(Native Method)
E/AndroidRuntime( 1104):  at 
java.lang.BootClassLoader.findClass(ClassLoader.java:781)
E/AndroidRuntime( 1104):  at 
java.lang.BootClassLoader.loadClass(ClassLoader.java:841)
E/AndroidRuntime( 1104):  at 
java.lang.ClassLoader.loadClass(ClassLoader.java:504)
E/AndroidRuntime( 1104):  ... 4 more
E/AndroidRuntime( 1104):  Caused by: java.lang.NoClassDefFoundError: Class 
not found using the boot class loader; no stack available

Is there a way to fix it?

Thanks

-- 
-- 
unsubscribe: android-porting+unsubscr...@googlegroups.com
website: http://groups.google.com/group/android-porting

--- 
You received this message because you are subscribed to the Google Groups 
"android-porting" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to android-porting+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.