记录一个app打包报错:
报错内容:
> Task :app:mergeExtDexDebug FAILED
java.lang.ArrayIndexOutOfBoundsException
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':app:mergeExtDexDebug'.
> A failure occurred while executing com.android.build.gradle.internal.tasks.Workers$ActionFacade
> java.lang.ArrayIndexOutOfBoundsException
解决方法:
在build.gradle文件里面加入:
android {
......
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
}
结果:
打包成功!

本文记录了一次App打包过程中遇到的ArrayIndexOutOfBoundsException错误及解决过程。错误发生在mergeExtDexDebug任务执行阶段,通过调整build.gradle文件中的Java兼容性设置解决了问题。

3617

被折叠的 条评论
为什么被折叠?



