简体   繁体   English

Gradle exclude模块不起作用?

[英]Gradle exclude module does not work?

When checking for library dupplication, I ran androidDependencies and got this: 在检查库重复项时,我运行了androidDependencies并得到了以下信息:

+--- com.melnykov:floatingactionbutton:1.2.0
|    \--- com.android.support:recyclerview-v7:21.0.2
+--- me.drakeet.materialdialog:library:1.2.2
+--- Android Workspace:SwipeLibrary:unspecified
|    \--- LOCAL: android-support-v4.jar
\--- com.android.support:appcompat-v7:22.0.0
     \--- com.android.support:support-v4:22.0.0
          \--- LOCAL: internal_impl-22.0.0.jar

so I excluded android support v4 in the app build.gradle: (theres no file in libs folder) 因此我在应用程序build.gradle中排除了android支持v4 :(在libs文件夹中没有文件)

   compile(project(':SwipeLibrary')) {
    exclude module: 'support-v4'
}

but apparently it does not work. 但显然不起作用。 The dexDebug still throws UNEXPECTED TOP-LEVEL EXCEPTION: java.lang.IllegalArgumentException: already added. dexDebug仍然抛出异常高的异常:java.lang.IllegalArgumentException:已经添加。 How can I get rid of this issue? 我如何摆脱这个问题?

For everyone who has the same problem as me (dexDebug throws Exception saying a library is already added - related to support_v4) maybe this will help you: Go to bin/dexedLibs and find the redundant libraries (in my case it is the nineoldandroids since android_support_v4 already has it) and rebuild your project. 对于每个与我有相同问题的人(dexDebug抛出异常,说已经添加了一个库-与support_v4相关),也许可以为您提供帮助:转到bin / dexedLibs并找到冗余库(在我的情况下,这是自android_support_v4起的nineoldandroid已经拥有它)并重建您的项目。 However you should do this at your own risk so remember to back up the files before attempting to delete them. 但是,这样做的后果自负,因此请记住在尝试删除文件之前先备份它们。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM