我創建了一個包含庫項目且運行良好的應用程序。但是,當我添加.jar到我的庫項目應用程序沒有發現這個.jar和構建過程崩潰。將外部.jar添加到Android庫項目
這些都是我.gradle文件:
apply plugin: 'com.android.application'
android {
compileSdkVersion 21
buildToolsVersion "22.0.1"
defaultConfig {
applicationId "org.gradiant.apps"
minSdkVersion 14
targetSdkVersion 21
versionCode 1
versionName "1.0"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile 'com.android.support:appcompat-v7:22.1.1'
compile project(':a')
}
apply plugin: 'com.android.library'
android {
compileSdkVersion 21
buildToolsVersion "22.0.1"
defaultConfig {
minSdkVersion 14
targetSdkVersion 21
versionCode 1
versionName "1.0"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile 'com.android.support:appcompat-v7:22.1.1'
compile(name: 'b', ext: 'jar')
}
repositories {
flatDir {
dirs 'libs'
}
}
當一個是我的庫項目和b的新的.jar,我需要。並在logcat出現此消息:
Error:A problem occurred configuring project ':app'.
> Could not resolve all dependencies for configuration ':app:_debugCompile'.
> Could not find :b:.
Searched in the following locations:
https://jcenter.bintray.com//b//b-.pom
https://jcenter.bintray.com//b//b-.jar
Required by:
NewApps:app:unspecified > NewApps:a:unspecified
我該如何解決它?
你有看看這個http://stackoverflow.com/a/16639227/1503155 –