android - Multiple dex files define BuildConfig -


i migrating project eclipse android studio , have run problem. have lot of library modules shared between different projects, , several of these library modules have same package name, end following error:

agpbi: {"kind":"simple","text":"com.android.dex.dexexception: multiple dex files define lcom/foo/bar/buildconfig;","position":{},"original":"com.android.dex.dexexception: multiple dex files define lcom/foo/bar/buildconfig;"} 

my dependencies fine, that's not problem:

compile - classpath compiling main sources. +--- project :project1 |    +--- com.mixpanel.android:mixpanel-android:4.6.0 |    \--- com.google.android.gms:play-services-gcm:7.5.0 |         \--- com.google.android.gms:play-services-base:7.5.0 |              \--- com.android.support:support-v4:22.0.0 |                   \--- com.android.support:support-annotations:22.0.0 +--- project :facebook |    \--- com.parse.bolts:bolts-android:1.1.4 +--- com.google.android.gms:play-services-location:7.5.0 |    \--- com.google.android.gms:play-services-maps:7.5.0 +--- project :project2 |    \--- project :project3 |         \--- project :project4 |              \--- project :project5 +--- project :project6 \--- project :project7 

however, when search directories buildconfig.java, following results:

./project1/build/generated/source/buildconfig/androidtest/debug/com/foo/bar/test/buildconfig.java ./project1/build/generated/source/buildconfig/debug/com/foo/bar/buildconfig.java ./project1/build/generated/source/buildconfig/release/com/foo/bar/buildconfig.java ./project5/build/generated/source/buildconfig/androidtest/debug/com/foo/bar/test/buildconfig.java ./project5/build/generated/source/buildconfig/debug/com/foo/bar/buildconfig.java ./project5/build/generated/source/buildconfig/release/com/foo/bar/buildconfig.java ./project4/build/generated/source/buildconfig/androidtest/debug/com/foo/bar/test/buildconfig.java ./project4/build/generated/source/buildconfig/debug/com/foo/bar/buildconfig.java ./project4/build/generated/source/buildconfig/release/com/foo/bar/buildconfig.java 

it appears problem have several modules share namespace. there way around that? don't want have change namespace of other projects.

in classic display of cargo cult programming, tried adding:

dexoptions {     predexlibraries = false } 

to android block in app's build.gradle, made worse, , build started complaining other dependencies.

are there ways around short of renaming package names?

i solved changing package in manifest of of sub-modules, until had had same name libraries.


Comments

Popular posts from this blog

PHP DOM loadHTML() method unusual warning -

python - How to create jsonb index using GIN on SQLAlchemy? -

c# - TransactionScope not rolling back although no complete() is called -