Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Android Studio Pre Dexing fails

I'm trying to switch from Intellij Idea 12 to Android Studio 0.2.1 Currently my android project is setup with the maven-android-plugin. I use actionbarsherlock as an apklib dependency.

When I try to build the project with Android Studio it fails at the pre-dexing phase with

Error:Android Pre Dex: [xpp3-1.1.4c.jar] trouble processing "javax/xml/namespace/QName.class":
Error:Android Pre Dex: [xpp3-1.1.4c.jar] Ill-advised or mistaken usage of a core class (java.* or javax.*)
Error:Android Pre Dex: [xpp3-1.1.4c.jar] when not building a core library.
Error:Android Pre Dex: [xpp3-1.1.4c.jar] This is often due to inadvertently including a core library file
Error:Android Pre Dex: [xpp3-1.1.4c.jar] in your application's project, when using an IDE (such as
Error:Android Pre Dex: [xpp3-1.1.4c.jar] Eclipse). If you are sure you're not intentionally defining a
Error:Android Pre Dex: [xpp3-1.1.4c.jar] core class, then this is the most likely explanation of what's
Error:Android Pre Dex: [xpp3-1.1.4c.jar] going on.

However the only dependency to xpp3 is from actionbarsherlock and if you look into the project structure you see that it has scope "provided". So in my opinion this should not be pre-dexed or included into the apk at all.

Have you made similar observations? Or did you get an android-maven-project with actionbarsherlock dependency to build in android studio? Any hints on how to get this working with android studio are appreciated :)

Regards Frank

like image 918
Frank Avatar asked Jul 19 '13 07:07

Frank


1 Answers

I have found the problem. It has nothing to do with android studio or with actionbar sherlock but with another apklib dependency that incorrectly declared to have dependencies to xpp3 and xmlParserApis with scope "compile" where it should be "provided".

Idea 12 had no problems with this but android studio/idea 13 preview seems to be more strict.

Just changing the scope to "provided" in the project structure solves the problem.

like image 61
Frank Avatar answered Nov 19 '22 21:11

Frank