Unity3D-Android导出APK出现“Unable to convert classes into dex format.”
2017-12-27 14:55
465 查看
今天在更新android版本的时候,导出又出现这个问题了,上次是因为有重复的,但是这次没有重复,看提示是什么东西超过限制
在网上查了一大堆,最后也没解决。
导出时log如下:
CommandInvokationFailure: Unable to convert classes into dex format.
/Library/Java/JavaVirtualMachines/jdk1.8.0_144.jdk/Contents/Home/bin/java -Xmx2048M -Dcom.android.sdkmanager.toolsdir="/Users/guojicheng/Documents/Android/sdk/tools" -Dfile.encoding=UTF8 -jar "/Applications/Unity/PlaybackEngines/AndroidPlayer/Tools/sdktools.jar"
-
stderr[
trouble writing output: Too many field references to fit in one dex file: 100424; max is 65536.
You may try using multi-dex. If multi-dex is enabled then the list of classes for the main dex list is too large.
References by package:
2 android.accounts
29 android.app
1 android.content
43 android.content.pm
10 android.content.res
3 android.database
47 android.graphics
1 android.hardware
1 android.location
后面还有很多,一大堆,这也看不出什么问题。
在Unity之前的版本是可以通过在 AndroidManifest 中增加
android:name="android.support.multidex.MultiDexApplication"
然后在 mainTemplate 文件增加
compile 'com.android.support:multidex:1.0.1'
multiDexEnabled true
但是按照官方文档的改也没有解决,我使用的Unity5.6.4f1,在是在没办法之后,
看到Unity论坛里面有人说了这个事,而且是在14年就有这个问题
那么就像现在这个版本是不是已经默认加了这些参数呢?
然后在Unity的Build Settings里面找到方法了,只需要将 Build System 改为 Gralde 就可以了!
![](https://oscdn.geek-share.com/Uploads/Images/Content/201908/27/012b63186748fe73b3bf8c4990d497fe)
如上图所示,改成改系统之后,可以到处APK了,试了下在真机上跑,也没问题,在此记录下~哈哈
在网上查了一大堆,最后也没解决。
导出时log如下:
CommandInvokationFailure: Unable to convert classes into dex format.
/Library/Java/JavaVirtualMachines/jdk1.8.0_144.jdk/Contents/Home/bin/java -Xmx2048M -Dcom.android.sdkmanager.toolsdir="/Users/guojicheng/Documents/Android/sdk/tools" -Dfile.encoding=UTF8 -jar "/Applications/Unity/PlaybackEngines/AndroidPlayer/Tools/sdktools.jar"
-
stderr[
trouble writing output: Too many field references to fit in one dex file: 100424; max is 65536.
You may try using multi-dex. If multi-dex is enabled then the list of classes for the main dex list is too large.
References by package:
2 android.accounts
29 android.app
1 android.content
43 android.content.pm
10 android.content.res
3 android.database
47 android.graphics
1 android.hardware
1 android.location
后面还有很多,一大堆,这也看不出什么问题。
在Unity之前的版本是可以通过在 AndroidManifest 中增加
android:name="android.support.multidex.MultiDexApplication"
然后在 mainTemplate 文件增加
compile 'com.android.support:multidex:1.0.1'
multiDexEnabled true
但是按照官方文档的改也没有解决,我使用的Unity5.6.4f1,在是在没办法之后,
看到Unity论坛里面有人说了这个事,而且是在14年就有这个问题
那么就像现在这个版本是不是已经默认加了这些参数呢?
然后在Unity的Build Settings里面找到方法了,只需要将 Build System 改为 Gralde 就可以了!
如上图所示,改成改系统之后,可以到处APK了,试了下在真机上跑,也没问题,在此记录下~哈哈
相关文章推荐
- Unity3D-导出APK报错CommandInvokationFailure: Unable to convert classes into dex format.
- Unity Build APK 出现Unable to convert classes into dex format错误
- 【Android】Error building Player: CommandInvokationFailure: Unable to convert classes into dex format.
- [Unity5.3.6与APK]CommandInvokationFailure:Unable to convert classes into dex format错误的解决
- Unity3d 打包时报错 CommandInvokationFailure: Unable to convert classes into dex format. See the Console f
- Unity3d 打包时报错 CommandInvokationFailure: Unable to convert classes into dex format. See the Console for details.
- unity调用安卓打包apk时的错误unable to convert classes into dex format
- Unity打包APK错误:CommandInvokationFailure: Unable to convert classes into dex format.
- CommandInvokationFailure: Unable to convert classes into dex format
- Error building Player: CommandInvokationFailure: Unable to convert classes into dex format. See the
- Unable to convert classes into dex format. See the Console for details
- [Unity 开发]Unable to convert classes into dex format 解决方案之一
- unity sdk 报错CommandInvokationFailure: Unable to convert classes into dex format解决方法
- Error building Player: CommandInvokationFailure: Unable to convert classes into dex format. See the
- CommandInvokationFailure: Unable to convert classes into dex format解决方法
- 关于 Android导出apk时碰到的[Unable to execute dex: Multiple dex files define]
- 关于 Android导出apk时碰到的[Unable to execute dex: Multiple dex files define]
- android 莫名出现Conversion to Dalvik format failed: Unable to execute dex: null 解决方法
- 关于Android导出apk时碰到的[Unable to execute dex: Multiple dex files define]
- 关于 Android导出apk时碰到的[Unable to execute dex: Multiple dex files define]