将Gradle更新到3.1.1版后,Android库无法正常工作

时间:2018-04-25 14:43:48

标签: android android-gradle build.gradle android-library android-studio-3.0

将gradle更新为3.1.1后,我的库无效。它正在编译,但当我尝试运行该项目时,它给出了以下错误:

引起:java.lang.ClassNotFoundException:找不到类com.google.android.gms.tasks.OnSuccessListener

我还在外部库中观察到它没有加载与我的lib相关的所有依赖项。

任何帮助都将受到高度赞赏。 提前谢谢。

这是完整的日志文件。

(a, b, c)
(a, c, b)
(b, c, a)
(b, a, c)
(c, a, b)
(c, b, a)
...

这是我的gradle文件

org.gradle.api.tasks.TaskExecutionException: Execution failed for task ':app:transformClassesWithDesugarForDebug'.
    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.OutputDirectoryCreatingTaskExecuter.execute(OutputDirectoryCreatingTaskExecuter.java:51)
    at org.gradle.api.internal.tasks.execution.SkipUpToDateTaskExecuter.execute(SkipUpToDateTaskExecuter.java:62)
    at org.gradle.api.internal.tasks.execution.ResolveTaskOutputCachingStateExecuter.execute(ResolveTaskOutputCachingStateExecuter.java:54)
    at org.gradle.api.internal.tasks.execution.ValidatingTaskExecuter.execute(ValidatingTaskExecuter.java:60)
    at org.gradle.api.internal.tasks.execution.SkipEmptySourceFilesTaskExecuter.execute(SkipEmptySourceFilesTaskExecuter.java:97)
    at org.gradle.api.internal.tasks.execution.CleanupStaleOutputsExecuter.execute(CleanupStaleOutputsExecuter.java:87)
    at org.gradle.api.internal.tasks.execution.ResolveTaskArtifactStateTaskExecuter.execute(ResolveTaskArtifactStateTaskExecuter.java:52)
    at org.gradle.api.internal.tasks.execution.SkipTaskWithNoActionsExecuter.execute(SkipTaskWithNoActionsExecuter.java:52)
    at org.gradle.api.internal.tasks.execution.SkipOnlyIfTaskExecuter.execute(SkipOnlyIfTaskExecuter.java:54)
    at org.gradle.api.internal.tasks.execution.ExecuteAtMostOnceTaskExecuter.execute(ExecuteAtMostOnceTaskExecuter.java:43)
    at org.gradle.api.internal.tasks.execution.CatchExceptionTaskExecuter.execute(CatchExceptionTaskExecuter.java:34)
    at org.gradle.execution.taskgraph.DefaultTaskGraphExecuter$EventFiringTaskWorker$1.run(DefaultTaskGraphExecuter.java:248)
    at org.gradle.internal.progress.DefaultBuildOperationExecutor$RunnableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:336)
    at org.gradle.internal.progress.DefaultBuildOperationExecutor$RunnableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:328)
    at org.gradle.internal.progress.DefaultBuildOperationExecutor.execute(DefaultBuildOperationExecutor.java:199)
    at org.gradle.internal.progress.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:110)
    at org.gradle.execution.taskgraph.DefaultTaskGraphExecuter$EventFiringTaskWorker.execute(DefaultTaskGraphExecuter.java:241)
    at org.gradle.execution.taskgraph.DefaultTaskGraphExecuter$EventFiringTaskWorker.execute(DefaultTaskGraphExecuter.java:230)
    at org.gradle.execution.taskgraph.DefaultTaskPlanExecutor$TaskExecutorWorker.processTask(DefaultTaskPlanExecutor.java:123)
    at org.gradle.execution.taskgraph.DefaultTaskPlanExecutor$TaskExecutorWorker.access$200(DefaultTaskPlanExecutor.java:79)
    at org.gradle.execution.taskgraph.DefaultTaskPlanExecutor$TaskExecutorWorker$1.execute(DefaultTaskPlanExecutor.java:104)
    at org.gradle.execution.taskgraph.DefaultTaskPlanExecutor$TaskExecutorWorker$1.execute(DefaultTaskPlanExecutor.java:98)
    at org.gradle.execution.taskgraph.DefaultTaskExecutionPlan.execute(DefaultTaskExecutionPlan.java:626)
    at org.gradle.execution.taskgraph.DefaultTaskExecutionPlan.executeWithTask(DefaultTaskExecutionPlan.java:581)
    at org.gradle.execution.taskgraph.DefaultTaskPlanExecutor$TaskExecutorWorker.run(DefaultTaskPlanExecutor.java:98)
    at org.gradle.internal.concurrent.ExecutorPolicy$CatchAndRecordFailures.onExecute(ExecutorPolicy.java:63)
    at org.gradle.internal.concurrent.ManagedExecutorImpl$1.run(ManagedExecutorImpl.java:46)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
    at org.gradle.internal.concurrent.ThreadFactoryImpl$ManagedThreadRunnable.run(ThreadFactoryImpl.java:55)
    at java.lang.Thread.run(Thread.java:745)
Caused by: java.lang.RuntimeException: com.android.build.api.transform.TransformException: java.lang.RuntimeException: java.lang.RuntimeException: com.android.ide.common.process.ProcessException: Error while executing java process with main class com.google.devtools.build.android.desugar.Desugar with arguments {--input C:\Users\gkondati\Downloads\PromptDemo\app\build\intermediates\transforms\stackFramesFixer\debug\11.jar --output C:\Users\gkondati\Downloads\PromptDemo\app\build\intermediates\transforms\desugar\debug\12.jar --input C:\Users\gkondati\Downloads\PromptDemo\app\build\intermediates\transforms\stackFramesFixer\debug\10.jar --output C:\Users\gkondati\Downloads\PromptDemo\app\build\intermediates\transforms\desugar\debug\11.jar --input C:\Users\gkondati\Downloads\PromptDemo\app\build\intermediates\transforms\stackFramesFixer\debug\3.jar --output C:\Users\gkondati\Downloads\PromptDemo\app\build\intermediates\transforms\desugar\debug\4.jar --classpath_entry C:\Users\gkondati\Downloads\PromptDemo\app\build\intermediates\classes\debug --classpath_entry C:\Users\gkondati\Downloads\PromptDemo\app\build\intermediates\transforms\stackFramesFixer\debug\0.jar --classpath_entry C:\Users\gkondati\Downloads\PromptDemo\app\build\intermediates\transforms\stackFramesFixer\debug\1.jar --classpath_entry C:\Users\gkondati\Downloads\PromptDemo\app\build\intermediates\transforms\stackFramesFixer\debug\2.jar --classpath_entry C:\Users\gkondati\Downloads\PromptDemo\app\build\intermediates\transforms\stackFramesFixer\debug\3.jar --classpath_entry C:\Users\gkondati\Downloads\PromptDemo\app\build\intermediates\transforms\stackFramesFixer\debug\4.jar --classpath_entry C:\Users\gkondati\Downloads\PromptDemo\app\build\intermediates\transforms\stackFramesFixer\debug\5.jar --classpath_entry C:\Users\gkondati\Downloads\PromptDemo\app\build\intermediates\transforms\stackFramesFixer\debug\6.jar --classpath_entry C:\Users\gkondati\Downloads\PromptDemo\app\build\intermediates\transforms\stackFramesFixer\debug\7.jar --classpath_entry C:\Users\gkondati\Downloads\PromptDemo\app\build\intermediates\transforms\stackFramesFixer\debug\8.jar --classpath_entry C:\Users\gkondati\Downloads\PromptDemo\app\build\intermediates\transforms\stackFramesFixer\debug\9.jar --classpath_entry C:\Users\gkondati\Downloads\PromptDemo\app\build\intermediates\transforms\stackFramesFixer\debug\10.jar --classpath_entry C:\Users\gkondati\Downloads\PromptDemo\app\build\intermediates\transforms\stackFramesFixer\debug\11.jar --classpath_entry C:\Users\gkondati\Downloads\PromptDemo\app\build\intermediates\transforms\stackFramesFixer\debug\12.jar --classpath_entry C:\Users\gkondati\Downloads\PromptDemo\app\build\intermediates\transforms\stackFramesFixer\debug\13.jar --classpath_entry C:\Users\gkondati\Downloads\PromptDemo\app\build\intermediates\transforms\stackFramesFixer\debug\14.jar --classpath_entry C:\Users\gkondati\Downloads\PromptDemo\app\build\intermediates\transforms\stackFramesFixer\debug\15.jar --classpath_entry C:\Users\gkondati\Downloads\PromptDemo\app\build\intermediates\transforms\stackFramesFixer\debug\16.jar --bootclasspath_entry C:\Users\gkondati\AppData\Local\Android\Sdk\platforms\android-26\android.jar --bootclasspath_entry C:\Users\gkondati\AppData\Local\Android\Sdk\platforms\android-26\optional\org.apache.http.legacy.jar --bootclasspath_entry C:\Program Files\Android\Android Studio\jre\jre\lib\resources.jar --bootclasspath_entry C:\Program Files\Android\Android Studio\jre\jre\lib\rt.jar --bootclasspath_entry C:\Program Files\Android\Android Studio\jre\jre\lib\jsse.jar --bootclasspath_entry C:\Program Files\Android\Android Studio\jre\jre\lib\jce.jar --bootclasspath_entry C:\Program Files\Android\Android Studio\jre\jre\lib\charsets.jar --min_sdk_version 22 --nodesugar_try_with_resources_if_needed --desugar_try_with_resources_omit_runtime_classes}
    at com.android.builder.profile.Recorder$Block.handleException(Recorder.java:55)
    at com.android.builder.profile.ThreadRecorder.record(ThreadRecorder.java:104)
    at com.android.build.gradle.internal.pipeline.TransformTask.transform(TransformTask.java:213)
    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:73)
    at org.gradle.api.internal.project.taskfactory.IncrementalTaskAction.doExecute(IncrementalTaskAction.java:46)
    at org.gradle.api.internal.project.taskfactory.StandardTaskAction.execute(StandardTaskAction.java:39)
    at org.gradle.api.internal.project.taskfactory.StandardTaskAction.execute(StandardTaskAction.java:26)
    at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter$1.run(ExecuteActionsTaskExecuter.java:121)
    at org.gradle.internal.progress.DefaultBuildOperationExecutor$RunnableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:336)
    at org.gradle.internal.progress.DefaultBuildOperationExecutor$RunnableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:328)
    at org.gradle.internal.progress.DefaultBuildOperationExecutor.execute(DefaultBuildOperationExecutor.java:199)
    at org.gradle.internal.progress.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:110)
    at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeAction(ExecuteActionsTaskExecuter.java:110)
    at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeActions(ExecuteActionsTaskExecuter.java:92)
    ... 32 more
Caused by: com.android.build.api.transform.TransformException: java.lang.RuntimeException: java.lang.RuntimeException: com.android.ide.common.process.ProcessException: Error while executing java process with main class com.google.devtools.build.android.desugar.Desugar with arguments {--input C:\Users\gkondati\Downloads\PromptDemo\app\build\intermediates\transforms\stackFramesFixer\debug\11.jar --output C:\Users\gkondati\Downloads\PromptDemo\app\build\intermediates\transforms\desugar\debug\12.jar --input C:\Users\gkondati\Downloads\PromptDemo\app\build\intermediates\transforms\stackFramesFixer\debug\10.jar --output C:\Users\gkondati\Downloads\PromptDemo\app\build\intermediates\transforms\desugar\debug\11.jar --input C:\Users\gkondati\Downloads\PromptDemo\app\build\intermediates\transforms\stackFramesFixer\debug\3.jar --output C:\Users\gkondati\Downloads\PromptDemo\app\build\intermediates\transforms\desugar\debug\4.jar --classpath_entry C:\Users\gkondati\Downloads\PromptDemo\app\build\intermediates\classes\debug --classpath_entry C:\Users\gkondati\Downloads\PromptDemo\app\build\intermediates\transforms\stackFramesFixer\debug\0.jar --classpath_entry C:\Users\gkondati\Downloads\PromptDemo\app\build\intermediates\transforms\stackFramesFixer\debug\1.jar --classpath_entry C:\Users\gkondati\Downloads\PromptDemo\app\build\intermediates\transforms\stackFramesFixer\debug\2.jar --classpath_entry C:\Users\gkondati\Downloads\PromptDemo\app\build\intermediates\transforms\stackFramesFixer\debug\3.jar --classpath_entry C:\Users\gkondati\Downloads\PromptDemo\app\build\intermediates\transforms\stackFramesFixer\debug\4.jar --classpath_entry C:\Users\gkondati\Downloads\PromptDemo\app\build\intermediates\transforms\stackFramesFixer\debug\5.jar --classpath_entry C:\Users\gkondati\Downloads\PromptDemo\app\build\intermediates\transforms\stackFramesFixer\debug\6.jar --classpath_entry C:\Users\gkondati\Downloads\PromptDemo\app\build\intermediates\transforms\stackFramesFixer\debug\7.jar --classpath_entry C:\Users\gkondati\Downloads\PromptDemo\app\build\intermediates\transforms\stackFramesFixer\debug\8.jar --classpath_entry C:\Users\gkondati\Downloads\PromptDemo\app\build\intermediates\transforms\stackFramesFixer\debug\9.jar --classpath_entry C:\Users\gkondati\Downloads\PromptDemo\app\build\intermediates\transforms\stackFramesFixer\debug\10.jar --classpath_entry C:\Users\gkondati\Downloads\PromptDemo\app\build\intermediates\transforms\stackFramesFixer\debug\11.jar --classpath_entry C:\Users\gkondati\Downloads\PromptDemo\app\build\intermediates\transforms\stackFramesFixer\debug\12.jar --classpath_entry C:\Users\gkondati\Downloads\PromptDemo\app\build\intermediates\transforms\stackFramesFixer\debug\13.jar --classpath_entry C:\Users\gkondati\Downloads\PromptDemo\app\build\intermediates\transforms\stackFramesFixer\debug\14.jar --classpath_entry C:\Users\gkondati\Downloads\PromptDemo\app\build\intermediates\transforms\stackFramesFixer\debug\15.jar --classpath_entry C:\Users\gkondati\Downloads\PromptDemo\app\build\intermediates\transforms\stackFramesFixer\debug\16.jar --bootclasspath_entry C:\Users\gkondati\AppData\Local\Android\Sdk\platforms\android-26\android.jar --bootclasspath_entry C:\Users\gkondati\AppData\Local\Android\Sdk\platforms\android-26\optional\org.apache.http.legacy.jar --bootclasspath_entry C:\Program Files\Android\Android Studio\jre\jre\lib\resources.jar --bootclasspath_entry C:\Program Files\Android\Android Studio\jre\jre\lib\rt.jar --bootclasspath_entry C:\Program Files\Android\Android Studio\jre\jre\lib\jsse.jar --bootclasspath_entry C:\Program Files\Android\Android Studio\jre\jre\lib\jce.jar --bootclasspath_entry C:\Program Files\Android\Android Studio\jre\jre\lib\charsets.jar --min_sdk_version 22 --nodesugar_try_with_resources_if_needed --desugar_try_with_resources_omit_runtime_classes}
    at com.android.build.gradle.internal.transforms.DesugarTransform.transform(DesugarTransform.java:236)
    at com.android.build.gradle.internal.pipeline.TransformTask$2.call(TransformTask.java:222)
    at com.android.build.gradle.internal.pipeline.TransformTask$2.call(TransformTask.java:218)
    at com.android.builder.profile.ThreadRecorder.record(ThreadRecorder.java:102)
    ... 48 more
Caused by: java.lang.RuntimeException: java.lang.RuntimeException: com.android.ide.common.process.ProcessException: Error while executing java process with main class com.google.devtools.build.android.desugar.Desugar with arguments {--input C:\Users\gkondati\Downloads\PromptDemo\app\build\intermediates\transforms\stackFramesFixer\debug\11.jar --output C:\Users\gkondati\Downloads\PromptDemo\app\build\intermediates\transforms\desugar\debug\12.jar --input C:\Users\gkondati\Downloads\PromptDemo\app\build\intermediates\transforms\stackFramesFixer\debug\10.jar --output C:\Users\gkondati\Downloads\PromptDemo\app\build\intermediates\transforms\desugar\debug\11.jar --input C:\Users\gkondati\Downloads\PromptDemo\app\build\intermediates\transforms\stackFramesFixer\debug\3.jar --output C:\Users\gkondati\Downloads\PromptDemo\app\build\intermediates\transforms\desugar\debug\4.jar --classpath_entry C:\Users\gkondati\Downloads\PromptDemo\app\build\intermediates\classes\debug --classpath_entry C:\Users\gkondati\Downloads\PromptDemo\app\build\intermediates\transforms\stackFramesFixer\debug\0.jar --classpath_entry C:\Users\gkondati\Downloads\PromptDemo\app\build\intermediates\transforms\stackFramesFixer\debug\1.jar --classpath_entry C:\Users\gkondati\Downloads\PromptDemo\app\build\intermediates\transforms\stackFramesFixer\debug\2.jar --classpath_entry C:\Users\gkondati\Downloads\PromptDemo\app\build\intermediates\transforms\stackFramesFixer\debug\3.jar --classpath_entry C:\Users\gkondati\Downloads\PromptDemo\app\build\intermediates\transforms\stackFramesFixer\debug\4.jar --classpath_entry C:\Users\gkondati\Downloads\PromptDemo\app\build\intermediates\transforms\stackFramesFixer\debug\5.jar --classpath_entry C:\Users\gkondati\Downloads\PromptDemo\app\build\intermediates\transforms\stackFramesFixer\debug\6.jar --classpath_entry C:\Users\gkondati\Downloads\PromptDemo\app\build\intermediates\transforms\stackFramesFixer\debug\7.jar --classpath_entry C:\Users\gkondati\Downloads\PromptDemo\app\build\intermediates\transforms\stackFramesFixer\debug\8.jar --classpath_entry C:\Users\gkondati\Downloads\PromptDemo\app\build\intermediates\transforms\stackFramesFixer\debug\9.jar --classpath_entry C:\Users\gkondati\Downloads\PromptDemo\app\build\intermediates\transforms\stackFramesFixer\debug\10.jar --classpath_entry C:\Users\gkondati\Downloads\PromptDemo\app\build\intermediates\transforms\stackFramesFixer\debug\11.jar --classpath_entry C:\Users\gkondati\Downloads\PromptDemo\app\build\intermediates\transforms\stackFramesFixer\debug\12.jar --classpath_entry C:\Users\gkondati\Downloads\PromptDemo\app\build\intermediates\transforms\stackFramesFixer\debug\13.jar --classpath_entry C:\Users\gkondati\Downloads\PromptDemo\app\build\intermediates\transforms\stackFramesFixer\debug\14.jar --classpath_entry C:\Users\gkondati\Downloads\PromptDemo\app\build\intermediates\transforms\stackFramesFixer\debug\15.jar --classpath_entry C:\Users\gkondati\Downloads\PromptDemo\app\build\intermediates\transforms\stackFramesFixer\debug\16.jar --bootclasspath_entry C:\Users\gkondati\AppData\Local\Android\Sdk\platforms\android-26\android.jar --bootclasspath_entry C:\Users\gkondati\AppData\Local\Android\Sdk\platforms\android-26\optional\org.apache.http.legacy.jar --bootclasspath_entry C:\Program Files\Android\Android Studio\jre\jre\lib\resources.jar --bootclasspath_entry C:\Program Files\Android\Android Studio\jre\jre\lib\rt.jar --bootclasspath_entry C:\Program Files\Android\Android Studio\jre\jre\lib\jsse.jar --bootclasspath_entry C:\Program Files\Android\Android Studio\jre\jre\lib\jce.jar --bootclasspath_entry C:\Program Files\Android\Android Studio\jre\jre\lib\charsets.jar --min_sdk_version 22 --nodesugar_try_with_resources_if_needed --desugar_try_with_resources_omit_runtime_classes}
    at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
    at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
    at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
    at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
    at java.util.concurrent.ForkJoinTask.getThrowableException(ForkJoinTask.java:593)
    at java.util.concurrent.ForkJoinTask.reportException(ForkJoinTask.java:677)
    at java.util.concurrent.ForkJoinTask.join(ForkJoinTask.java:720)
    at com.android.ide.common.internal.WaitableExecutor.waitForTasksWithQuickFail(WaitableExecutor.java:146)
    at com.android.build.gradle.internal.transforms.DesugarTransform.transform(DesugarTransform.java:230)
    ... 51 more
Caused by: java.lang.RuntimeException: com.android.ide.common.process.ProcessException: Error while executing java process with main class com.google.devtools.build.android.desugar.Desugar with arguments {--input C:\Users\gkondati\Downloads\PromptDemo\app\build\intermediates\transforms\stackFramesFixer\debug\11.jar --output C:\Users\gkondati\Downloads\PromptDemo\app\build\intermediates\transforms\desugar\debug\12.jar --input C:\Users\gkondati\Downloads\PromptDemo\app\build\intermediates\transforms\stackFramesFixer\debug\10.jar --output C:\Users\gkondati\Downloads\PromptDemo\app\build\intermediates\transforms\desugar\debug\11.jar --input C:\Users\gkondati\Downloads\PromptDemo\app\build\intermediates\transforms\stackFramesFixer\debug\3.jar --output C:\Users\gkondati\Downloads\PromptDemo\app\build\intermediates\transforms\desugar\debug\4.jar --classpath_entry C:\Users\gkondati\Downloads\PromptDemo\app\build\intermediates\classes\debug --classpath_entry C:\Users\gkondati\Downloads\PromptDemo\app\build\intermediates\transforms\stackFramesFixer\debug\0.jar --classpath_entry C:\Users\gkondati\Downloads\PromptDemo\app\build\intermediates\transforms\stackFramesFixer\debug\1.jar --classpath_entry C:\Users\gkondati\Downloads\PromptDemo\app\build\intermediates\transforms\stackFramesFixer\debug\2.jar --classpath_entry C:\Users\gkondati\Downloads\PromptDemo\app\build\intermediates\transforms\stackFramesFixer\debug\3.jar --classpath_entry C:\Users\gkondati\Downloads\PromptDemo\app\build\intermediates\transforms\stackFramesFixer\debug\4.jar --classpath_entry C:\Users\gkondati\Downloads\PromptDemo\app\build\intermediates\transforms\stackFramesFixer\debug\5.jar --classpath_entry C:\Users\gkondati\Downloads\PromptDemo\app\build\intermediates\transforms\stackFramesFixer\debug\6.jar --classpath_entry C:\Users\gkondati\Downloads\PromptDemo\app\build\intermediates\transforms\stackFramesFixer\debug\7.jar --classpath_entry C:\Users\gkondati\Downloads\PromptDemo\app\build\intermediates\transforms\stackFramesFixer\debug\8.jar --classpath_entry C:\Users\gkondati\Downloads\PromptDemo\app\build\intermediates\transforms\stackFramesFixer\debug\9.jar --classpath_entry C:\Users\gkondati\Downloads\PromptDemo\app\build\intermediates\transforms\stackFramesFixer\debug\10.jar --classpath_entry C:\Users\gkondati\Downloads\PromptDemo\app\build\intermediates\transforms\stackFramesFixer\debug\11.jar --classpath_entry C:\Users\gkondati\Downloads\PromptDemo\app\build\intermediates\transforms\stackFramesFixer\debug\12.jar --classpath_entry C:\Users\gkondati\Downloads\PromptDemo\app\build\intermediates\transforms\stackFramesFixer\debug\13.jar --classpath_entry C:\Users\gkondati\Downloads\PromptDemo\app\build\intermediates\transforms\stackFramesFixer\debug\14.jar --classpath_entry C:\Users\gkondati\Downloads\PromptDemo\app\build\intermediates\transforms\stackFramesFixer\debug\15.jar --classpath_entry C:\Users\gkondati\Downloads\PromptDemo\app\build\intermediates\transforms\stackFramesFixer\debug\16.jar --bootclasspath_entry C:\Users\gkondati\AppData\Local\Android\Sdk\platforms\android-26\android.jar --bootclasspath_entry C:\Users\gkondati\AppData\Local\Android\Sdk\platforms\android-26\optional\org.apache.http.legacy.jar --bootclasspath_entry C:\Program Files\Android\Android Studio\jre\jre\lib\resources.jar --bootclasspath_entry C:\Program Files\Android\Android Studio\jre\jre\lib\rt.jar --bootclasspath_entry C:\Program Files\Android\Android Studio\jre\jre\lib\jsse.jar --bootclasspath_entry C:\Program Files\Android\Android Studio\jre\jre\lib\jce.jar --bootclasspath_entry C:\Program Files\Android\Android Studio\jre\jre\lib\charsets.jar --min_sdk_version 22 --nodesugar_try_with_resources_if_needed --desugar_try_with_resources_omit_runtime_classes}
    at java.util.concurrent.ForkJoinTask$AdaptedCallable.exec(ForkJoinTask.java:1431)
    at java.util.concurrent.ForkJoinTask.doExec(ForkJoinTask.java:289)
    at java.util.concurrent.ForkJoinPool$WorkQueue.runTask(ForkJoinPool.java:1056)
    at java.util.concurrent.ForkJoinPool.runWorker(ForkJoinPool.java:1692)
    at java.util.concurrent.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:157)
Caused by: com.android.ide.common.process.ProcessException: Error while executing java process with main class com.google.devtools.build.android.desugar.Desugar with arguments {--input C:\Users\gkondati\Downloads\PromptDemo\app\build\intermediates\transforms\stackFramesFixer\debug\11.jar --output C:\Users\gkondati\Downloads\PromptDemo\app\build\intermediates\transforms\desugar\debug\12.jar --input C:\Users\gkondati\Downloads\PromptDemo\app\build\intermediates\transforms\stackFramesFixer\debug\10.jar --output C:\Users\gkondati\Downloads\PromptDemo\app\build\intermediates\transforms\desugar\debug\11.jar --input C:\Users\gkondati\Downloads\PromptDemo\app\build\intermediates\transforms\stackFramesFixer\debug\3.jar --output C:\Users\gkondati\Downloads\PromptDemo\app\build\intermediates\transforms\desugar\debug\4.jar --classpath_entry C:\Users\gkondati\Downloads\PromptDemo\app\build\intermediates\classes\debug --classpath_entry C:\Users\gkondati\Downloads\PromptDemo\app\build\intermediates\transforms\stackFramesFixer\debug\0.jar --classpath_entry C:\Users\gkondati\Downloads\PromptDemo\app\build\intermediates\transforms\stackFramesFixer\debug\1.jar --classpath_entry C:\Users\gkondati\Downloads\PromptDemo\app\build\intermediates\transforms\stackFramesFixer\debug\2.jar --classpath_entry C:\Users\gkondati\Downloads\PromptDemo\app\build\intermediates\transforms\stackFramesFixer\debug\3.jar --classpath_entry C:\Users\gkondati\Downloads\PromptDemo\app\build\intermediates\transforms\stackFramesFixer\debug\4.jar --classpath_entry C:\Users\gkondati\Downloads\PromptDemo\app\build\intermediates\transforms\stackFramesFixer\debug\5.jar --classpath_entry C:\Users\gkondati\Downloads\PromptDemo\app\build\intermediates\transforms\stackFramesFixer\debug\6.jar --classpath_entry C:\Users\gkondati\Downloads\PromptDemo\app\build\intermediates\transforms\stackFramesFixer\debug\7.jar --classpath_entry C:\Users\gkondati\Downloads\PromptDemo\app\build\intermediates\transforms\stackFramesFixer\debug\8.jar --classpath_entry C:\Users\gkondati\Downloads\PromptDemo\app\build\intermediates\transforms\stackFramesFixer\debug\9.jar --classpath_entry C:\Users\gkondati\Downloads\PromptDemo\app\build\intermediates\transforms\stackFramesFixer\debug\10.jar --classpath_entry C:\Users\gkondati\Downloads\PromptDemo\app\build\intermediates\transforms\stackFramesFixer\debug\11.jar --classpath_entry C:\Users\gkondati\Downloads\PromptDemo\app\build\intermediates\transforms\stackFramesFixer\debug\12.jar --classpath_entry C:\Users\gkondati\Downloads\PromptDemo\app\build\intermediates\transforms\stackFramesFixer\debug\13.jar --classpath_entry C:\Users\gkondati\Downloads\PromptDemo\app\build\intermediates\transforms\stackFramesFixer\debug\14.jar --classpath_entry C:\Users\gkondati\Downloads\PromptDemo\app\build\intermediates\transforms\stackFramesFixer\debug\15.jar --classpath_entry C:\Users\gkondati\Downloads\PromptDemo\app\build\intermediates\transforms\stackFramesFixer\debug\16.jar --bootclasspath_entry C:\Users\gkondati\AppData\Local\Android\Sdk\platforms\android-26\android.jar --bootclasspath_entry C:\Users\gkondati\AppData\Local\Android\Sdk\platforms\android-26\optional\org.apache.http.legacy.jar --bootclasspath_entry C:\Program Files\Android\Android Studio\jre\jre\lib\resources.jar --bootclasspath_entry C:\Program Files\Android\Android Studio\jre\jre\lib\rt.jar --bootclasspath_entry C:\Program Files\Android\Android Studio\jre\jre\lib\jsse.jar --bootclasspath_entry C:\Program Files\Android\Android Studio\jre\jre\lib\jce.jar --bootclasspath_entry C:\Program Files\Android\Android Studio\jre\jre\lib\charsets.jar --min_sdk_version 22 --nodesugar_try_with_resources_if_needed --desugar_try_with_resources_omit_runtime_classes}
    at com.android.build.gradle.internal.process.GradleProcessResult.buildProcessException(GradleProcessResult.java:73)
    at com.android.build.gradle.internal.process.GradleProcessResult.assertNormalExitValue(GradleProcessResult.java:48)
    at com.android.build.gradle.internal.transforms.DesugarTransform.lambda$processNonCachedOnes$3(DesugarTransform.java:316)
    at java.util.concurrent.ForkJoinTask$AdaptedCallable.exec(ForkJoinTask.java:1424)
    ... 4 more
Caused by: org.gradle.process.internal.ExecException: Process 'command 'C:\Program Files\Android\Android Studio\jre\bin\java.exe'' finished with non-zero exit value 1
    at org.gradle.process.internal.DefaultExecHandle$ExecResultImpl.assertNormalExitValue(DefaultExecHandle.java:382)
    at com.android.build.gradle.internal.process.GradleProcessResult.assertNormalExitValue(GradleProcessResult.java:46)
    ... 6 more

2 个答案:

答案 0 :(得分:0)

非常感谢你的帮助,发现它有新的gradle插件POM文件的问题,它没有更新POM文件上的所有依赖文件。使用所需的依赖项更新POM文件可修复此问题。

答案 1 :(得分:-1)

错误是预期的,因为您正在使用implementation作为依赖项。当您使用implementation对图书馆的依赖关系进行此操作时:

dependencies {
    implementation 'com.google.android.gms:play-services-ads:15.0.0'
}

使用该库的每个模块都无法查看依赖项,因为它未编译到库中。因此,您需要将依赖项添加到模块中,如下所示:

dependencies {
    // assume this is the dependency before using the library
    implementation 'io.reactivex.rxjava2:rxjava:2.0.7'

    // you need to include the dependency from your library
    // to the module 
    implementation 'com.google.android.gms:play-services-ads:15.0.0'
}

如果您想使用与compile相同的行为,可以使用api