我正在尝试在Unity 2019.4.0上构建,但失败并提示
Cannot fit requested classes in a single dex file (# methods: 68231 > 65536)
解决方法是启用multiDex,我通过以下步骤实现了这一点
Information
external-dependency-manager Version 1.2.156
Jetifier is Enabled
Min API Level 19
Target API Level 28
启用了自定义Gradle模板,并在其中添加了以下内容
Android Manifest Application Tag add the following in the tag
android:name="androidx.multidex.MultiDexApplication"
Enable custom gradle template from Player Settings
then in mainTemplate.gradle add in dependencies
implementation 'com.android.support:multidex:1.0.1'
and in DefaultConfig add
multiDexEnabled true
我按照以上步骤进行了操作,但构建仍然在同样的问题上失败,该问题是:
Cannot fit requested classes in a single dex file (# methods: 68231 > 65536)
需要IT方面的帮助,似乎自定义Gradle文件根本不起作用。 希望能在这里尽快找到解决方案。