unity在将unity更新到2020并将jdk改回1.8.0ď271之后,无法构建有错误的android请帮帮我,我绝望了:(

mgdq6dx1  于 2021-06-30  发布在  Java
关注(0)|答案(0)|浏览(578)

这个问题在这里已经有答案了

.dex文件中的方法引用数不能超过64k api 17(16个答案)
error:cannot fit 在单个索引文件中请求类。请尝试提供主索引列表方法:72477>65536(27个答案)
19天前关门了。
我真的不知道是什么触发了这一点,但也许它与我有关:ing更新我的团结从2019年到2020年或b。将jdk从jdk-14.0.1更改为jdk1.8.0ď271(以修复另一个问题)或c。将firebase添加到我的项目或组合中:o但现在每次我尝试将我的项目构建到android时,都会遇到以下例外:

1. Configure project :launcher
WARNING: The option 'android.enableR8' is deprecated and should not be used anymore.
It will be removed in a future version of the Android Gradle plugin, and will no longer allow you to disable R8.
Exception while marshalling C:\Program Files\UnityInstalls\2020.2.0f1\Editor\Data\PlaybackEngines\AndroidPlayer\SDK\build-tools\28.0.3\package.xml. Probably the SDK is read-only
Exception while marshalling C:\Program Files\UnityInstalls\2020.2.0f1\Editor\Data\PlaybackEngines\AndroidPlayer\SDK\platform-tools\package.xml. Probably the SDK is read-only
Exception while marshalling C:\Program Files\UnityInstalls\2020.2.0f1\Editor\Data\PlaybackEngines\AndroidPlayer\SDK\platforms\android-29\package.xml. Probably the SDK is read-only
Exception while marshalling C:\Program Files\UnityInstalls\2020.2.0f1\Editor\Data\PlaybackEngines\AndroidPlayer\SDK\tools\package.xml. Probably the SDK is read-only

2. Picked up JAVA_TOOL_OPTIONS: -Dfile.encoding=UTF-8
D8: Cannot fit requested classes in a single dex file (# methods: 82097 > 65536)
com.android.builder.dexing.DexArchiveMergerException: Error while merging dex archives: 
The number of method references in a .dex file cannot exceed 64K.*

3. CommandInvokationFailure: Gradle build failed. 
C:\Program Files\Java\jdk1.8.0_271\bin\java.exe -classpath "C:\Program Files\UnityInstalls\2020.2.0f1\Editor\Data\PlaybackEngines\AndroidPlayer\Tools\gradle\lib\gradle-launcher-5.6.4.jar" org.gradle.launcher.GradleMain "-Dorg.gradle.jvmargs=-Xmx4096m" "assembleRelease"
stderr[
Picked up JAVA_TOOL_OPTIONS: -Dfile.encoding=UTF-8
D8: Cannot fit requested classes in a single dex file (# methods: 82097 > 65536)
com.android.builder.dexing.DexArchiveMergerException: Error while merging dex archives: 
The number of method references in a .dex file cannot exceed 64K.*

暂无答案!

目前还没有任何答案,快来回答吧!

相关问题