构建播放器时出错:CommandInvokationFailure:无法将 类 转换为 dex 格式
Error building Player: CommandInvokationFailure: Unable to convert classes into dex format
请帮我解决这个问题。这是我在控制台中得到的:
Error building Player: CommandInvokationFailure: Unable to convert classes into dex format. See the Console for details.
C:\Program Files\Java\jdk1.8.0_25\bin\java.exe -Xmx1024M -Dcom.android.sdkmanager.toolsdir="D:/Android SDK/sdk\tools" -Dfile.encoding=UTF8 -jar "D:/Unity3D/Data/BuildTargetTools/AndroidPlayer\sdktools.jar" -
stderr[
UNEXPECTED TOP-LEVEL EXCEPTION:
java.lang.IllegalArgumentException: already added: Lcom/google/android/gms/internal/qn;
at com.android.dx.dex.file.ClassDefsSection.add(ClassDefsSection.java:122)
at com.android.dx.dex.file.DexFile.add(DexFile.java:161)
at com.android.dx.command.dexer.Main.processClass(Main.java:732)
at com.android.dx.command.dexer.Main.processFileBytes(Main.java:673)
at com.android.dx.command.dexer.Main.access0(Main.java:83)
at com.android.dx.command.dexer.Main.processFileBytes(Main.java:602)
at com.android.dx.cf.direct.ClassPathOpener.processArchive(ClassPathOpener.java:284)
at com.android.dx.cf.direct.ClassPathOpener.processOne(ClassPathOpener.java:166)
at com.android.dx.cf.direct.ClassPathOpener.processDirectory(ClassPathOpener.java:229)
at com.android.dx.cf.direct.ClassPathOpener.processOne(ClassPathOpener.java:158)
at com.android.dx.cf.direct.ClassPathOpener.process(ClassPathOpener.java:144)
at com.android.dx.command.dexer.Main.processOne(Main.java:632)
at com.android.dx.command.dexer.Main.processAllFiles(Main.java:510)
at com.android.dx.command.dexer.Main.runMonoDex(Main.java:280)
at com.android.dx.command.dexer.Main.run(Main.java:246)
at com.android.dx.command.dexer.Main.main(Main.java:215)
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:483)
at SDKMain.main(SDKMain.java:130)
1 error; aborting
]
stdout[
processing archive bin\classes.jar...
processing com/unity3d/player/a.class...
processing
还有一百万个处理程序……它占用了 320k 行,所以我无法将其粘贴到这里。
这通常发生在插件上。在项目的资源管理器中搜索任何重复的 jar。删除任何重复项。如果它不能解决您的问题,请尝试删除项目的 "Plugins" 文件夹,然后重新导入所有插件。希望能解决。
我通过简单地更改 java 路径从 Open Unity 转到 Edit --> Preferences --> External Tools in JDK 解决了这个问题。 (这个 jdk 文件夹实际上是 运行 在系统上)。
请帮我解决这个问题。这是我在控制台中得到的:
Error building Player: CommandInvokationFailure: Unable to convert classes into dex format. See the Console for details.
C:\Program Files\Java\jdk1.8.0_25\bin\java.exe -Xmx1024M -Dcom.android.sdkmanager.toolsdir="D:/Android SDK/sdk\tools" -Dfile.encoding=UTF8 -jar "D:/Unity3D/Data/BuildTargetTools/AndroidPlayer\sdktools.jar" -
stderr[
UNEXPECTED TOP-LEVEL EXCEPTION:
java.lang.IllegalArgumentException: already added: Lcom/google/android/gms/internal/qn;
at com.android.dx.dex.file.ClassDefsSection.add(ClassDefsSection.java:122)
at com.android.dx.dex.file.DexFile.add(DexFile.java:161)
at com.android.dx.command.dexer.Main.processClass(Main.java:732)
at com.android.dx.command.dexer.Main.processFileBytes(Main.java:673)
at com.android.dx.command.dexer.Main.access0(Main.java:83)
at com.android.dx.command.dexer.Main.processFileBytes(Main.java:602)
at com.android.dx.cf.direct.ClassPathOpener.processArchive(ClassPathOpener.java:284)
at com.android.dx.cf.direct.ClassPathOpener.processOne(ClassPathOpener.java:166)
at com.android.dx.cf.direct.ClassPathOpener.processDirectory(ClassPathOpener.java:229)
at com.android.dx.cf.direct.ClassPathOpener.processOne(ClassPathOpener.java:158)
at com.android.dx.cf.direct.ClassPathOpener.process(ClassPathOpener.java:144)
at com.android.dx.command.dexer.Main.processOne(Main.java:632)
at com.android.dx.command.dexer.Main.processAllFiles(Main.java:510)
at com.android.dx.command.dexer.Main.runMonoDex(Main.java:280)
at com.android.dx.command.dexer.Main.run(Main.java:246)
at com.android.dx.command.dexer.Main.main(Main.java:215)
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:483)
at SDKMain.main(SDKMain.java:130)
1 error; aborting
]
stdout[
processing archive bin\classes.jar...
processing com/unity3d/player/a.class...
processing
还有一百万个处理程序……它占用了 320k 行,所以我无法将其粘贴到这里。
这通常发生在插件上。在项目的资源管理器中搜索任何重复的 jar。删除任何重复项。如果它不能解决您的问题,请尝试删除项目的 "Plugins" 文件夹,然后重新导入所有插件。希望能解决。
我通过简单地更改 java 路径从 Open Unity 转到 Edit --> Preferences --> External Tools in JDK 解决了这个问题。 (这个 jdk 文件夹实际上是 运行 在系统上)。