Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
562 views
in Technique[技术] by (71.8m points)

java - How to add third-party jar files into my android application jar file?

I have an Adobe AIR application for Android. Using for this AIR 3.0 and Flash Builder 4.6. I need to make MyANEFile.ane - which must include 2 external .jar files: Flurry.jar + Tapjoy.jar. But when I made .ane file - it does not work. How can I add this 2 jar files to my main application jar file to make .ane file properly? Thanks.

It shows me such errors in dalvik:

*01-31 21:37:37.046: I/dalvikvm(12983): Could not find method com.amobee.agency.tracking.AmobeeReceiver.amobeeTracking, referenced from method com.mycompany.extensions.AmobeeInitAmobeeTrackingFunction.call

01-31 21:37:37.046: W/dalvikvm(12983): VFY: unable to resolve static method 317: Lcom/amobee/agency/tracking/AmobeeReceiver;.amobeeTracking (Ljava/lang/String;Landroid/content/Context;Ljava/lang/String;)V*

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

Suppose your main extension jar file is extension.jar and you are using code in external.jar. Then you can put the classes from external.jar into extension.jar using the Java jar tool:

jar -xf external.jar

This will extract the .class files into package folders. If the top-level package is "com", then you can add those to extension.jar with:

jar -uf extension.jar com

(Repeat the second command for each top-level package in the external jar.)


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...