[英]Android Studio importing my own .jar file
I've created a java library for my android apllication with Intellij. 我已经使用Intellij为Android应用程序创建了一个Java库。 It works fine.
工作正常。 I've built also with Intellij.
我也用Intellij构建的。
I've coppied the .jar file to myAndroidApp/libs/ . 我已将.jar文件复制到myAndroidApp / libs /。 I've imported the library using file>>project structure >> dependencies.
我已经使用文件>>项目结构>>依赖项导入了库。 It's ok!
没关系! There is no problem.
没有问题。 Also i can use my clases in Android studio.
我也可以在Android Studio中使用自己的故事。
But... 但...
When i run my application it throws this error: 当我运行我的应用程序时,它将引发此错误:
Information:Gradle tasks [:app:assembleDebug]
Error:Execution failed for task ':app:compileDebugJavaWithJavac'.
> Could not expand ZIP './app/libs/GetWebDatas.jar'.
And the console output: 和控制台输出:
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':app:compileDebugJavaWithJavac'.
> Could not expand ZIP
'./app/libs/GetWebDatas.jar'.
* Try:
Run with --stacktrace option to get the stack trace. Run with --info
or --debug option to get more log output.
Actually i can use my GetWebDatas.jar file in another java project perfectly with no errors. 实际上,我可以在另一个Java项目中完美使用我的GetWebDatas.jar文件,而不会出现任何错误。 But i can't use in android project.
但是我不能在android项目中使用。
Also i can import Jsoup or another popular .jar project to my android application. 我也可以将Jsoup或另一个流行的.jar项目导入我的android应用程序。 But i can't my own project.
但是我不能做自己的项目。
也许您可以尝试File -> New -> New Module -> Import .JAR/.AAR Package
。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.