我正试图从IntelliJ IDEA 12切换到Android Studio 0.2.1
目前我的android项目是用maven android插件安装的。我使用actionBarSherlock作为apklib依赖项。
当我尝试用android studio构建项目时,它在预索引阶段失败了
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.
但是,xpp3的唯一依赖项来自actionbarsherlock,如果您查看项目结构,就会发现它具有“provided”范围。因此,在我看来,这不应该预先编制索引,也不应该包含在apk中。
你也做过类似的观察吗?或者你在android studio中构建了一个带有actionbarsherlock依赖项的android maven项目?任何关于如何使用android studio的提示都将不胜感激:)
当做
弗兰克
最佳答案
我发现了问题。它与android studio或actionbar sherlock无关,而是与另一个apklib依赖项无关,后者被错误地声明为与xpp3和xmlparserapis具有依赖项,而xpp3和xmlparserapis的作用域是“compile”,应该“provided”。
idea 12对此没有问题,但android studio/idea 13的预览版似乎更加严格。
只要在项目结构中将范围改为“provided”就解决了这个问题。