I am newbie in gradle scripts, have only basic knowledge.
I have multiple modules inside my project. Here is screenshot.
In my project build.gradle
file I have basic configuration.
As far as I know this file is for global project configuration.
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
repositories {
jcenter()
mavenCentral()
}
dependencies {
classpath 'com.android.tools.build:gradle:1.2.3'
classpath 'com.neenbedankt.gradle.plugins:android-apt:1.2+'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
maven { url "http://dl.bintray.com/populov/maven" }
jcenter()
mavenCentral()
maven { url "https://oss.sonatype.org/content/repositories/snapshots/" }
}
}
All my module build.grade
files have different dependencies. For instance.
dependencies {
compile fileTree(include: ['*.jar'], dir: 'libs')
//noinspection GradleDependency
compile 'com.nostra13.universalimageloader:universal-image-loader:1.9.3'
compile 'com.etsy.android.grid:library:1.0.5'
compile 'com.squareup.picasso:picasso:2.3.2'
compile 'com.nineoldandroids:library:2.4.0'
compile 'com.fasterxml.jackson.core:jackson-databind:2.5.3'
compile 'com.fasterxml.jackson.core:jackson-core:2.5.3'
compile 'com.fasterxml.jackson.core:jackson-annotations:2.5.3'
compile 'com.android.support:support-v4:22.2.0'
compile 'com.github.ksoichiro:android-observablescrollview:1.5.1'
compile 'com.viewpagerindicator:library:2.4.1@aar'
compile 'com.android.support:cardview-v7:21.0.3'
compile 'com.android.support:recyclerview-v7:21.0.3'
compile 'org.codehaus.jackson:jackson-mapper-asl:1.9.13'
compile('com.mikepenz.materialdrawer:library:2.9.7@aar') {
transitive = true
}
compile project(':horizontalrecyclerview')
compile project(':ultimaterecyclerview')
compile 'org.lucasr.twowayview:core:1.0.0-SNAPSHOT@aar'
compile 'org.lucasr.twowayview:layouts:1.0.0-SNAPSHOT@aar'
compile 'com.yqritc:recyclerview-flexibledivider:1.2.4'
compile 'de.greenrobot:eventbus:2.4.0'
compile 'com.malinskiy:superrecyclerview:1.1.0'
compile 'com.android.support:support-v4:22.2.0'
compile 'com.android.support:appcompat-v7:22.2.0'
compile 'com.android.support:recyclerview-v7:22.1.1'
}
What is the problem ? Some of my modules require the same library dependency, or all modules require the same library. When I add dependency to each module build.gradle
file, I get next error while project build.
Error:Execution failed for task ':app:processDebugResources'.
> Error: more than one library with package name 'com.mikepenz.iconics'
You can temporarily disable this error with android.enforceUniquePackageName=false
However, this is temporary and will be enforced in 1.0
How can I solve this problem ? Add dependency into the root build.gradle
file or some other solution.
Or simply follow advice and set
android.enforceUniquePackageName=false