Android Studio Pre Dexing not working

I am trying to switch from Intellij Idea 12 to Android Studio 0.2.1. Currently, my Android project is configured using the maven-android-plugin. I use actionbarsherlock as an apklib dependency.

When I try to create a project with Android Studio, it does not work at the stage of preliminary depilation using

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 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 on xpp3 is on actionbarsherlock, and if you look at the structure of the project, you will see that it has a β€œprovided” area. So, in my opinion, this should not be pre-decoded or even included in apk.

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

Relations Frank

+6
source share
3 answers

I found a problem. This has nothing to do with android studio or using the toolbar, but with another apklib dependency that incorrectly declared dependencies on xpp3 and xmlParserApis with the β€œcompilation” of the area where it should be β€œprovided”.

Idea 12 had no problems with this, but an android studio / idea. 13 viewing seems stricter.

Simply changing the area to "provided" in the project structure solves the problem.

+11
source

I had the same problem. This structure worked for me at the end:

Copy the ABS to the project:

 Project β”œβ”€β”€ build.gradle β”œβ”€β”€ Module β”‚  β”œβ”€β”€ build.gradle β”‚  β”œβ”€β”€ libs β”‚  └── src β”œβ”€β”€ libraries β”‚  └── ABS β”‚  β”œβ”€β”€ build.gradle β”‚  β”œβ”€β”€ libraries β”‚  β”œβ”€β”€ libs β”‚  └── src └── settings.gradle 

Project / settings.gradle:

 include ':Module', ':libraries:ABS' 

Project / libraries / ABS / build.gradle:

 buildscript { repositories { mavenCentral() } dependencies { classpath 'com.android.tools.build:gradle:0.5.+' } } apply plugin: 'android-library' dependencies { compile "com.android.support:support-v4:13.0.0" } android { compileSdkVersion 17 buildToolsVersion "17.0.0" defaultConfig { minSdkVersion 9 targetSdkVersion 17 } } 

Project / module / build.gradle:

 buildscript { repositories { mavenCentral() } dependencies { classpath 'com.android.tools.build:gradle:0.5.+' } } apply plugin: 'android' dependencies { compile "com.android.support:support-v4:13.0.0" compile project(':libraries:ABS') } ... 
0
source

Just remove QName.class from the xpp3 flag.

-1
source

Source: https://habr.com/ru/post/949801/


All Articles