无法将类转换为统一的dex格式

时间:2017-08-21 10:32:04

标签: android unity3d sdk java-8 dex

我正在使用较旧的firebase版本和gvr 1.30 ..现在当我将firebase版本更新到4.0.3时,我无法在构建结束时将类转换为dex格式。

commandInvokationFailure: Unable to convert classes into dex format.
C:/Program Files/Java/jdk1.8.0_60\bin\java.exe -Xmx2048M -Dcom.android.sdkmanager.toolsdir="E:/sdk\tools" -Dfile.encoding=UTF8 -jar "C:\Program Files\Unity\Editor\Data\PlaybackEngines\AndroidPlayer/Tools\sdktools.jar" -

logcat: -

stderr[
Uncaught translation error: java.lang.IllegalArgumentException: already 
added: Lcom/google/protobuf/GeneratedExtensionRegistryLoader;
Uncaught translation error: java.lang.IllegalArgumentException: already 
added: 
Landroid/support/v4/accessibilityservice/AccessibilityServiceInfoCompat;
Uncaught translation error: java.lang.IllegalArgumentException: already added:Landroid/support/v4/accessibilityservice/AccessibilityServiceInfoCompat$AccessibilityServiceInfoIcsImpl;
Uncaught translation error: java.lang.IllegalArgumentException: already added: Landroid/support/v4/accessibilityservice/AccessibilityServiceInfoCompat$AccessibilityServiceInfoStubImpl;
Uncaught translation error: java.lang.IllegalArgumentException: already added: Landroid/support/v4/accessibilityservice/AccessibilityServiceInfoCompat$AccessibilityServiceInfoVersionImpl;
Uncaught translation error: java.lang.IllegalArgumentException: already added: Landroid/support/v4/animation/AnimatorCompatHelper;
Uncaught translation error: java.lang.IllegalArgumentException: already added: Landroid/support/v4/app/ActionBarDrawerToggle;
Uncaught translation error: java.lang.IllegalArgumentException: already added: Landroid/support/v4/app/ActionBarDrawerToggle$ActionBarDrawerToggleImpl;
Uncaught translation error: java.lang.IllegalArgumentException: already added: Landroid/support/v4/app/ActionBarDrawerToggle$ActionBarDrawerToggleImplBase;

UNEXPECTED TOP-LEVEL EXCEPTION:
java.lang.RuntimeException: Translation has been interrupted
at com.android.dx.command.dexer.Main.processAllFiles(Main.java:613)
at com.android.dx.command.dexer.Main.runMonoDex(Main.java:311)
at com.android.dx.command.dexer.Main.run(Main.java:277)
at com.android.dx.command.dexer.Main.main(Main.java:245)
at com.android.dx.command.Main.main(Main.java:106)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:497)
at SDKMain.main(SDKMain.java:129)
Caused by: java.lang.InterruptedException: Too many errors
at com.android.dx.command.dexer.Main.processAllFiles(Main.java:605)
... 9 more
]
stdout[
processing archive 

E:\Backup\WorkShop\VRQuiz\Source\Unity\Temp\StagingArea\android-
libraries\firebase-analytics-11.0.4\libs\.\classes.jar...
ignored resource META-INF/
ignored resource META-INF/MANIFEST.MF
ignored resource com/
ignored resource com/google/
ignored resource com/google/android/
ignored resource com/google/android/gms/
ignored resource com/google/android/gms/measurement/
processing 
com/google/android/gms/measurement/AppMeasurementContentProvider.class...
processing com/google/android/gms/measurement/AppMeasurementInstallReferrerReceiver.class...
processing com/google/android/gms/measurement/AppMeasurementJobService.class...
processing com/google/android/gms/measurement/AppMeasurementReceiver.class...
processing com/google/android/gms/measurement/AppMeasurementService.class...
processing archive 
E:\Backup\WorkShop\VRQuiz\Source\Unity\Temp\StagingArea\android-
libraries\firebase-analytics-impl-11.0.4\libs\.\classes.jar...
ignored resource META-INF/
ignored resource META-INF/MANIFEST.MF
ignored resource com/
ignored resource com/google/
ignored resource com/google/android/
ignored resource com/google/android/gms/
ignored resource com/google/android/gms/internal/
processing com/google/android/gms/internal/zzcec.class...
processing com/google/android/gms/measurement/AppMeasurement$zzb.class...
ignored resource com/google/firebase/
ignored resource com/google/firebase/analytics/
processing com/google/firebase/analytics/FirebaseAnalytics.class...
processing com/google/firebase/analytics/FirebaseAnalytics$Event.class...
processing com/google/firebase/analytics/FirebaseAnalytics$Param.class...
processing 
com/google/firebase/analytics/FirebaseAnalytics$UserProperty.class...
ignored resource 
E:\Backup\WorkShop\VRQuiz\Source\Unity\Temp\StagingArea\android-
libraries\firebase-app-unity-4.0.3\libs\.\armeabi-v7a\libApp.so
processing archive 
E:\Backup\WorkShop\VRQuiz\Source\Unity\Temp\StagingArea\android-
libraries\firebase-app-unity-4.0.3\libs\.\classes.jar...
ignored resource 
E:\Backup\WorkShop\VRQuiz\Source\Unity\Temp\StagingArea\android-
libraries\firebase-app-unity-4.0.3\libs\.\x86\libApp.so
processing archive 
E:\Backup\WorkShop\VRQuiz\Source\Unity\Temp\StagingArea\android-
libraries\firebase-auth-11.0.4\libs\.\classes.jar...
ignored resource META-INF/
ignored resource META-INF/MANIFEST.MF
ignored resource com/
ignored resource com/google/
ignored resource com/google/android/
ignored resource com/google/android/gms/
ignored resource com/google/android/gms/internal/
processing com/google/android/gms/internal/jn.class...
processing com/google/android/gms/internal/jo.class...
processing com/google/android/gms/int<message truncated>

2 个答案:

答案 0 :(得分:0)

它是由于重复的jar或aar文件引起的。使用“GeneratedExtensionRegistryLoader”等在终端中使用“grep -r”字符串“”path“命令搜索所有jar,并通过在unity plugins文件夹中只保留一个来删除重复项。这应该可以解决问题。

答案 1 :(得分:-1)

当我删除&#34; gvr_android_common.aar&#34;文件,项目正在构建,但现在应用程序崩溃。