[英]Android Studio reference Library
Hey guys I really got a problem I can't solve. 大家好,我真的有一个无法解决的问题。
I'm developing an Android application which needs a library I wrote for myself (model.jar). 我正在开发一个Android应用程序,它需要一个我为自己编写的库(model.jar)。 I added it to Android Studio and everything was fine.
我将其添加到Android Studio,一切都很好。 On some point it just didn't work anymore so I did everything I could do:
在某种程度上,它不再起作用了,所以我做了我能做的一切:
gradlew clean
and gradlew assemble
from command line gradlew clean
和gradlew assemble
However none of these worked. 但是这些都不起作用。 It still cannot resolve the objects from the jar and I'm just stuck.
它仍然无法解析jar中的对象,我被卡住了。
Since I am not allowed to post images directly I uploaded it into my dropbox 由于不允许直接发布图片,因此我将其上传到我的保管箱
Note that I cannot expand the model.jar as the other libraries that do work. 请注意,我无法像其他可以使用的库一样扩展model.jar。
The build.gradle: build.gradle:
apply plugin: 'com.android.application'
android {
compileSdkVersion 21
buildToolsVersion '20.0.0'
defaultConfig {
applicationId "de.rcsrcs.osiris"
minSdkVersion 14
targetSdkVersion 21
versionCode 1
versionName "1.0"
}
buildTypes {
release {
runProguard false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile files('libs/mina-core-2.0.9.jar')
compile files('libs/slf4j-api-1.7.7.jar')
compile files('libs/slf4j-log4j12-1.7.7.jar')
compile files('libs/slf4j-jdk14-1.7.7.jar')
compile files('libs/model.jar')
compile 'com.google.android.gms:play-services:6.1.71'
compile 'com.android.support:appcompat-v7:21.0.0'
compile 'com.android.support:support-v4:21.0.0'
compile 'com.android.support:recyclerview-v7:21.0.0'
}
As said before, the mina libraries work fine. 如前所述,mina库工作正常。
Thanks for your help! 谢谢你的帮助!
JAR files, being files, can get mangled accidentally from time to time. 作为文件的JAR文件有时会不小心被弄乱。 If your IDE sees the JAR (eg, it shows up in the list of dependencies in Android Studio), but it does not see contents of the JAR, check to make sure that it is a clean copy of the JAR.
如果您的IDE可以看到JAR(例如,它显示在Android Studio中的依赖项列表中),但是看不到JAR的内容 ,请检查以确保它是JAR的完整副本。 Ideally, the IDE would be a bit more "in your face" about a broken JAR file...
理想情况下,关于损坏的JAR文件,IDE会“更多地面向您” ...
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.