获得IO异常在Android Studio终端中运行时

时间:2017-11-30 10:33:01

标签: android gradle ioexception android-proguard

我有android项目。我已经集成了一些新的代码。我添加了不警告该文件夹本身。

  -dontwarn com.myapp.mobile.util**

之后我在android studio终端上运行了构建。得到以下异常不知道做什么。我无法理解日志。

         [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter]
        15:51:11.735 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] FAILURE: Build failed with an exception.
        15:51:11.736 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter]
        15:51:11.736 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] * What went wrong:
        15:51:11.736 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] Execution failed for task ':myApp:transformClassesAndResourcesWithProguardForRelease'.
        15:51:11.736 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] > Job failed, see logs for details
        15:51:11.736 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter]
        15:51:11.736 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] * Exception is:
        15:51:11.737 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] org.gradle.api.tasks.TaskExecutionException: Execution failed for task '::transformClassesAndResourcesW
        ithProguardForRelease'.
        15:51:11.737 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter]   at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeActions(ExecuteActionsTaskExecuter.java:1
        00)
        15:51:11.737 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter]   at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.execute(ExecuteActionsTaskExecuter.java:70)
        15:51:11.737 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter]   at org.gradle.api.internal.tasks.execution.SkipUpToDateTaskExecuter.execute(SkipUpToDateTaskExecuter.java:63)
        15:51:11.737 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter]   at org.gradle.api.internal.tasks.execution.ResolveTaskOutputCachingStateExecuter.execute(ResolveTaskOutputCachingState
        Executer.java:54)
        15:51:11.737 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter]   at org.gradle.api.internal.tasks.execution.ValidatingTaskExecuter.execute(ValidatingTaskExecuter.java:58)
        15:51:11.737 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter]   at org.gradle.api.internal.tasks.execution.SkipEmptySourceFilesTaskExecuter.execute(SkipEmptySourceFilesTaskExecuter.j
        ava:88)
        15:51:11.737 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter]   at org.gradle.api.internal.tasks.execution.ResolveTaskArtifactStateTaskExecuter.execute(ResolveTaskArtifactStateTaskEx
        ecuter.java:52)
        15:51:11.737 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter]   at org.gradle.api.internal.tasks.execution.SkipTaskWithNoActionsExecuter.execute(SkipTaskWithNoActionsExecuter.java:52
        )
        15:51:11.737 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter]   at org.gradle.api.internal.tasks.execution.SkipOnlyIfTaskExecuter.execute(SkipOnlyIfTaskExecuter.java:54)
        15:51:11.737 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter]   at org.gradle.api.internal.tasks.execution.ExecuteAtMostOnceTaskExecuter.execute(ExecuteAtMostOnceTaskExecuter.java:43
        )
        15:51:11.737 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter]   at org.gradle.api.internal.tasks.execution.CatchExceptionTaskExecuter.execute(CatchExceptionTaskExecuter.java:34)
        15:51:11.737 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter]   at org.gradle.execution.taskgraph.DefaultTaskGraphExecuter$EventFiringTaskWorker$1.run(DefaultTaskGraphExecuter.java:2
        48)
        15:51:11.737 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter]   at org.gradle.internal.progress.DefaultBuildOperationExecutor$RunnableBuildOperationWorker.execute(DefaultBuildOperati
        onExecutor.java:336)
        15:51:11.737 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter]   at org.gradle.internal.progress.DefaultBuildOperationExecutor$RunnableBuildOperationWorker.execute(DefaultBuildOperati
        onExecutor.java:328)
        15:51:11.737 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter]   at org.gradle.internal.progress.DefaultBuildOperationExecutor.execute(DefaultBuildOperationExecutor.java:197)
        15:51:11.737 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter]   at org.gradle.internal.progress.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:107)
        15:51:11.737 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter]   at org.gradle.execution.taskgraph.DefaultTaskGraphExecuter$EventFiringTaskWorker.execute(DefaultTaskGraphExecuter.java
        :241)
        15:51:11.737 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter]   at org.gradle.execution.taskgraph.DefaultTaskGraphExecuter$EventFiringTaskWorker.execute(DefaultTaskGraphExecuter.java
        :230)
        15:51:11.737 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter]   at org.gradle.execution.taskgraph.DefaultTaskPlanExecutor$TaskExecutorWorker.processTask(DefaultTaskPlanExecutor.java:
        124)
        15:51:11.737 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter]   at org.gradle.execution.taskgraph.DefaultTaskPlanExecutor$TaskExecutorWorker.access$200(DefaultTaskPlanExecutor.java:8
        0)
        15:51:11.737 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter]   at org.gradle.execution.taskgraph.DefaultTaskPlanExecutor$TaskExecutorWorker$1.execute(DefaultTaskPlanExecutor.java:10
        5)
        15:51:11.737 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter]   at org.gradle.execution.taskgraph.DefaultTaskPlanExecutor$TaskExecutorWorker$1.execute(DefaultTaskPlanExecutor.java:99
        )
        15:51:11.737 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter]   at org.gradle.execution.taskgraph.DefaultTaskExecutionPlan.execute(DefaultTaskExecutionPlan.java:625)
        15:51:11.738 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter]   at org.gradle.execution.taskgraph.DefaultTaskExecutionPlan.executeWithTask(DefaultTaskExecutionPlan.java:580)
        15:51:11.738 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter]   at org.gradle.execution.taskgraph.DefaultTaskPlanExecutor$TaskExecutorWorker.run(DefaultTaskPlanExecutor.java:99)
        15:51:11.738 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter]   at org.gradle.internal.concurrent.ExecutorPolicy$CatchAndRecordFailures.onExecute(ExecutorPolicy.java:63)
        15:51:11.738 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter]   at org.gradle.internal.concurrent.ManagedExecutorImpl$1.run(ManagedExecutorImpl.java:46)
        15:51:11.738 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter]   at org.gradle.internal.concurrent.ThreadFactoryImpl$ManagedThreadRunnable.run(ThreadFactoryImpl.java:55)
        15:51:11.738 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] Caused by: java.lang.RuntimeException: Job failed, see logs for details
        15:51:11.738 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter]   at com.android.build.gradle.internal.transforms.ProGuardTransform.transform(ProGuardTransform.java:196)
        15:51:11.738 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter]   at com.android.build.gradle.internal.pipeline.TransformTask$2.call(TransformTask.java:222)
        15:51:11.738 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter]   at com.android.build.gradle.internal.pipeline.TransformTask$2.call(TransformTask.java:218)
        15:51:11.738 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter]   at com.android.builder.profile.ThreadRecorder.record(ThreadRecorder.java:102)
        15:51:11.738 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter]   at com.android.build.gradle.internal.pipeline.TransformTask.transform(TransformTask.java:213)
        15:51:11.738 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter]   at org.gradle.internal.reflect.JavaMethod.invoke(JavaMethod.java:73)
        15:51:11.738 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter]   at org.gradle.api.internal.project.taskfactory.DefaultTaskClassInfoStore$IncrementalTaskAction.doExecute(DefaultTaskCl
        assInfoStore.java:173)
        15:51:11.738 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter]   at org.gradle.api.internal.project.taskfactory.DefaultTaskClassInfoStore$StandardTaskAction.execute(DefaultTaskClassIn
        foStore.java:134)
        15:51:11.738 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter]   at org.gradle.api.internal.project.taskfactory.DefaultTaskClassInfoStore$StandardTaskAction.execute(DefaultTaskClassIn
        foStore.java:121)
        15:51:11.738 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter]   at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter$1.run(ExecuteActionsTaskExecuter.java:122)
        15:51:11.738 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter]   at org.gradle.internal.progress.DefaultBuildOperationExecutor$RunnableBuildOperationWorker.execute(DefaultBuildOperati
        onExecutor.java:336)
        15:51:11.738 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter]   at org.gradle.internal.progress.DefaultBuildOperationExecutor$RunnableBuildOperationWorker.execute(DefaultBuildOperati
        onExecutor.java:328)
        15:51:11.738 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter]   at org.gradle.internal.progress.DefaultBuildOperationExecutor.execute(DefaultBuildOperationExecutor.java:197)
        15:51:11.738 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter]   at org.gradle.internal.progress.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:107)
        15:51:11.738 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter]   at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeAction(ExecuteActionsTaskExecuter.java:11
        1)
        15:51:11.738 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter]   at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeActions(ExecuteActionsTaskExecuter.java:9
        2)
        15:51:11.738 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter]   ... 27 more
        15:51:11.738 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] Caused by: java.io.IOException: Please correct the above warnings first.
        15:51:11.739 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter]   at proguard.Initializer.execute(Initializer.java:473)
        15:51:11.739 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter]   at proguard.ProGuard.initialize(ProGuard.java:233)
        15:51:11.739 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter]   at proguard.ProGuard.execute(ProGuard.java:98)
        15:51:11.739 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter]   at com.android.build.gradle.internal.transforms.BaseProguardAction.runProguard(BaseProguardAction.java:61)
        15:51:11.739 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter]   at com.android.build.gradle.internal.transforms.ProGuardTransform.doMinification(ProGuardTransform.java:253)
        15:51:11.739 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter]   at com.android.build.gradle.internal.transforms.ProGuardTransform.access$000(ProGuardTransform.java:63)
        15:51:11.739 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter]   at com.android.build.gradle.internal.transforms.ProGuardTransform$1.run(ProGuardTransform.java:173)
        15:51:11.739 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter]   at com.android.builder.tasks.Job.runTask(Job.java:47)
        15:51:11.739 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter]   at com.android.build.gradle.tasks.SimpleWorkQueue$EmptyThreadContext.runTask(SimpleWorkQueue.java:41)
        15:51:11.739 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter]   at com.android.builder.tasks.WorkQueue.run(WorkQueue.java:259)
        15:51:11.739 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter]
        15:51:11.739 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter]
        15:51:11.739 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] * Get more help at https://help.gradle.org
        15:51:11.739 [ERROR] [org.gradle.internal.buildevents.BuildResultLogger]
        15:51:11.739 [ERROR] [org.gradle.internal.buildevents.BuildResultLogger] BUILD FAILED in 2m 19s

请不要让我理解这个例外。

这是我的模块

的build.gradle文件
    buildscript {
      dependencies {
          classpath 'com.android.tools.build:gradle:2.1.2'
      }
      }
        android {
            compileSdkVersion 26
            buildToolsVersion "26.0.3"

            defaultConfig {
                applicationId "com.myapp.mobile"
                minSdkVersion 10
                targetSdkVersion 21
                testApplicationId "com.myapp"
                multiDexEnabled true
            }

            buildTypes {
                release {
                    minifyEnabled true
                    proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
                    signingConfig signingConfigs.release
                }
            }

            compileOptions {
                sourceCompatibility JavaVersion.VERSION_1_8
                targetCompatibility JavaVersion.VERSION_1_8
            }
        }

我的root build.gradle是

        apply plugin:'base'
        buildscript {
            repositories {
                jcenter()
                google()
            }
            dependencies {
                classpath 'com.android.tools.build:gradle:3.0.0'
            }
        }

        allprojects {
            repositories {
                jcenter()
                google()
            }
        }

所以我使用了匹配的构建工具。我的问题的任何其他解决方案。

0 个答案:

没有答案