简体   繁体   English

Android Socialize SDK:无法执行dex:多个dex文件定义

[英]Android Socialize SDK: Unable to execute dex: Multiple dex files define

I'm using Socialize SDK in my Android app project (API 18). 我在我的Android应用程序项目(API 18)中使用Socialize SDK

I have read its Getting Started documentation and followed the instruction on how to implement it. 我已阅读其入门文档,并按照有关如何实现它的说明进行操作。

However, I come across several problems regarding library imports. 但是,我遇到了一些关于库导入的问题。 I've tried to put all the JAR files inside my project's /libs folder but it couldn't locate the drawables, because clearly I haven't include their /res folder. 我试图将所有JAR文件放在我的项目的/libs文件夹中,但它无法找到drawables,因为很明显我没有包含他们的/res文件夹。

So, I configured the Build Path of my project to include the Libraries. 因此,我将项目的构建路径配置为包含库。 Now this error shows up: 现在出现此错误:

[2013-11-20 10:11:04 - Dex Loader] Unable to execute dex: Multiple dex files define Landroid/support/v4/accessibilityservice/AccessibilityServiceInfoCompat$AccessibilityServiceInfoVersionImpl;

[2013-11-20 10:11:04 - WebShopper] Conversion to Dalvik format failed: Unable to execute dex: Multiple dex files define Landroid/support/v4/accessibilityservice/AccessibilityServiceInfoCompat$AccessibilityServiceInfoVersionImpl;

I have already imported Socialize project folder into Eclipse in order to use its libraries. 我已经将Socialize项目文件夹导入Eclipse以便使用它的库。 But I couldn't figure out how to solve this error. 但我无法弄清楚如何解决这个错误。

Here is how my Build Path currently looks like, if it helps: 以下是我的Build Path目前的样子,如果它有帮助:

Java构建路径

What's wrong with it? 它出什么问题了? Are there any duplicated libraries I have to remove here? 我必须删除任何重复的库吗?

If anything, please let me know. 如果有的话,请告诉我。

I don't know exactly what is the problem, it may be because of same class definition in multiple jar files. 我不知道究竟是什么问题,可能是因为多个jar文件中的相同类定义。 I also had same problem once but resolved it by removing one jar file from my lib folder. 我也遇到过同样的问题但是通过从我的lib文件夹中删除一个jar文件来解决它。

Here is some links which may help you out in coming out of this problem 这里有一些链接可以帮助您解决这个问题

Unable to execute dex: Multiple dex files define Lcom/myapp/R$array; 无法执行dex:多个dex文件定义Lcom / myapp / R $数组;

Getting "Unable to execute dex: Multiple dex files define" error when trying to run main project which is using other library project 在尝试运行使用其他库项目的主项目时,获取“无法执行dex:多个dex文件定义”错误

This type of error occur because of multiple libraries or jar files in your project.Do the following: 由于项目中有多个库或jar文件,会发生此类错误。请执行以下操作:

  1. Delete the imported library first. 首先删除导入的库。
  2. Then clean your project. 然后清理您的项目。
  3. Go to project properties,then click on java build path, Library and then import jar. 转到项目属性,然后单击java构建路径,Library,然后导入jar。
  4. Then refresh your project and run again. 然后刷新项目并再次运行。

Hope this would help you..:) 希望这会帮助你.. :)

Go to bin, dexedLibs of the project and delete the duplicate libs over there. 转到项目的bin,dexedLibs并删除那里的重复库。 The most common reason for this issue would be, a local version of the jar in the projects lib folder and in java build path the user may add the same jar again to the project. 这个问题的最常见原因是,项目lib文件夹中的jar的本地版本以及java构建路径中的用户可能会再次将相同的jar添加到项目中。 Which will reflect in the dexedLibs folder. 这将反映在dexedLibs文件夹中。 Compiler wont be able to resolve the call to the exact class in this case. 在这种情况下,编译器无法解析对完全类的调用。 Delete the jars in the lib and in the dexedLibs. 删除lib和dexedLibs中的jar。 Clean and build. 清洁和建造。

For me the issue was that, i had added a lib project(autobahn lib) earlier and later switched the to Jar file of the same library.Though i had removed references to the older library project, i was getting this error. 对我来说问题是,我之前添加了一个lib项目(autobahn lib),后来又切换到了同一个库的Jar文件。虽然我已经删除了对旧库项目的引用,但我收到了这个错误。 Following all the answers here i checked the build path etc. But i haven't added these libs to build path manually. 按照这里的所有答案,我检查了构建路径等。但我还没有添加这些库来手动构建路径。 So i had nothing to remove. 所以我没有什么可以删除。 Finally came across this folder. 终于遇到了这个文件夹。

bin/dexedLibs 斌/ dexedLibs

I noticed that there were two jar files with the same name corresponding to autobahn Android which was causing the conflict. 我注意到有两个同名的jar文件对应于高速公路Android,导致冲突。 So i deleted all the jar files in the dexedLibs folder and rebuild the project. 所以我删除了dexedLibs文件夹中的所有jar文件并重建了项目。 That resolved the issue. 这解决了这个问题。

I solved this exception by placing all the jar files in the same disk . 我通过将所有jar files放在同一个disk解决了这个异常。

For Eg : D drive including your project workspace +jar files in the same drive. 对于EgD drive包括同一驱动器中的项目workspace + jar文件。

Whenever you meet this problem, you must read the message. 每当遇到此问题时,您必须阅读该消息。 From literally,We can see you have same class file in you project that is android/support/v4/accessibilityservice/AccessibilityServiceInfoCompat$AccessibilityServiceInfoVersionImpl. 从字面上看,我们可以看到你在项目中有相同的类文件,即android / support / v4 / accessibilityservice / AccessibilityServiceInfoCompat $ AccessibilityServiceInfoVersionImpl。

If you can't find those two library repeated? 如果你找不到那两个重复的库? You just need to make a new project, and copy all jar files to the new project /libs directory. 您只需要创建一个新项目,并将所有jar文件复制到新项目/ libs目录中。 Run as--->it error--->Then you delete some jar-->Build project--->Run as.Util you delete some jar,The project is Run as normally,Then you unzip the jar file,you will find the class in the error message. 运行为--->它的错误--->然后你删除一些jar - > Build项目--->运行as.Util你删除一些jar,项目是正常运行,然后你解压缩jar文件,你将在错误消息中找到该类。 Now, you find out the two library, just to decide delete one. 现在,您找到了两个库,只是为了决定删除一个。

暂无
暂无

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

相关问题 无法执行dex:多个dex文件已定义 - Unable to execute dex: Multiple dex files define Eclipse / Java / Android无法执行dex:定义了多个dex文件 - Eclipse/Java/Android Unable to execute dex: Multiple dex files define 无法执行 dex:多个 dex 文件定义了 Lbolts/AggregateException - Unable to execute dex: Multiple dex files define Lbolts/AggregateException 无法执行dex:定义了多个dex文件…或NoClassDefFoundError - Unable to execute dex: Multiple dex files define… OR NoClassDefFoundError 无法执行dex:多个dex文件定义Lcom / google / android / gms / analytics / internal / Command - Unable to execute dex: Multiple dex files define Lcom/google/android/gms/analytics/internal/Command 无法执行dex:多个dex文件定义Lcom / facebook / android / AsyncFacebookRunner $ 1; - Unable to execute dex: Multiple dex files define Lcom/facebook/android/AsyncFacebookRunner$1; 无法执行dex:多个dex文件定义了Lcom / google / android / gms / ads / AdActivity; - Unable to execute dex: Multiple dex files define Lcom/google/android/gms/ads/AdActivity; java android Eclipse Retrofit 2.0 转换为 Dalvik 格式失败:无法执行 dex:多个 dex 文件定义了 Lretrofit2/Converter - java android Eclipse retrofit 2.0 Conversion to Dalvik format failed: Unable to execute dex: Multiple dex files define Lretrofit2/Converter 无法执行dex:多个dex文件定义了&java.lang.NoClassDefFoundError - Unable to execute dex: Multiple dex files define & java.lang.NoClassDefFoundError 无法执行dex:多个dex文件定义Ljavax / ws / rs / core / MultivaluedMap异常 - Unable to execute dex: Multiple dex files define Ljavax/ws/rs/core/MultivaluedMap exception
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM