简体   繁体   English

在Android Studio中如何创建jar,包括其他jar库

[英]In Android Studio how to create jar Including other jar libraries

In android studio, i'm trying to create .jar file of my library and it contains another .jar dependancies. 在android studio中,我正在尝试创建我的库的.jar文件,它包含另一个.jar相关性。 After adding created .jar file to another project and run it gives me 将创建的.jar文件添加到另一个项目并运行后,它给了我

java.lang.RuntimeException: Unable to instantiate activity ComponentInfo{in.co.xyz.MyLibrary/in.co.xyz.MyLibrary.MainActivity}:
java.lang.ClassNotFoundException: Didn't find class "in.co.xyz.MyLibrary.MainActivity" 
on path: DexPathList[[zip file "/data/app/in.co.xyz.MyLibrary-1/base.apk"],nativeLibraryDirectories=[/vendor/lib, /system/lib]]

how to fix this issue, please help me 如何解决此问题,请帮助我

you cannot do this, if its must you have to include all java inside your project so that it will compile with same build. 您无法执行此操作,如果必须这样做,则必须在项目中包含所有Java,以便可以使用相同的版本进行编译。

Because .jar is container of compiled files. 因为.jar是已编译文件的容器。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM