I create an app that include a library project and runs fine. But when I add .jar to my library project app not finds this .jar and build process crashes.
These are my .gradle files:
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'
}
}
Where a is my library project and b the new .jar that I need. And in logcat appears this message:
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
How can I fix it?