Reputation: 3752
I'm building a library project in which I'm using 3rd party jar file.
Normally when I use the library as a dependency on TestApp all things works as it should. Attached is the screenshot for that:
But, when I export jar from the TestSDK
library project and add it to the build path of the TestApp
, which looks like this:
I get VerifyError
when deploying the app on device. Below are the logs for it:
12-30 18:10:55.778: W/dalvikvm(7316): VFY: unable to find class referenced in signature (Lcom/aerserv/sdk/ASAdView;)
12-30 18:10:55.788: W/dalvikvm(7316): VFY: Ljava/lang/Object; is not instance of Landroid/view/View;
12-30 18:10:55.788: W/dalvikvm(7316): VFY: bad arg 1 (into Landroid/view/View;)
12-30 18:10:55.788: W/dalvikvm(7316): VFY: rejecting call to Landroid/view/ViewGroup;.removeView (Landroid/view/View;)V
12-30 18:10:55.788: W/dalvikvm(7316): VFY: rejecting opcode 0x6e at 0x0011
12-30 18:10:55.788: W/dalvikvm(7316): VFY: rejected Lcom/anupam/sdk/activities/AdsActivity;.initAerservAd ()V
12-30 18:10:55.788: W/dalvikvm(7316): Verifier rejected class Lcom/anupam/sdk/activities/AdsActivity;
12-30 18:10:55.788: W/dalvikvm(7316): Class init failed in newInstance call (Lcom/anupam/sdk/activities/AdsActivity;)
12-30 18:10:55.788: D/AndroidRuntime(7316): Shutting down VM
12-30 18:10:55.788: W/dalvikvm(7316): threadid=1: thread exiting with uncaught exception (group=0x41596ba8)
12-30 18:10:55.788: E/AndroidRuntime(7316): FATAL EXCEPTION: main
12-30 18:10:55.788: E/AndroidRuntime(7316): Process: com.anupam.testsdk, PID: 7316
12-30 18:10:55.788: E/AndroidRuntime(7316): java.lang.VerifyError: com/anupam/sdk/activities/AdsActivity
What should be the correct way to do that? Am I missing something here. Any kind of help or guidance will be much appreciated.
Upvotes: 0
Views: 547
Reputation: 5938
I think your JAR depends on Aerserv SDK but does not include it. And I don't see it being included in the app either.
Please note that build dependencies of your JAR library will not automatically get included. Dependencies are an issue when building libraries. You have two options: include the dependencies in the jar itself (you have to force your build system to do that) or instruct the library user to do that (similar to how Aerserv does it). When including dependencies you risk conflict if library user ads them too.
Upvotes: 2