Status Update
Comments
tn...@google.com <tn...@google.com>
do...@dolphy.eu <do...@dolphy.eu> #2
Building with eclipse also fails for me since upgrading to r21.
xa...@android.com <xa...@android.com> #3
Do some of your libraries and/or the app share the same package name? this could trigger this bug I think.
ic...@gmail.com <ic...@gmail.com> #4
Oh btw, building with eclipse now also fails for me. Seems i hadn't fully upgraded the Plugin to v21 by the time.
Yes, our library projects all share the same package name and we use the manifest merger.
Yes, our library projects all share the same package name and we use the manifest merger.
do...@dolphy.eu <do...@dolphy.eu> #5
It happens when not using manifest merger too.
xa...@android.com <xa...@android.com> #6
We have made a fix to better support setup when libraries share package name.
Note that it will only work if *all* libraries share the same package name. If only some do, then the build will fail.
We will be releasing this shortly.
Note that it will only work if *all* libraries share the same package name. If only some do, then the build will fail.
We will be releasing this shortly.
mc...@gmail.com <mc...@gmail.com> #7
The issue is still there in ADT 21.0.1 (platform tools 16.0.1) when building with Ant.
It is fixed in ADT, though, so Eclipse builds fine.
I attached a ZIP file containing a simple project setup that leads to this error.
It seems that Ant generates another Manifest.java file in the final project which is not the case for ADT.
There is also *another* error when multiple projects define permissions.
For example, in my project setup, if LibA defines
<permission android:name="com.example.adttest.permission.READ_PROVIDER" />
and LibB defines
<permission android:name="com.example.adttest.permission.READ_OTHER_PROVIDER" />
both ADT and Ant will fail to build.
It is fixed in ADT, though, so Eclipse builds fine.
I attached a ZIP file containing a simple project setup that leads to this error.
It seems that Ant generates another Manifest.java file in the final project which is not the case for ADT.
There is also *another* error when multiple projects define permissions.
For example, in my project setup, if LibA defines
<permission android:name="com.example.adttest.permission.READ_PROVIDER" />
and LibB defines
<permission android:name="com.example.adttest.permission.READ_OTHER_PROVIDER" />
both ADT and Ant will fail to build.
xa...@android.com <xa...@android.com> #8
I'll check this, thanks for the project.
re...@gmail.com <re...@gmail.com> #9
[Comment deleted]
re...@gmail.com <re...@gmail.com> #10
Are there any fixes yet? Still have this problem in ADT 21.1.0
ga...@gmail.com <ga...@gmail.com> #11
Still happening with ADT 22 while Gradle works fine.
ja...@gmail.com <ja...@gmail.com> #12
I had a very similar issue. I had to:
1. Make all libraries and projects use different package name in their manifest
2. Delete all bin/ directories
3. Delete all gen/ directories
ALL of these steps were necessary. I had different "Multiple dex files define ..." errors depending on how clean my build environment was.
To be really specific, as long as the multiple classes.jar files contain duplicate items, dex will complain. With step 1-2-3 above I could eliminate all duplicates, all my classes.jar files contain distinct items.
I hope this helps.
1. Make all libraries and projects use different package name in their manifest
2. Delete all bin/ directories
3. Delete all gen/ directories
ALL of these steps were necessary. I had different "Multiple dex files define ..." errors depending on how clean my build environment was.
To be really specific, as long as the multiple classes.jar files contain duplicate items, dex will complain. With step 1-2-3 above I could eliminate all duplicates, all my classes.jar files contain distinct items.
I hope this helps.
ch...@gmail.com <ch...@gmail.com> #13
Thanks -Janos.Gyerik your suggestion worked for me...
ic...@gmail.com <ic...@gmail.com> #14
I still find it strange that permission-distribution to multiple library projects with same package name is not supported. But as this even continues with gradle (and afaik is even enforced more strictly there) it seems the way to go.
Just for reference if you are in need for the old "build-tools" i think they can be found here:http://dl-ssl.google.com/android/repository/platform-tools_r14-linux.zip
Just for reference if you are in need for the old "build-tools" i think they can be found here:
xa...@android.com <xa...@android.com>
jv...@google.com <jv...@google.com> #15
Thank you for reporting this issue. At this time it appears this feedback is no longer relevant with the latest version of Android Studio. If you continue to experience this issue please open a new bug and we can reinvestigate
Description
While with eclipse the build of our multi library project works fine, with ant i get the following error message when running "ant release":
com.android.dx.util.DexException: Multiple dex files define Lcom/my/app/Manifest$permission;
Also see:
OS: Win7
Ant: 1.8.3
STEPS TO REPRODUCE:
1. Create project with multiple libraries and manifests (manifest merger enabled), the Manifest files use the same package name throughout.
2. Build with eclipse -> works
3. Build with ant (tools r20) -> works
4. Build with ant (tolls r21) -> fails
EXPECTED RESULTS:
Also works with ant.
OBSERVED RESULTS:
com.android.dx.util.DexException: Multiple dex files define Lcom/my/app/Manifest$permission;