Unity 5.1.1 android “merged manifest” or “classes into dex format” error

荒凉一梦 提交于 2019-12-12 02:23:03

问题


I tried this versions on my unity 5.1.1 (6.2.2, 7.0.1, 7.0.2) and I get errors in all when I build that in android.

Any idea?

In the 'stable version 6.2.2 I get "unable to convert files into dex format"

errors:

1. CommandInvokationFailure: Unable to convert classes into dex format. See the Console for details.

C:\Program Files\Java\jdk1.7.0_17\bin\java.exe -Xmx2048M -Dcom.android.sdkmanager.toolsdir="C:/Program Files (x86)/Android/android-sdk\tools" -Dfile.encoding=UTF8 -jar "C:/Program Files/Unity/Editor/Data/BuildTargetTools/AndroidPlayer\sdktools.jar" - stderr[ UNEXPECTED TOP-LEVEL EXCEPTION: java.lang.IllegalArgumentException: already added: Landroid/support/v4/util/TimeUtils; ets..

2. Error building Player: CommandInvokationFailure: Unable to convert classes into dex format. See the Console for details.

C:\Program Files\Java\jdk1.7.0_17\bin\java.exe -Xmx2048M -Dcom.android.sdkmanager.toolsdir="C:/Program Files (x86)/Android/android-sdk\tools" -Dfile.encoding=UTF8 -jar "C:/Program Files/Unity/Editor/Data/BuildTargetTools/AndroidPlayer\sdktools.jar" - stderr[ UNEXPECTED TOP-LEVEL EXCEPTION: java.lang.IllegalArgumentException: already added: Landroid/support/v4/util/TimeUtils; at com.android.dx.dex.file.ClassDefsSection.add(ClassDefsSection.java:122) at com.android.dx.dex.file.DexFile.add(DexFile.java:161) at

ets..

In the 7.0.2 I get "can't merge manifest files"


回答1:


This is most likely a result of having duplicate .jar files in your project. Try searching where your TimeUtils is, and making sure there are no similar .jar files in your Assets/Plugins/Android folder -- make sure to check deeper into folders within the Android folder. Note that it might not be an exact duplicate title (a different version number might also cause the problem).

I had this same issue with the push notifications plugin on my app (I had 2 so I removed one).



来源:https://stackoverflow.com/questions/31348140/unity-5-1-1-android-merged-manifest-or-classes-into-dex-format-error

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!