не удалось преобразовать dex в формат unity

#unity3d #sdk

#unity3d #sdk

Вопрос:

Я не могу встроить unity5.4.1f1, потому что всякий раз, когда я пытаюсь встроить свою игру в платформу Android, она говорит:

не удалось преобразовать dex в формат unity

Вот ошибка, которую я получил:

 CommandInvokationFailure: Unable to convert classes into dex format.
C:Program FilesJavajdk1.8.0_102binjava.exe -Xmx2048M -    Dcom.android.sdkmanager.toolsdir="C:Program Files (x86)Androidandroid-        sdktools" -Dfile.encoding=UTF8 -jar "C:Program         FilesUnityEditorDataPlaybackEnginesAndroidPlayer/Toolssdktools.jar" -

stderr[
Uncaught translation error: java.lang.IllegalArgumentException: already     added: Lcom/google/protobuf/nano/CodedInputByteBufferNano;
Uncaught translation error: java.lang.IllegalArgumentException: already     added: Lcom/google/protobuf/nano/CodedOutputByteBufferNano;
Uncaught translation error: java.lang.IllegalArgumentException: already     added:     Lcom/google/protobuf/nano/CodedOutputByteBufferNano$OutOfSpaceException;
Uncaught translation error: java.lang.IllegalArgumentException: already     added: Lcom/google/protobuf/nano/ExtendableMessageNano;
Uncaught translation error: java.lang.IllegalArgumentException: already     added: Lcom/google/protobuf/nano/Extension;
Uncaught translation error: java.lang.IllegalArgumentException: already added: Lcom/google/protobuf/nano/Extension$1;
Uncaught translation error: java.lang.IllegalArgumentException: already added: Lcom/google/protobuf/nano/Extension$PrimitiveExtension;
Uncaught translation error: java.lang.IllegalArgumentException: already added: Lcom/google/protobuf/nano/FieldArray;
Uncaught translation error: java.lang.IllegalArgumentException: already added: Lcom/google/protobuf/nano/FieldData;

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:498)
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     C:UsersNetteDocumentsLearnSomethingNewThesisTempStagingAreaandroid-    librariesgvr_android_commonlibs.classes.jar...
ignored resource META-INF/
ignored resource META-INF/MANIFEST.MF
ignored resource clearcut/
ignored resource clearcut/nano/
processing clearcut/nano/EventCodeEnumProto.class...
ignored resource com/
ignored resource com/google/
ignored resource com/google/common/
ignored resource com/google/common/logging/
ignored resource com/google/common/logging/nano/
processing com/google/common/logging/nano/Eventid.class...
processing     com/google/common/logging/nano/Eventid$ClientEventIdMessage.class...
processing com/google/common/logging/nano/Eventid$EventIdMessage.class...
processing com/google/common/logging/nano/GmmInteractionKeyInfo.class...
processing     com/google/common/logging/nano/GmmInteractionKeyInfo$GMMInteractionKeyInfo.cl    ass...
processing com/google/common/logging/nano/GwsInteractionKeyInfo.class...
processing     com/google/common/logging/nano/GwsInteractionKeyInfo$GWSInteractionKeyInfo.cl    ass...
processing     com/google/common/logging/nano/GwsInteractionKeyInfo$SignedInUserStatus.class    ...
processing com/google/common/logging/nano/InteractionKey.class...
processing com/google/common/logging/nano/RequestContext.class...
processing     com/google/common/logging/nano/RequestContext$GWSRequestContext.class...
processing com/google/common/logging/nano/RequestContext$UIState.class...
processing     com/google/common/logging/nano/RequestContext$UIState$ToggleState.class...
processing com/google/common/logging/nano/UserActionEnum.class...
processing     com/google/common/logging/nano/UserActionEnum$CardinalDirection.class...
processing     com/google/common/logging/nano/UserActionEnum$UserAction.class...
processing com/google/common/logging/nano/Vr.class...
processing com/google/common/logging/nano/Vr$VREvent.class...
processing com/google/common/logging/nano/Vr$VREvent$Application.class...
processing com/google/common/logging/nano/Vr$VREvent$AudioStats.class...
processing     com/google/common/logging/nano/Vr$VREvent$AudioStats$RenderingMode.class...
processing com/google/common/logging/nano/Vr$VREvent$Bucket.class...
processing com/google/common/logging/nano/Vr$VREvent$Cyclops.class...
processing     com/google/common/logging/nano/Vr$VREvent$Cyclops$Capture.class...
processing     com/google/common/logging/nano/Vr$VREvent$Cyclops$Capture$Outcome.class...
processing com/google/common/logging/nano/Vr$VREvent$Cyclops$Share.class...
processing com/google/common/logging/nano/Vr$VREvent$Cyclops$Share$Type.class...
processing com/google/common/logging/nano/Vr$VREvent$Cyclops$View.class...
processing com/google/common/logging/nano/Vr$VREvent$Cyclops$View$Orientation.class...
processing com/google/common/logging/nano/Vr$VREvent$EmbedVrWidget.class...
processing     com/google/common/logging/nano/Vr$VREvent$EmbedVrWidget$Pano.class...
processing com/google/common/logging/nano/Vr$VREvent$EmbedVrWidget$StereoFormat.class...
processing com/google/common/logging/nano/Vr$VREvent$EmbedVrWidget$Video.class...
processing com/google/common/logging/nano/Vr$VREvent$EmbedVrWidget$ViewMode.class...
processing com/google/common/logging/nano/Vr$VREvent$EventType.class...
processing com/google/common/logging/nano/Vr$VREvent$HeadMount.class...
processing     com/google/common/logging/nano/Vr$VREvent$HistogramBucket.class...
processing com/google/common/logging/nano/Vr$VREvent$PerformanceStats.class...
processing com/google/common/logging/nano/Vr$VREvent$QrCodeScan.class...
processing     com/google/common/logging/nano/Vr$VREvent$QrCodeScan$Status.class...
processing com/google/common/logging/nano/Vr$VREvent$SensorStats.class...
processing com/google/common/logging/nano/Vr$VREvent$SensorStats$GyroscopeStats.class...
processing com/google/common/logging/nano/Vr$VREvent$SensorStats$Vector3.class...
processing com/google/common/logging/nano/Vr$VREvent$TimeSeriesData.class...
processing com/google/common/logging/nano/Vr$VREvent$TimeSeriesData$TimeIntervalData.cla    ss...
processing com/google/common/logging/nano/Vr$VREvent$VrCore.class...
processing     com/google/common/logging/nano/Vr$VREvent$VrCore$ErrorCode.class...
processing     com/google/common/logging/nano/Vr$VREvent$VrCore$Permission.class...
ignored resource com/google/protobuf/
ignored resource com/google/protobuf/nano/
processing com/google/protobuf/nano/CodedInputByteBufferNano.class...
processing com/google/protobuf/nano/CodedOutputByteBufferNano.class...
processing     com/google/protobuf/nano/CodedOutputByteBufferNano$OutOfSpaceException.class.    ..
processing com/google/protobuf/nano/DescriptorProtos.class...
processing     com/google/protobuf/nano/DescriptorProtos$DescriptorProto.class...
processing     com/google/protobuf/nano/DescriptorProtos$DescriptorProto$ExtensionRange.clas    s...
processing     com/google/protobuf/nano/DescriptorProtos$DescriptorProto$ReservedRange.class    ...
 processing com/google/protobuf/nano/DescriptorProtos$EnumDescriptorProto.class...
processing com/google/protobuf/nano/DescriptorProtos$EnumOptions.class...
processing     com/google/protobuf/nano/DescriptorProtos$EnumValueDescriptorProto.class...
processing com/google/protobuf/nano/DescriptorProtos$EnumValueOptions.class...
processing com/google/protobuf/nano/DescriptorProtos$FieldDescriptorProto.class...
processing com/google/protobuf/nano/DescriptorProtos$FieldDescriptorProto$Label.class...
processing com/google/protobuf/nano/DescriptorProtos$FieldDescriptorProto$Type.class...
processing com/google/protobuf/nano/DescriptorProtos$FieldOptions.class...
processing com/google/protobuf/nano/DescriptorProtos$FieldOptions$CType.class...
processing com/google/protobuf/nano/DescriptorProtos$FieldOptions$JSType.class...
processing com/google/protobuf/nano/DescriptorProtos$FieldOptions$JType.class...
processing com/google/protobuf/nano/DescriptorProtos$FieldOptions$UpgradedOption.class..    .
processing com/google/protobuf/nano/DescriptorProtos$FileDescriptorProto.class...
processing com/google/protobuf/nano/DescriptorProtos$FileDescriptorSet.class...
processing com/google/protobuf/nano/DescriptorProtos$FileOptions.class...
processing com/google/protobuf/nano/DescriptorProtos$FileOptions$CompatibilityLevel.clas    s...
processing com/google/protobuf/nano/DescriptorProtos$FileOptions$OptimizeMode.class...
processing com/google/protobuf/nano/DescriptorProtos$GeneratedCodeInfo.class...
processing com/google/protobuf/nano/DescriptorProtos$GeneratedCodeInfo$Annotation.class.    ..
processing com/google/protobuf/nano/DescriptorProtos$MessageOptions.class...
processing com/google/protobuf/nano/DescriptorProtos$MethodDescriptorProto.class...
processing com/google/protobuf/nano/DescriptorProtos$MethodOptions.class...
processing com/google/protobuf/nano/DescriptorProtos$MethodOptions$Format.class...
processing com/google/protobuf/nano/DescriptorProtos$MethodOptions$LogLevel.class...
processing com/google/protobuf/nano/DescriptorProtos$MethodOptions$Protocol.class...
processing com/google/protobuf/nano/DescriptorProtos$MethodOptions$SecurityLevel.class..    .
processing com/google/protobuf/nano/DescriptorProtos$MethodOptions$TokenUnit.class...
processing com/google/protobuf/nano/DescriptorProtos$OneofDescriptorProto.class...
processing com/google/protobuf/nano/DescriptorProtos$OneofOptions.class...
processing com/google/protobuf/nano/DescriptorProtos$ServiceDescriptorProto.class...
processing     com/google/protobuf/nano/DescriptorProtos$ServiceOptions.class...
processing com/google/protobuf/nano/DescriptorProtos$SourceCodeInfo.class...
processing com/google/protobuf/nano/DescriptorProtos$SourceCodeInfo$Location.class...
processing com/google/protobuf/nano/DescriptorProtos$StreamDescriptorProto.class...
processing com/google/protobuf/nano/DescriptorProtos$StreamOptions.class...
processing com/google/protobuf/nano/DescriptorProtos$StreamOptions$TokenUnit.class...
processing com/google/protobuf/nano/DescriptorProtos$UninterpretedOption.class...
processing com/google/protobuf/nano/DescriptorProtos$UninterpretedOption$NamePart.class.    ..
processing com/google/protobuf/nano/ExtendableMessageNano.class...
processing com/google/protobuf/nano/Extension.class...
processing com/google/protobuf/nano/Extension$1.class...
processing com/google/protobuf/nano/Extension$PrimitiveExtension.class...
processing com/google/protobuf/nano/FieldArray.class...
processing com/google/protobuf/nano/FieldData.class...
processing com/google/protobuf/nano/InternalNano.class...
processing com/google/protobuf/nano/InvalidProtocolBufferNanoException.class...
processing com/google/protobuf/nano/MessageNano.class...
processing com/google/protobuf/nano/MessageNanoPrinter.class...
processing com/google/protobuf/nano/UnknownFieldData.class...
processing com/google/protobuf/nano/WireFormatNano.class...
ignored resource com/google/protobuf/nano/android/
processing     com/google/protobuf/nano/android/ParcelableExtendableMessageNano.class...
processing     com/google/protobuf/nano/android/ParcelableMessageNano.class...
processing     com/google/protobuf/nano/android/ParcelableMessageNanoCreator.class...
ignored resource com/google/protos/
ignored resource com/google/protos/datapol/
ignored resource com/google/protos/datapol/nano/
processing com/google/protos/datapol/nano/RetentionAnnotations.class...
processing com/google/protos/datapol/nano/RetentionAnnotations$RetentionSpec.class...
processing com/google/protos/datapol/nano/RetentionAnnotations$RetentionTag.class...
processing com/google/protos/datapol/nano/SemanticAnnotations.class...
processing com/google/protos/datapol/nano/SemanticAnnotations$DataFormat.class...
processing com/google/protos/datapol/nano/SemanticAnnotations$FieldDetails.class...
processing com/google/protos/datapol/nano/SemanticAnnotations$LocationQualifier.class...
processing com/google/protos/datapol/nano/SemanticAnnotations$MessageDetails.class...
processing com/google/protos/datapol/nano/SemanticAnnotations$Qualifier.class...
processing com/google/protos/datapol/nano/SemanticAnnotations$SemanticType.class...
ignored resource com/google/search/
ignored resource com/google/search/onenamespace/
ignored resource com/google/search/onenamespace/nano/
processing com/google/search/onenamespace/nano/OneNamespaceType.class...
ignored resource com/google/vr/
ignored resource com/google/vr/cardboard/
processing com/google/vr/cardboard/AndroidNCompat.class...
processing com/google/vr/cardboard/AndroidNCompat$1.class...
processing com/google/vr/cardboard/AndroidNCompat$2.class...
processing com/google/vr/cardboard/AndroidNCompat$3.class...
processing com/google/vr/cardboard/CardboardGLSurfaceView.class...
processing com/google/vr/cardboard/CardboardGLSurfaceView$DetachListener.class...
processing com/google/vr/cardboard/ConfigUtils.class...
processing     com/google/vr/cardboard/ContentProviderVrParamsProvider.class...
processing com/google/vr/cardboard/DisplaySynchronizer.class...
processing com/google/vr/cardboard/DisplayUtils.class...
processing com/google/vr/cardboard/EglFactory.class...
processing com/google/vr/cardboard/FrameMonitor.class...
processing com/google/vr/cardboard/FullscreenMode.class...
processing com/google/vr/cardboard/FullscreenMode$1.class...
processing com/google/vr/cardboard/FullscreenMode$1$1.class...
processing com/google/vr/cardboard/GLTextureView.class...
processing com/google/vr/cardboard/GLTextureView$1.class...
processing     com/google/vr/cardboard/GLTextureView$BaseConfigChooser.class...
processing com/google/vr/cardboard/GLTextureView$ComponentSizeChooser.class...
processing com/google/vr/cardboard/GLTextureView$DefaultContextFactory.class...
processing com/google/vr/cardboard/GLTextureView$DefaultWindowSurfaceFactory.class...
processing com/google/vr/cardboard/GLTextureView$EglHelper.class...
processing com/google/vr/cardboard/GLTextureView$GLThread.class...
processing com/google/vr/cardboard/GLTextureView$GLThreadManager.class...
processing com/google/vr/cardboard/GLTextureView$LogWriter.class...
processing com/google/vr/cardboard/GLTextureView$SimpleEGLConfigChooser.class...
processing com/google/vr/cardboard/GLTextureView$TraceCompat.class...
processing com/google/vr/cardboard/LegacyVrParamsProvider.class...
processing com/google/vr/cardboard/NFCUtils.class...
processing com/google/vr/cardboard/NFCUtils$1.class...
processing com/google/vr/cardboard/NativeLibraryLoader.class...
processing com/google/vr/cardboard/PackageUtils.class...
processing com/google/vr/cardboard/PerfMonitor.class...
processing com/google/vr/cardboard/PerfMonitor$1.class...
processing com/google/vr/cardboard/PermissionUtils.class...
processing com/google/vr/cardboard/PhoneParams.class...
processing com/google/vr/cardboard/PhoneParams$PpiOverride.class...
processing com/google/vr/cardboard/ScanlineRacingRenderer.class...
processing com/google/vr/cardboard/TransitionView.class...
processing com/google/vr/cardboard/TransitionView$1.class...
processing com/google/vr/cardboard/TransitionView$2.class...
processing com/google/vr/cardboard/TransitionView$3.class...
processing com/google/vr/cardboard/TransitionView$4.class...
processing com/google/vr/cardboard/TransitionView$5.class...
processing     com/google/vr/cardboard/TransitionView$TransitionListener.class...
processing com/google/vr/cardboard/UiLayer.class...
processing com/google/vr/cardboard/UiLayer$1.class...
processing com/google/vr/cardboard/UiLayer$10.class...
processing com/google/vr/cardboard/UiLayer$11.class...
processing com/google/vr/cardboard/UiLayer$12.class...
processing com/google/vr/cardboard/UiLayer$2.class...
processing com/google/vr/cardboard/UiLayer$3.class...
processing com/google/vr/cardboard/UiLayer$4.class...
processing com/google/vr/cardboard/UiLayer$5.class...
processing com/google/vr/cardboard/UiLayer$6.class...
processing com/google/vr/cardboard/UiLayer$7.class...
processing com/google/vr/cardboard/UiLayer$8.class...
processing com/google/vr/cardboard/UiLayer$9.class...<message truncated>
  

Комментарии:

1. answers.unity3d.com/questions/672365/… Журнал ошибок очень похож на ваш. Надеюсь, это поможет.

Ответ №1:

 Uncaught translation error: java.lang.IllegalArgumentException: already     added: Lcom/google/protobuf/nano/CodedInputByteBufferNano;
  

В этом проблема. Где-то в вашем проекте у вас есть дубликат библиотеки Android. Unity пытается преобразовать все классы в формат dex, но он получает дубликаты, и ему это не нравится.

Все, что вам нужно сделать, это найти библиотеку-нарушитель и удалить одну из копий. Не имеет значения, какой именно.

Скорее всего, библиотека будет .jar-файлом.