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

Posted laozhao1005

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了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.IllegalArgumentException: Argument for @NotNull paramet

在使用单元测试Junit @Test时,出现错误Caused by: java.lang.UnsupportedClassVersionError

Caused by: java.lang.NoClassDefFoundError: javax/el/ELManager

android 自定义View Caused by: java.lang.ClassNotFoundException: Didn't find class

androidStudio中编译出现AIDL找不到接口类

新版3.6.1 Android Studio 解决AndroidStudio编译出现available for offline mode的问题