Unity在安卓Build时报错解决:CommandInvokationFailure和编译器 (1.8.0-adoptopenjdk) 中出现异常错误

本文主要是介绍Unity在安卓Build时报错解决:CommandInvokationFailure和编译器 (1.8.0-adoptopenjdk) 中出现异常错误,希望对大家解决编程问题提供一定的参考价值,需要的开发者们随着小编来一起学习吧!

Unity在安卓Build时报错解决:CommandInvokationFailure和编译器(1.8.0-adoptopenjdk)中出现异常错误

    • 错误描述
    • 解决方案

错误描述

这个我是发现一系列的错误都在于这个Build问题,这里都列举一下:

  1. CommandInvokationFailure: Unable to install APK to device. Please make sure the Android SDK is installed and is properly configured in the Editor. See the Console for more details.
    C:/Users/20180321/AppData/Local/Android/android-sdk\platform-tools\adb.exe -s “PA7310PGB8151137G” install -r “C:\Users\20180321\Desktop\pico01\39.apk”

    • > 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.

    • 编译器 (1.8.0-adoptopenjdk) 中出现异常错误。如果在 Bug Database (http://bugs.java.com) 中没有找到该错误, 请通过 Java Bug 报告页 (http://bugreport.java.com) 建立该 Java 编译器 Bug。请在报告中附上您的程序和以下诊断信息。谢谢。
      java.lang.AssertionError: annotationType(): unrecognized Attribute name MODULE (class com.sun.tools.javac.util.UnsharedNameTable N a m e I m p l ) a t c o m . s u n . t o o l s . j a v a c . u t i l . A s s e r t . e r r o r ( A s s e r t . j a v a : 133 ) a t c o m . s u n . t o o l s . j a v a c . c o d e . T y p e A n n o t a t i o n s . a n n o t a t i o n T y p e ( T y p e A n n o t a t i o n s . j a v a : 231 ) a t c o m . s u n . t o o l s . j a v a c . c o d e . T y p e A n n o t a t i o n s NameImpl) at com.sun.tools.javac.util.Assert.error(Assert.java:133) at com.sun.tools.javac.code.TypeAnnotations.annotationType(TypeAnnotations.java:231) at com.sun.tools.javac.code.TypeAnnotations NameImpl)atcom.sun.tools.javac.util.Assert.error(Assert.java:133)atcom.sun.tools.javac.code.TypeAnnotations.annotationType(TypeAnnotations.java:231)atcom.sun.tools.javac.code.TypeAnnotationsTypeAnnotationPositions.separateAnnotationsKinds(TypeAnnotations.java:294)
      at com.sun.tools.javac.code.TypeAnnotations T y p e A n n o t a t i o n P o s i t i o n s . v i s i t V a r D e f ( T y p e A n n o t a t i o n s . j a v a : 1164 ) a t c o m . s u n . t o o l s . j a v a c . t r e e . J C T r e e TypeAnnotationPositions.visitVarDef(TypeAnnotations.java:1164) at com.sun.tools.javac.tree.JCTree TypeAnnotationPositions.visitVarDef(TypeAnnotations.java:1164)atcom.sun.tools.javac.tree.JCTreeJCVariableDecl.accept(JCTree.java:852)
      at com.sun.tools.javac.tree.TreeScanner.scan(TreeScanner.java:49)
      at com.sun.tools.javac.code.TypeAnnotations T y p e A n n o t a t i o n P o s i t i o n s . s c a n ( T y p e A n n o t a t i o n s . j a v a : 275 ) a t c o m . s u n . t o o l s . j a v a c . t r e e . T r e e S c a n n e r . s c a n ( T r e e S c a n n e r . j a v a : 57 ) a t c o m . s u n . t o o l s . j a v a c . c o d e . T y p e A n n o t a t i o n s TypeAnnotationPositions.scan(TypeAnnotations.java:275) at com.sun.tools.javac.tree.TreeScanner.scan(TreeScanner.java:57) at com.sun.tools.javac.code.TypeAnnotations TypeAnnotationPositions.scan(TypeAnnotations.java:275)atcom.sun.tools.javac.tree.TreeScanner.scan(TreeScanner.java:57)atcom.sun.tools.javac.code.TypeAnnotationsTypeAnnotationPositions.visitClassDef(TypeAnnotations.java:1042)
      at com.sun.tools.javac.tree.JCTree J C C l a s s D e c l . a c c e p t ( J C T r e e . j a v a : 693 ) a t c o m . s u n . t o o l s . j a v a c . t r e e . T r e e S c a n n e r . s c a n ( T r e e S c a n n e r . j a v a : 49 ) a t c o m . s u n . t o o l s . j a v a c . c o d e . T y p e A n n o t a t i o n s JCClassDecl.accept(JCTree.java:693) at com.sun.tools.javac.tree.TreeScanner.scan(TreeScanner.java:49) at com.sun.tools.javac.code.TypeAnnotations JCClassDecl.accept(JCTree.java:693)atcom.sun.tools.javac.tree.TreeScanner.scan(TreeScanner.java:49)atcom.sun.tools.javac.code.TypeAnnotationsTypeAnnotationPositions.scan(TypeAnnotations.java:275)
      at com.sun.tools.javac.code.TypeAnnotations$1.run(TypeAnnotations.java:127)
      at com.sun.tools.javac.comp.Annotate.flush(Annotate.java:152)
      at com.sun.tools.javac.comp.Annotate.enterDone(Annotate.java:129)
      at com.sun.tools.javac.comp.Enter.complete(Enter.java:512)
      at com.sun.tools.javac.comp.Enter.main(Enter.java:471)
      at com.sun.tools.javac.main.JavaCompiler.enterTrees(JavaCompiler.java:982)
      at com.sun.tools.javac.main.JavaCompiler.compile(JavaCompiler.java:857)
      at com.sun.tools.javac.main.Main.compile(Main.java:523)
      at com.sun.tools.javac.api.JavacTaskImpl.doCall(JavacTaskImpl.java:129)
      at com.sun.tools.javac.api.JavacTaskImpl.call(JavacTaskImpl.java:138)
      at org.gradle.api.internal.tasks.compile.AnnotationProcessingCompileTask.call(AnnotationProcessingCompileTask.java:93)
      at org.gradle.api.internal.tasks.compile.ResourceCleaningCompilationTask.call(ResourceCleaningCompilationTask.java:57)
      at org.gradle.api.internal.tasks.compile.JdkJavaCompiler.execute(JdkJavaCompiler.java:54)
      at org.gradle.api.internal.tasks.compile.JdkJavaCompiler.execute(JdkJavaCompiler.java:39)
      at org.gradle.api.internal.tasks.compile.NormalizingJavaCompiler.delegateAndHandleErrors(NormalizingJavaCompiler.java:100)
      at org.gradle.api.internal.tasks.compile.NormalizingJavaCompiler.execute(NormalizingJavaCompiler.java:52)
      at org.gradle.api.internal.tasks.compile.NormalizingJavaCompiler.execute(NormalizingJavaCompiler.java:38)
      at org.gradle.api.internal.tasks.compile.AnnotationProcessorDiscoveringCompiler.execute(AnnotationProcessorDiscoveringCompiler.java:51)
      at org.gradle.api.internal.tasks.compile.AnnotationProcessorDiscoveringCompiler.execute(AnnotationProcessorDiscoveringCompiler.java:37)
      at org.gradle.api.internal.tasks.compile.CleaningJavaCompilerSupport.execute(CleaningJavaCompilerSupport.java:39)
      at org.gradle.api.internal.tasks.compile.incremental.IncrementalCompilerFactory$2.execute(IncrementalCompilerFactory.java:101)
      at org.gradle.api.internal.tasks.compile.incremental.IncrementalCompilerFactory$2.execute(IncrementalCompilerFactory.java:97)
      at org.gradle.api.internal.tasks.compile.incremental.IncrementalResultStoringCompiler.execute(IncrementalResultStoringCompiler.java:60)
      at org.gradle.api.internal.tasks.compile.incremental.IncrementalResultStoringCompiler.execute(IncrementalResultStoringCompiler.java:44)
      at org.gradle.api.internal.tasks.compile.CompileJavaBuildOperationReportingCompiler$2.call(CompileJavaBuildOperationReportingCompiler.java:59)
      at org.gradle.api.internal.tasks.compile.CompileJavaBuildOperationReportingCompiler 2. c a l l ( C o m p i l e J a v a B u i l d O p e r a t i o n R e p o r t i n g C o m p i l e r . j a v a : 51 ) a t o r g . g r a d l e . i n t e r n a l . o p e r a t i o n s . D e f a u l t B u i l d O p e r a t i o n E x e c u t o r 2.call(CompileJavaBuildOperationReportingCompiler.java:51) at org.gradle.internal.operations.DefaultBuildOperationExecutor 2.call(CompileJavaBuildOperationReportingCompiler.java:51)atorg.gradle.internal.operations.DefaultBuildOperationExecutorCallableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:416)
      at org.gradle.internal.operations.DefaultBuildOperationExecutor$CallableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:406)
      at org.gradle.internal.operations.DefaultBuildOperationExecutor$1.execute(DefaultBuildOperationExecutor.java:165)
      at org.gradle.internal.operations.DefaultBuildOperationExecutor.execute(DefaultBuildOperationExecutor.java:250)
      at org.gradle.internal.operations.DefaultBuildOperationExecutor.execute(DefaultBuildOperationExecutor.java:158)
      at org.gradle.internal.operations.DefaultBuildOperationExecutor.call(DefaultBuildOperationExecutor.java:102)
      at org.gradle.internal.operations.DelegatingBuildOperationExecutor.call(DelegatingBuildOperationExecutor.java:36)
      at org.gradle.api.internal.tasks.compile.CompileJavaBuildOperationReportingCompiler.execute(CompileJavaBuildOperationReportingCompiler.java:51)
      at org.gradle.api.tasks.compile.JavaCompile.performCompilation(JavaCompile.java:158)
      at org.gradle.api.tasks.compile.JavaCompile.compile(JavaCompile.java:126)
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
      at java.lang.reflect.Method.invoke(Method.java:498)
      at org.gradle.internal.reflect.JavaMethod.invoke(JavaMethod.java:103)
      at org.gradle.api.internal.project.taskfactory.IncrementalTaskInputsTaskAction.doExecute(IncrementalTaskInputsTaskAction.java:47)
      at org.gradle.api.internal.project.taskfactory.StandardTaskAction.execute(StandardTaskAction.java:42)
      at org.gradle.api.internal.project.taskfactory.AbstractIncrementalTaskAction.execute(AbstractIncrementalTaskAction.java:25)
      at org.gradle.api.internal.project.taskfactory.StandardTaskAction.execute(StandardTaskAction.java:28)
      at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter 5. r u n ( E x e c u t e A c t i o n s T a s k E x e c u t e r . j a v a : 476 ) a t o r g . g r a d l e . i n t e r n a l . o p e r a t i o n s . D e f a u l t B u i l d O p e r a t i o n E x e c u t o r 5.run(ExecuteActionsTaskExecuter.java:476) at org.gradle.internal.operations.DefaultBuildOperationExecutor 5.run(ExecuteActionsTaskExecuter.java:476)atorg.gradle.internal.operations.DefaultBuildOperationExecutorRunnableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:402)
      at org.gradle.internal.operations.DefaultBuildOperationExecutor$RunnableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:394)
      at org.gradle.internal.operations.DefaultBuildOperationExecutor$1.execute(DefaultBuildOperationExecutor.java:165)
      at org.gradle.internal.operations.DefaultBuildOperationExecutor.execute(DefaultBuildOperationExecutor.java:250)
      at org.gradle.internal.operations.DefaultBuildOperationExecutor.execute(DefaultBuildOperationExecutor.java:158)
      at org.gradle.internal.operations.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:92)
      at org.gradle.internal.operations.DelegatingBuildOperationExecutor.run(DelegatingBuildOperationExecutor.java:31)
      at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeAction(ExecuteActionsTaskExecuter.java:461)
      at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeActions(ExecuteActionsTaskExecuter.java:444)
      at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.access 200 ( E x e c u t e A c t i o n s T a s k E x e c u t e r . j a v a : 93 ) a t o r g . g r a d l e . a p i . i n t e r n a l . t a s k s . e x e c u t i o n . E x e c u t e A c t i o n s T a s k E x e c u t e r 200(ExecuteActionsTaskExecuter.java:93) at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter 200(ExecuteActionsTaskExecuter.java:93)atorg.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuterTaskExecution.execute(ExecuteActionsTaskExecuter.java:237)
      at org.gradle.internal.execution.steps.ExecuteStep.lambda$execute 0 ( E x e c u t e S t e p . j a v a : 32 ) a t j a v a . u t i l . O p t i o n a l . m a p ( O p t i o n a l . j a v a : 215 ) a t o r g . g r a d l e . i n t e r n a l . e x e c u t i o n . s t e p s . E x e c u t e S t e p . e x e c u t e ( E x e c u t e S t e p . j a v a : 32 ) a t o r g . g r a d l e . i n t e r n a l . e x e c u t i o n . s t e p s . E x e c u t e S t e p . e x e c u t e ( E x e c u t e S t e p . j a v a : 26 ) a t o r g . g r a d l e . i n t e r n a l . e x e c u t i o n . s t e p s . C l e a n u p O u t p u t s S t e p . e x e c u t e ( C l e a n u p O u t p u t s S t e p . j a v a : 58 ) a t o r g . g r a d l e . i n t e r n a l . e x e c u t i o n . s t e p s . C l e a n u p O u t p u t s S t e p . e x e c u t e ( C l e a n u p O u t p u t s S t e p . j a v a : 35 ) a t o r g . g r a d l e . i n t e r n a l . e x e c u t i o n . s t e p s . R e s o l v e I n p u t C h a n g e s S t e p . e x e c u t e ( R e s o l v e I n p u t C h a n g e s S t e p . j a v a : 48 ) a t o r g . g r a d l e . i n t e r n a l . e x e c u t i o n . s t e p s . R e s o l v e I n p u t C h a n g e s S t e p . e x e c u t e ( R e s o l v e I n p u t C h a n g e s S t e p . j a v a : 33 ) a t o r g . g r a d l e . i n t e r n a l . e x e c u t i o n . s t e p s . C a n c e l E x e c u t i o n S t e p . e x e c u t e ( C a n c e l E x e c u t i o n S t e p . j a v a : 39 ) a t o r g . g r a d l e . i n t e r n a l . e x e c u t i o n . s t e p s . T i m e o u t S t e p . e x e c u t e W i t h o u t T i m e o u t ( T i m e o u t S t e p . j a v a : 73 ) a t o r g . g r a d l e . i n t e r n a l . e x e c u t i o n . s t e p s . T i m e o u t S t e p . e x e c u t e ( T i m e o u t S t e p . j a v a : 54 ) a t o r g . g r a d l e . i n t e r n a l . e x e c u t i o n . s t e p s . C a t c h E x c e p t i o n S t e p . e x e c u t e ( C a t c h E x c e p t i o n S t e p . j a v a : 35 ) a t o r g . g r a d l e . i n t e r n a l . e x e c u t i o n . s t e p s . C r e a t e O u t p u t s S t e p . e x e c u t e ( C r e a t e O u t p u t s S t e p . j a v a : 51 ) a t o r g . g r a d l e . i n t e r n a l . e x e c u t i o n . s t e p s . S n a p s h o t O u t p u t s S t e p . e x e c u t e ( S n a p s h o t O u t p u t s S t e p . j a v a : 45 ) a t o r g . g r a d l e . i n t e r n a l . e x e c u t i o n . s t e p s . S n a p s h o t O u t p u t s S t e p . e x e c u t e ( S n a p s h o t O u t p u t s S t e p . j a v a : 31 ) a t o r g . g r a d l e . i n t e r n a l . e x e c u t i o n . s t e p s . C a c h e S t e p . e x e c u t e W i t h o u t C a c h e ( C a c h e S t e p . j a v a : 208 ) a t o r g . g r a d l e . i n t e r n a l . e x e c u t i o n . s t e p s . C a c h e S t e p . e x e c u t e ( C a c h e S t e p . j a v a : 70 ) a t o r g . g r a d l e . i n t e r n a l . e x e c u t i o n . s t e p s . C a c h e S t e p . e x e c u t e ( C a c h e S t e p . j a v a : 45 ) a t o r g . g r a d l e . i n t e r n a l . e x e c u t i o n . s t e p s . B r o a d c a s t C h a n g i n g O u t p u t s S t e p . e x e c u t e ( B r o a d c a s t C h a n g i n g O u t p u t s S t e p . j a v a : 49 ) a t o r g . g r a d l e . i n t e r n a l . e x e c u t i o n . s t e p s . S t o r e S n a p s h o t s S t e p . e x e c u t e ( S t o r e S n a p s h o t s S t e p . j a v a : 43 ) a t o r g . g r a d l e . i n t e r n a l . e x e c u t i o n . s t e p s . S t o r e S n a p s h o t s S t e p . e x e c u t e ( S t o r e S n a p s h o t s S t e p . j a v a : 32 ) a t o r g . g r a d l e . i n t e r n a l . e x e c u t i o n . s t e p s . R e c o r d O u t p u t s S t e p . e x e c u t e ( R e c o r d O u t p u t s S t e p . j a v a : 38 ) a t o r g . g r a d l e . i n t e r n a l . e x e c u t i o n . s t e p s . R e c o r d O u t p u t s S t e p . e x e c u t e ( R e c o r d O u t p u t s S t e p . j a v a : 24 ) a t o r g . g r a d l e . i n t e r n a l . e x e c u t i o n . s t e p s . S k i p U p T o D a t e S t e p . e x e c u t e B e c a u s e ( S k i p U p T o D a t e S t e p . j a v a : 96 ) a t o r g . g r a d l e . i n t e r n a l . e x e c u t i o n . s t e p s . S k i p U p T o D a t e S t e p . l a m b d a 0(ExecuteStep.java:32) at java.util.Optional.map(Optional.java:215) at org.gradle.internal.execution.steps.ExecuteStep.execute(ExecuteStep.java:32) at org.gradle.internal.execution.steps.ExecuteStep.execute(ExecuteStep.java:26) at org.gradle.internal.execution.steps.CleanupOutputsStep.execute(CleanupOutputsStep.java:58) at org.gradle.internal.execution.steps.CleanupOutputsStep.execute(CleanupOutputsStep.java:35) at org.gradle.internal.execution.steps.ResolveInputChangesStep.execute(ResolveInputChangesStep.java:48) at org.gradle.internal.execution.steps.ResolveInputChangesStep.execute(ResolveInputChangesStep.java:33) at org.gradle.internal.execution.steps.CancelExecutionStep.execute(CancelExecutionStep.java:39) at org.gradle.internal.execution.steps.TimeoutStep.executeWithoutTimeout(TimeoutStep.java:73) at org.gradle.internal.execution.steps.TimeoutStep.execute(TimeoutStep.java:54) at org.gradle.internal.execution.steps.CatchExceptionStep.execute(CatchExceptionStep.java:35) at org.gradle.internal.execution.steps.CreateOutputsStep.execute(CreateOutputsStep.java:51) at org.gradle.internal.execution.steps.SnapshotOutputsStep.execute(SnapshotOutputsStep.java:45) at org.gradle.internal.execution.steps.SnapshotOutputsStep.execute(SnapshotOutputsStep.java:31) at org.gradle.internal.execution.steps.CacheStep.executeWithoutCache(CacheStep.java:208) at org.gradle.internal.execution.steps.CacheStep.execute(CacheStep.java:70) at org.gradle.internal.execution.steps.CacheStep.execute(CacheStep.java:45) at org.gradle.internal.execution.steps.BroadcastChangingOutputsStep.execute(BroadcastChangingOutputsStep.java:49) at org.gradle.internal.execution.steps.StoreSnapshotsStep.execute(StoreSnapshotsStep.java:43) at org.gradle.internal.execution.steps.StoreSnapshotsStep.execute(StoreSnapshotsStep.java:32) at org.gradle.internal.execution.steps.RecordOutputsStep.execute(RecordOutputsStep.java:38) at org.gradle.internal.execution.steps.RecordOutputsStep.execute(RecordOutputsStep.java:24) at org.gradle.internal.execution.steps.SkipUpToDateStep.executeBecause(SkipUpToDateStep.java:96) at org.gradle.internal.execution.steps.SkipUpToDateStep.lambda 0(ExecuteStep.java:32)atjava.util.Optional.map(Optional.java:215)atorg.gradle.internal.execution.steps.ExecuteStep.execute(ExecuteStep.java:32)atorg.gradle.internal.execution.steps.ExecuteStep.execute(ExecuteStep.java:26)atorg.gradle.internal.execution.steps.CleanupOutputsStep.execute(CleanupOutputsStep.java:58)atorg.gradle.internal.execution.steps.CleanupOutputsStep.execute(CleanupOutputsStep.java:35)atorg.gradle.internal.execution.steps.ResolveInputChangesStep.execute(ResolveInputChangesStep.java:48)atorg.gradle.internal.execution.steps.ResolveInputChangesStep.execute(ResolveInputChangesStep.java:33)atorg.gradle.internal.execution.steps.CancelExecutionStep.execute(CancelExecutionStep.java:39)atorg.gradle.internal.execution.steps.TimeoutStep.executeWithoutTimeout(TimeoutStep.java:73)atorg.gradle.internal.execution.steps.TimeoutStep.execute(TimeoutStep.java:54)atorg.gradle.internal.execution.steps.CatchExceptionStep.execute(CatchExceptionStep.java:35)atorg.gradle.internal.execution.steps.CreateOutputsStep.execute(CreateOutputsStep.java:51)atorg.gradle.internal.execution.steps.SnapshotOutputsStep.execute(SnapshotOutputsStep.java:45)atorg.gradle.internal.execution.steps.SnapshotOutputsStep.execute(SnapshotOutputsStep.java:31)atorg.gradle.internal.execution.steps.CacheStep.executeWithoutCache(CacheStep.java:208)atorg.gradle.internal.execution.steps.CacheStep.execute(CacheStep.java:70)atorg.gradle.internal.execution.steps.CacheStep.execute(CacheStep.java:45)atorg.gradle.internal.execution.steps.BroadcastChangingOutputsStep.execute(BroadcastChangingOutputsStep.java:49)atorg.gradle.internal.execution.steps.StoreSnapshotsStep.execute(StoreSnapshotsStep.java:43)atorg.gradle.internal.execution.steps.StoreSnapshotsStep.execute(StoreSnapshotsStep.java:32)atorg.gradle.internal.execution.steps.RecordOutputsStep.execute(RecordOutputsStep.java:38)atorg.gradle.internal.execution.steps.RecordOutputsStep.execute(RecordOutputsStep.java:24)atorg.gradle.internal.execution.steps.SkipUpToDateStep.executeBecause(SkipUpToDateStep.java:96)atorg.gradle.internal.execution.steps.SkipUpToDateStep.lambdaexecute$0(SkipUpToDateStep.java:89)
      at java.util.Optional.map(Optional.java:215)
      at org.gradle.internal.execution.steps.SkipUpToDateStep.execute(SkipUpToDateStep.java:54)
      at org.gradle.internal.execution.steps.SkipUpToDateStep.execute(SkipUpToDateStep.java:38)
      at org.gradle.internal.execution.steps.ResolveChangesStep.execute(ResolveChangesStep.java:76)
      at org.gradle.internal.execution.steps.ResolveChangesStep.execute(ResolveChangesStep.java:37)
      at org.gradle.internal.execution.steps.legacy.MarkSnapshottingInputsFinishedStep.execute(MarkSnapshottingInputsFinishedStep.java:36)
      at org.gradle.internal.execution.steps.legacy.MarkSnapshottingInputsFinishedStep.execute(MarkSnapshottingInputsFinishedStep.java:26)
      at org.gradle.internal.execution.steps.ResolveCachingStateStep.execute(ResolveCachingStateStep.java:90)
      at org.gradle.internal.execution.steps.ResolveCachingStateStep.execute(ResolveCachingStateStep.java:48)
      at org.gradle.internal.execution.steps.CaptureStateBeforeExecutionStep.execute(CaptureStateBeforeExecutionStep.java:69)
      at org.gradle.internal.execution.steps.CaptureStateBeforeExecutionStep.execute(CaptureStateBeforeExecutionStep.java:47)
      at org.gradle.internal.execution.impl.DefaultWorkExecutor.execute(DefaultWorkExecutor.java:33)
      at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.execute(ExecuteActionsTaskExecuter.java:140)
      at org.gradle.api.internal.tasks.execution.ValidatingTaskExecuter.execute(ValidatingTaskExecuter.java:62)
      at org.gradle.api.internal.tasks.execution.SkipEmptySourceFilesTaskExecuter.execute(SkipEmptySourceFilesTaskExecuter.java:108)
      at org.gradle.api.internal.tasks.execution.ResolveBeforeExecutionOutputsTaskExecuter.execute(ResolveBeforeExecutionOutputsTaskExecuter.java:67)
      at org.gradle.api.internal.tasks.execution.ResolveAfterPreviousExecutionStateTaskExecuter.execute(ResolveAfterPreviousExecutionStateTaskExecuter.java:46)
      at org.gradle.api.internal.tasks.execution.CleanupStaleOutputsExecuter.execute(CleanupStaleOutputsExecuter.java:94)
      at org.gradle.api.internal.tasks.execution.FinalizePropertiesTaskExecuter.execute(FinalizePropertiesTaskExecuter.java:46)
      at org.gradle.api.internal.tasks.execution.ResolveTaskExecutionModeExecuter.execute(ResolveTaskExecutionModeExecuter.java:95)
      at org.gradle.api.internal.tasks.execution.SkipTaskWithNoActionsExecuter.execute(SkipTaskWithNoActionsExecuter.java:57)
      at org.gradle.api.internal.tasks.execution.SkipOnlyIfTaskExecuter.execute(SkipOnlyIfTaskExecuter.java:56)
      at org.gradle.api.internal.tasks.execution.CatchExceptionTaskExecuter.execute(CatchExceptionTaskExecuter.java:36)
      at org.gradle.api.internal.tasks.execution.EventFiringTaskExecuter$1.executeTask(EventFiringTaskExecuter.java:77)
      at org.gradle.api.internal.tasks.execution.EventFiringTaskExecuter$1.call(EventFiringTaskExecuter.java:55)
      at org.gradle.api.internal.tasks.execution.EventFiringTaskExecuter 1. c a l l ( E v e n t F i r i n g T a s k E x e c u t e r . j a v a : 52 ) a t o r g . g r a d l e . i n t e r n a l . o p e r a t i o n s . D e f a u l t B u i l d O p e r a t i o n E x e c u t o r 1.call(EventFiringTaskExecuter.java:52) at org.gradle.internal.operations.DefaultBuildOperationExecutor 1.call(EventFiringTaskExecuter.java:52)atorg.gradle.internal.operations.DefaultBuildOperationExecutorCallableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:416)
      at org.gradle.internal.operations.DefaultBuildOperationExecutor$CallableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:406)
      at org.gradle.internal.operations.DefaultBuildOperationExecutor 1. e x e c u t e ( D e f a u l t B u i l d O p e r a t i o n E x e c u t o r . j a v a : 165 ) a t o r g . g r a d l e . i n t e r n a l . o p e r a t i o n s . D e f a u l t B u i l d O p e r a t i o n E x e c u t o r . e x e c u t e ( D e f a u l t B u i l d O p e r a t i o n E x e c u t o r . j a v a : 250 ) a t o r g . g r a d l e . i n t e r n a l . o p e r a t i o n s . D e f a u l t B u i l d O p e r a t i o n E x e c u t o r . e x e c u t e ( D e f a u l t B u i l d O p e r a t i o n E x e c u t o r . j a v a : 158 ) a t o r g . g r a d l e . i n t e r n a l . o p e r a t i o n s . D e f a u l t B u i l d O p e r a t i o n E x e c u t o r . c a l l ( D e f a u l t B u i l d O p e r a t i o n E x e c u t o r . j a v a : 102 ) a t o r g . g r a d l e . i n t e r n a l . o p e r a t i o n s . D e l e g a t i n g B u i l d O p e r a t i o n E x e c u t o r . c a l l ( D e l e g a t i n g B u i l d O p e r a t i o n E x e c u t o r . j a v a : 36 ) a t o r g . g r a d l e . a p i . i n t e r n a l . t a s k s . e x e c u t i o n . E v e n t F i r i n g T a s k E x e c u t e r . e x e c u t e ( E v e n t F i r i n g T a s k E x e c u t e r . j a v a : 52 ) a t o r g . g r a d l e . e x e c u t i o n . p l a n . L o c a l T a s k N o d e E x e c u t o r . e x e c u t e ( L o c a l T a s k N o d e E x e c u t o r . j a v a : 43 ) a t o r g . g r a d l e . e x e c u t i o n . t a s k g r a p h . D e f a u l t T a s k E x e c u t i o n G r a p h 1.execute(DefaultBuildOperationExecutor.java:165) at org.gradle.internal.operations.DefaultBuildOperationExecutor.execute(DefaultBuildOperationExecutor.java:250) at org.gradle.internal.operations.DefaultBuildOperationExecutor.execute(DefaultBuildOperationExecutor.java:158) at org.gradle.internal.operations.DefaultBuildOperationExecutor.call(DefaultBuildOperationExecutor.java:102) at org.gradle.internal.operations.DelegatingBuildOperationExecutor.call(DelegatingBuildOperationExecutor.java:36) at org.gradle.api.internal.tasks.execution.EventFiringTaskExecuter.execute(EventFiringTaskExecuter.java:52) at org.gradle.execution.plan.LocalTaskNodeExecutor.execute(LocalTaskNodeExecutor.java:43) at org.gradle.execution.taskgraph.DefaultTaskExecutionGraph 1.execute(DefaultBuildOperationExecutor.java:165)atorg.gradle.internal.operations.DefaultBuildOperationExecutor.execute(DefaultBuildOperationExecutor.java:250)atorg.gradle.internal.operations.DefaultBuildOperationExecutor.execute(DefaultBuildOperationExecutor.java:158)atorg.gradle.internal.operations.DefaultBuildOperationExecutor.call(DefaultBuildOperationExecutor.java:102)atorg.gradle.internal.operations.DelegatingBuildOperationExecutor.call(DelegatingBuildOperationExecutor.java:36)atorg.gradle.api.internal.tasks.execution.EventFiringTaskExecuter.execute(EventFiringTaskExecuter.java:52)atorg.gradle.execution.plan.LocalTaskNodeExecutor.execute(LocalTaskNodeExecutor.java:43)atorg.gradle.execution.taskgraph.DefaultTaskExecutionGraphInvokeNodeExecutorsAction.execute(DefaultTaskExecutionGraph.java:355)
      at org.gradle.execution.taskgraph.DefaultTaskExecutionGraph I n v o k e N o d e E x e c u t o r s A c t i o n . e x e c u t e ( D e f a u l t T a s k E x e c u t i o n G r a p h . j a v a : 343 ) a t o r g . g r a d l e . e x e c u t i o n . t a s k g r a p h . D e f a u l t T a s k E x e c u t i o n G r a p h InvokeNodeExecutorsAction.execute(DefaultTaskExecutionGraph.java:343) at org.gradle.execution.taskgraph.DefaultTaskExecutionGraph InvokeNodeExecutorsAction.execute(DefaultTaskExecutionGraph.java:343)atorg.gradle.execution.taskgraph.DefaultTaskExecutionGraphBuildOperationAwareExecutionAction.execute(DefaultTaskExecutionGraph.java:336)
      at org.gradle.execution.taskgraph.DefaultTaskExecutionGraph B u i l d O p e r a t i o n A w a r e E x e c u t i o n A c t i o n . e x e c u t e ( D e f a u l t T a s k E x e c u t i o n G r a p h . j a v a : 322 ) a t o r g . g r a d l e . e x e c u t i o n . p l a n . D e f a u l t P l a n E x e c u t o r BuildOperationAwareExecutionAction.execute(DefaultTaskExecutionGraph.java:322) at org.gradle.execution.plan.DefaultPlanExecutor BuildOperationAwareExecutionAction.execute(DefaultTaskExecutionGraph.java:322)atorg.gradle.execution.plan.DefaultPlanExecutorExecutorWorker 1. e x e c u t e ( D e f a u l t P l a n E x e c u t o r . j a v a : 134 ) a t o r g . g r a d l e . e x e c u t i o n . p l a n . D e f a u l t P l a n E x e c u t o r 1.execute(DefaultPlanExecutor.java:134) at org.gradle.execution.plan.DefaultPlanExecutor 1.execute(DefaultPlanExecutor.java:134)atorg.gradle.execution.plan.DefaultPlanExecutorExecutorWorker 1. e x e c u t e ( D e f a u l t P l a n E x e c u t o r . j a v a : 129 ) a t o r g . g r a d l e . e x e c u t i o n . p l a n . D e f a u l t P l a n E x e c u t o r 1.execute(DefaultPlanExecutor.java:129) at org.gradle.execution.plan.DefaultPlanExecutor 1.execute(DefaultPlanExecutor.java:129)atorg.gradle.execution.plan.DefaultPlanExecutorExecutorWorker.execute(DefaultPlanExecutor.java:202)
      at org.gradle.execution.plan.DefaultPlanExecutor E x e c u t o r W o r k e r . e x e c u t e N e x t N o d e ( D e f a u l t P l a n E x e c u t o r . j a v a : 193 ) a t o r g . g r a d l e . e x e c u t i o n . p l a n . D e f a u l t P l a n E x e c u t o r ExecutorWorker.executeNextNode(DefaultPlanExecutor.java:193) at org.gradle.execution.plan.DefaultPlanExecutor ExecutorWorker.executeNextNode(DefaultPlanExecutor.java:193)atorg.gradle.execution.plan.DefaultPlanExecutorExecutorWorker.run(DefaultPlanExecutor.java:129)
      at org.gradle.internal.concurrent.ExecutorPolicy$CatchAndRecordFailures.onExecute(ExecutorPolicy.java:64)
      at org.gradle.internal.concurrent.ManagedExecutorImpl 1. r u n ( M a n a g e d E x e c u t o r I m p l . j a v a : 48 ) a t j a v a . u t i l . c o n c u r r e n t . T h r e a d P o o l E x e c u t o r . r u n W o r k e r ( T h r e a d P o o l E x e c u t o r . j a v a : 1149 ) a t j a v a . u t i l . c o n c u r r e n t . T h r e a d P o o l E x e c u t o r 1.run(ManagedExecutorImpl.java:48) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) at java.util.concurrent.ThreadPoolExecutor 1.run(ManagedExecutorImpl.java:48)atjava.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)atjava.util.concurrent.ThreadPoolExecutorWorker.run(ThreadPoolExecutor.java:624)
      at org.gradle.internal.concurrent.ThreadFactoryImpl$ManagedThreadRunnable.run(ThreadFactoryImpl.java:56)
      at java.lang.Thread.run(Thread.java:748)
      FAILURE: Build failed with an exception.
      *What went wrong:
      Execution failed for task ‘:unityLibrary:compileDebugJavaWithJavac’.
      >Compilation failed; see the compiler error output for details.
      *Try:
      Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.
      *Get more help at https://help.gradle.org
      BUILD FAILED in 4s
      Picked up JAVA_TOOL_OPTIONS: -Dfile.encoding=UTF-8
      UnityEngine.GUIUtility:ProcessEvent (int,intptr,bool&)

解决方案

在网上查找的解决方案,原文链接如下:https://www.jianshu.com/p/e0f97d6933a5。
里面有3个方案,里面我用的第一个就可以了,其他的没有测,这里转载一下。

  1. 方案一
    把Target API Level设置成30,这样31,32的也能自动适配过去的。
    截图
  2. 方案二
    都是说换JDK,但是我(原文作者)的换了JDK也还是不行,后来是先直接删除掉全部的JDK然后再重装装一次就行了。
    如果还不可以的话,可以试试装一下JDK的11版本的。
  3. 方案三
    还有一种可能是你项目里面接了Firebase插件,你需要在unity里面卸载掉它们再重装就能修复这个问题。
    截图引用
    截图引用
    然后再导入就可以了,我有次是这样解决掉的问题的,希望你的也能得到处理。

这篇关于Unity在安卓Build时报错解决:CommandInvokationFailure和编译器 (1.8.0-adoptopenjdk) 中出现异常错误的文章就介绍到这儿,希望我们推荐的文章对编程师们有所帮助!



http://www.chinasem.cn/article/442161

相关文章

Go标准库常见错误分析和解决办法

《Go标准库常见错误分析和解决办法》Go语言的标准库为开发者提供了丰富且高效的工具,涵盖了从网络编程到文件操作等各个方面,然而,标准库虽好,使用不当却可能适得其反,正所谓工欲善其事,必先利其器,本文将... 目录1. 使用了错误的time.Duration2. time.After导致的内存泄漏3. jsO

Spring事务中@Transactional注解不生效的原因分析与解决

《Spring事务中@Transactional注解不生效的原因分析与解决》在Spring框架中,@Transactional注解是管理数据库事务的核心方式,本文将深入分析事务自调用的底层原理,解释为... 目录1. 引言2. 事务自调用问题重现2.1 示例代码2.2 问题现象3. 为什么事务自调用会失效3

mysql出现ERROR 2003 (HY000): Can‘t connect to MySQL server on ‘localhost‘ (10061)的解决方法

《mysql出现ERROR2003(HY000):Can‘tconnecttoMySQLserveron‘localhost‘(10061)的解决方法》本文主要介绍了mysql出现... 目录前言:第一步:第二步:第三步:总结:前言:当你想通过命令窗口想打开mysql时候发现提http://www.cpp

SpringBoot启动报错的11个高频问题排查与解决终极指南

《SpringBoot启动报错的11个高频问题排查与解决终极指南》这篇文章主要为大家详细介绍了SpringBoot启动报错的11个高频问题的排查与解决,文中的示例代码讲解详细,感兴趣的小伙伴可以了解一... 目录1. 依赖冲突:NoSuchMethodError 的终极解法2. Bean注入失败:No qu

springboot报错Invalid bound statement (not found)的解决

《springboot报错Invalidboundstatement(notfound)的解决》本文主要介绍了springboot报错Invalidboundstatement(not... 目录一. 问题描述二.解决问题三. 添加配置项 四.其他的解决方案4.1 Mapper 接口与 XML 文件不匹配

Python中ModuleNotFoundError: No module named ‘timm’的错误解决

《Python中ModuleNotFoundError:Nomodulenamed‘timm’的错误解决》本文主要介绍了Python中ModuleNotFoundError:Nomodulen... 目录一、引言二、错误原因分析三、解决办法1.安装timm模块2. 检查python环境3. 解决安装路径问题

如何解决mysql出现Incorrect string value for column ‘表项‘ at row 1错误问题

《如何解决mysql出现Incorrectstringvalueforcolumn‘表项‘atrow1错误问题》:本文主要介绍如何解决mysql出现Incorrectstringv... 目录mysql出现Incorrect string value for column ‘表项‘ at row 1错误报错

如何解决Spring MVC中响应乱码问题

《如何解决SpringMVC中响应乱码问题》:本文主要介绍如何解决SpringMVC中响应乱码问题,具有很好的参考价值,希望对大家有所帮助,如有错误或未考虑完全的地方,望不吝赐教... 目录Spring MVC最新响应中乱码解决方式以前的解决办法这是比较通用的一种方法总结Spring MVC最新响应中乱码解

Java报NoClassDefFoundError异常的原因及解决

《Java报NoClassDefFoundError异常的原因及解决》在Java开发过程中,java.lang.NoClassDefFoundError是一个令人头疼的运行时错误,本文将深入探讨这一问... 目录一、问题分析二、报错原因三、解决思路四、常见场景及原因五、深入解决思路六、预http://www

pip无法安装osgeo失败的问题解决

《pip无法安装osgeo失败的问题解决》本文主要介绍了pip无法安装osgeo失败的问题解决,文中通过示例代码介绍的非常详细,对大家的学习或者工作具有一定的参考学习价值,需要的朋友们下面随着小编来一... 进入官方提供的扩展包下载网站寻找版本适配的whl文件注意:要选择cp(python版本)和你py