0

Now I already built a third party jar called telephony_DA. And I already can use this telephony_DA library in application level. (modication on AndroidManifest.xml and add permission into /etc/permissions)

My problem is that I wrote a new service called TelephonyRegistry_DA.java in
"com.android.server" package and used the classes from telephony_DA library. After noting the telephony_DA library in Android.mk, I can built services library sucessfully. But in run time it appearred crash with the reason of

"java.lang.NoClassDefFoundError: com.android.server.TelephonyRegistry_DA"

I tried to figure out the issue then I found something. Once I remove the classes from telephony_DA library in TelephonyRegistry_DA.java then in run time there is no issue on creating and adding service from TelephonyRegistry_DA.java. It seems that systemserver didn't know the link with telephony_DA library.

So how do I add a thirdparty jar into systemserver.java?

Thanks.

Nikhil
  • 16,194
  • 20
  • 64
  • 81

1 Answers1

0

In application level, you can inidcat 3rd party library from manifest.xml. But in services from system server you should add 3rd party libary into default linking path. so please modify (ex: telephony_DA.jar) init.rc as below.

export BOOTCLASSPATH /system/framework/core.jar:/system/framework/core-junit.jar:/system/framework/bouncycastle.jar:/system/framework/ext.jar:/system/framework/framework.jar:/system/framework/android.policy.jar:/system/framework/services.jar:/system/framework/apache-xml.jar:/system/framework/filterfw.jar:/system/framework/telephony_DA.jar