嘿家伙我真的有一个问题,我无法解决。Android Studio参考图书馆
我正在开发一个Android应用程序,它需要一个我自己写的库(model.jar)。我将它添加到Android Studio,一切都很好。 在某些时候它只是没有工作了,所以我做了一切我能做的:
- 删除从我的项目
- 在不工作库放在库项目/ libs目录
- 添加通过项目结构libray - >文件的依赖性 - > model.jar
- 加入罐子项目.gradle文件编译
- 重建项目
- 的Invalidate缓存和重新启动
- 删除的项目.iml文件和文件夹.idea重新导入和应用
- 从命令行执行
gradlew clean
和gradlew assemble
- 编辑:我也做了同步工程与摇篮文件
但是,没有这些工作。它仍然无法解决从罐子里的对象,我只是卡住了。
因为我不能发表图片直接I uploaded it into my dropbox
请注意,我不能展开model.jar作为做功的其他库。
的的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'
}
正如前面所说的,米娜库做工精细。
感谢您的帮助!
摆脱'compile fileTree()'语句,或者摆脱所有'compile files()'语句。这些是多余的,可能会造成一些问题。除此之外,确保'model.jar'看起来不错(例如,解压并确认它的内容是你期望的)。 – CommonsWare 2014-11-23 12:33:08
我删除了'compile file'语句,但它没有改变任何东西。米娜的作品,但model.jar仍然不可扩展和不可用。 model.jar绝对没问题,因为它以前工作过,并且仍然在不同的项目中工作。 – Ca11e 2014-11-23 12:38:49
我要求你检查'model.jar'这个特定副本的原因是IDE根据你的屏幕截图似乎并不认为它有任何东西。仅仅因为逻辑库在其他地方工作并不意味着这个实际项目中的实际JAR文件是可以的。 – CommonsWare 2014-11-23 12:44:32