美文网首页
【我的Android进阶之旅】编译出现错误:Caused by:

【我的Android进阶之旅】编译出现错误:Caused by:

作者: 欧阳鹏 | 来源:发表于2018-12-06 19:46 被阅读3次

    一、问题描述

    下午编译APP的时候,出现了如下所示的错误:

    FAILURE: Build failed with an exception.
    
    * What went wrong:
    Execution failed for task ':watch:transformClassesWithComponentCodeForDebug'.
    > jzentry == 0,
       jzfile = 635410608,
       total = 303,
       name = D:\GitLab Source\XTCWatch_TalentAccount\XTCWatch\watch\libs\alibaba-alipaySingle-20170510.jar,
       i = 1,
       message = null
    
    * Try:
    Run with --info or --debug option to get more log output.
    
    * Exception is:
    org.gradle.api.tasks.TaskExecutionException: Execution failed for task ':watch:transformClassesWithComponentCodeForDebug'.
        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)
        at org.gradle.api.internal.tasks.execution.SkipEmptySourceFilesTaskExecuter.execute(SkipEmptySourceFilesTaskExecuter.java:88)
        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:197)
        at org.gradle.internal.progress.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:107)
        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:124)
        at org.gradle.execution.taskgraph.DefaultTaskPlanExecutor$TaskExecutorWorker.access$200(DefaultTaskPlanExecutor.java:80)
        at org.gradle.execution.taskgraph.DefaultTaskPlanExecutor$TaskExecutorWorker$1.execute(DefaultTaskPlanExecutor.java:105)
        at org.gradle.execution.taskgraph.DefaultTaskPlanExecutor$TaskExecutorWorker$1.execute(DefaultTaskPlanExecutor.java:99)
        at org.gradle.execution.taskgraph.DefaultTaskExecutionPlan.execute(DefaultTaskExecutionPlan.java:625)
        at org.gradle.execution.taskgraph.DefaultTaskExecutionPlan.executeWithTask(DefaultTaskExecutionPlan.java:580)
        at org.gradle.execution.taskgraph.DefaultTaskPlanExecutor$TaskExecutorWorker.run(DefaultTaskPlanExecutor.java:99)
        at org.gradle.internal.concurrent.ExecutorPolicy$CatchAndRecordFailures.onExecute(ExecutorPolicy.java:63)
        at org.gradle.internal.concurrent.ManagedExecutorImpl$1.run(ManagedExecutorImpl.java:46)
        at org.gradle.internal.concurrent.ThreadFactoryImpl$ManagedThreadRunnable.run(ThreadFactoryImpl.java:55)
    Caused by: java.util.zip.ZipError: jzentry == 0,
     jzfile = 635410608,
     total = 303,
     name = D:\GitLab Source\XTCWatch_TalentAccount\XTCWatch\watch\libs\alibaba-alipaySingle-20170510.jar,
     i = 1,
     message = null
        at java_util_Enumeration$nextElement$0.call(Unknown Source)
        at com.dd.buildgradle.ConvertUtils$_toCtClasses_closure1$_closure4.doCall(ConvertUtils.groovy:36)
        at com.dd.buildgradle.ConvertUtils$_toCtClasses_closure1.doCall(ConvertUtils.groovy:31)
        at com.dd.buildgradle.ConvertUtils.toCtClasses(ConvertUtils.groovy:16)
        at com.dd.buildgradle.ConvertUtils$toCtClasses.call(Unknown Source)
        at com.dd.buildgradle.ComCodeTransform.transform(ComCodeTransform.groovy:27)
        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)
        at com.android.build.gradle.internal.pipeline.TransformTask.transform(TransformTask.java:213)
        at org.gradle.internal.reflect.JavaMethod.invoke(JavaMethod.java:73)
        at org.gradle.api.internal.project.taskfactory.DefaultTaskClassInfoStore$IncrementalTaskAction.doExecute(DefaultTaskClassInfoStore.java:173)
        at org.gradle.api.internal.project.taskfactory.DefaultTaskClassInfoStore$StandardTaskAction.execute(DefaultTaskClassInfoStore.java:134)
        at org.gradle.api.internal.project.taskfactory.DefaultTaskClassInfoStore$StandardTaskAction.execute(DefaultTaskClassInfoStore.java:121)
        at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter$1.run(ExecuteActionsTaskExecuter.java:122)
        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:197)
        at org.gradle.internal.progress.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:107)
        at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeAction(ExecuteActionsTaskExecuter.java:111)
        at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeActions(ExecuteActionsTaskExecuter.java:92)
        ... 27 more
    
    
    * Get more help at https://help.gradle.org
    
    BUILD FAILED in 33s
    240 actionable tasks: 29 executed, 211 up-to-date
    

    [图片上传失败...(image-63b314-1544096755415)]

    在这里插入图片描述

    二、解决问题

    上面的错误我还是第一次遇到,不知道什么原因。

    1. 删除报错的\watch\libs\alibaba-alipaySingle-20170510.jar 包

    后来实在编译不过,我就将这个\watch\libs\alibaba-alipaySingle-20170510.jar 包直接删除,


    在这里插入图片描述

    然后编译一下,编译失败,因为刚才的jar包删除了,导致有些类找不到。

    在这里插入图片描述
    :watch:javaPreCompileDebug
    D:\GitLab Source\XTCWatch_TalentAccount\XTCWatch\watch\src\main\java\com\xtc\watch\view\h5\AlipayAuthUtil.java:6: 错误: 程序包com.alipay.sdk.app不存在
    import com.alipay.sdk.app.AuthTask;
                             ^
    1 个错误
    :watch:compileDebugJavaWithJavac FAILED
    
    FAILURE: Build failed with an exception.
    
    * What went wrong:
    Execution failed for task ':watch: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.
    
    * Get more help at https://help.gradle.org
    
    BUILD FAILED in 14s
    197 actionable tasks: 15 executed, 182 up-to-date
    
    1. 恢复 \watch\libs\alibaba-alipaySingle-20170510.jar 包
      再将这个\watch\libs\alibaba-alipaySingle-20170510.jar 包 还原
    在这里插入图片描述

    这样就编译通过了。

    在这里插入图片描述
    在这里插入图片描述

    作者:欧阳鹏 欢迎转载,与人分享是进步的源泉!
    转载请保留原文地址:https://blog.csdn.net/qq446282412/article/details/83620837
    如果本文对您有所帮助,欢迎您扫码下图所示的支付宝和微信支付二维码对本文进行打赏。

    在这里插入图片描述

    相关文章

      网友评论

          本文标题:【我的Android进阶之旅】编译出现错误:Caused by:

          本文链接:https://www.haomeiwen.com/subject/tlkacqtx.html