AndroidStudio编译出现Caused by: java.lang.ArrayIndexOutOfBoundsException: 4其中一种的原因

博观而约取,厚积而薄发。这篇文章主要讲述AndroidStudio编译出现Caused by: java.lang.ArrayIndexOutOfBoundsException: 4其中一种的原因相关的知识,希望能为你提供帮助。

Caused by: java.lang.ArrayIndexOutOfBoundsException: 4 at com.android.tools.profiler.asm.ClassReader.a(Unknown Source) at com.android.tools.profiler.asm.ClassReader.a(Unknown Source) at com.android.tools.profiler.asm.ClassReader.a(Unknown Source) at com.android.tools.profiler.asm.ClassReader.b(Unknown Source) at com.android.tools.profiler.asm.ClassReader.accept(Unknown Source) at com.android.tools.profiler.asm.ClassReader.accept(Unknown Source)

编译出现上述问题,不妨往错误日志的上文继续跟踪。
 
我发现如下错误日志:
* What went wrong: Execution failed for task \':XXX:transformClassesWithProfilers-transformForZhaoDebug\'. > 4* Try: Run with --debug option to get more log output.* Exception is: org.gradle.api.tasks.TaskExecutionException: Execution failed for task \':XXX:transformClassesWithProfilers-transformForZhaoDebug\'. at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeActions(ExecuteActionsTaskExecuter.java:100) at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.execute(ExecuteActionsTaskExecuter.java:70) at org.gradle.api.internal.tasks.execution.SkipUpToDateTaskExecuter.execute(SkipUpToDateTaskExecuter.java:63) at org.gradle.api.internal.tasks.execution.ResolveTaskOutputCachingStateExecuter.execute(ResolveTaskOutputCachingStateExecuter.java:54) at org.gradle.api.internal.tasks.execution.ValidatingTaskExecuter.execute(ValidatingTaskExecuter.java:58)

如此可以发现是某个with profilers的配置错误造成的。
解决:
在AndroidStudio中Run/Debug Configurations取消勾选如下:
AndroidStudio编译出现Caused by: java.lang.ArrayIndexOutOfBoundsException: 4其中一种的原因

文章图片

【AndroidStudio编译出现Caused by: java.lang.ArrayIndexOutOfBoundsException: 4其中一种的原因】 

    推荐阅读