android-studio - Android Studio中如何禁用一个Dependency中的一个Jar包?
PHP中文网
PHP中文网 2017-04-17 12:57:44
0
1
1087

才学习开发,如果问题太蠢了见谅| ω・´)

问题是:
我用Android Studio编译一个App,其中用到了一个xStream类库,然后我在Project Structure中的Dependencies添加了一个Library Dependency--xStream,它给我加了三个Jar包:

xstream.jar
xpp3_min.jar
xmlpull.jar

然后编译报错
UNEXPECTED TOP-LEVEL EXCEPTION:
com.android.dex.DexException: Multiple dex files define Lorg/xmlpull/v1/XmlPullParser;

查了下stackoverflow 链接 说是因为xmlpull.jar和Android自带的Jar冲突了,应该是要禁用它,stackoverflow那位题主用的是ProGuard,我看了看build.gradle里面没什么东西,对gradle不熟。。所以我该怎么禁用。。。求教

PHP中文网
PHP中文网

认证高级PHP讲师

reply all(1)
洪涛

There is a dependencies attribute in build.gradle, just delete the corresponding xmlpull.jar line
It is build.gradle under moudle, not build.gradle under project

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template