问题
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