当前位置: 首页 > 知识库问答 >
问题:

任务“:app:TransformClassesWithDesugarForDebug”执行失败

仲孙兴旺
2023-03-14

我刚刚更新了我的cordova android到7.1.0,以支持Android27 sdk,以解决插件不能与SDK26一起工作的问题。

我尝试更改GradleBuilder.js文件中的gradle分发url,但没有成功。

编辑2:我想解决这个问题的firebase插件似乎是问题的一部分。移除:cordova-plugin-firebase允许应用程序的构建没有问题。似乎在添加插件后,我不能简单地用:ionic cordova plugin remove cordova-plugin-firebase删除它

它给出了以下错误:

missing file :: app/src/main
Error during processing of action! Attempting to revert...

(node:11396) UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 1): Error: Uh oh!
ENOENT: no such file or directory, open 'C:\Users\Boogaloo\WebstormProjects\IONIC\programs\myApp\platforms\android\AndroidManifest.xml'

编辑3:该问题可能是Firebase插件和对讲机插件之间的冲突https://github.com/arnesson/cordova-plugin-firebase https://github.com/Intercom/intercom-cordova

任务“:App:TransformClassesWithDesugarForDebug”执行失败。

>

  • try:使用--stacktrace选项运行以获取堆栈跟踪。使用--info或--debug选项运行以获得更多日志输出。

    在https://help.gradle.org获得更多帮助

    在cildprocess.whendone(C:\users\boogaloo\webstormprojects\ionic\test\platforms\android\cordova\node_modules\cordova-common\src\superspawn.js:169:23)在emitTwo(events.js:126:13)在childprocess.emit(events.js:214:7)在maybeclos(internal/child_process.js:925:16)在process.childprocess.js:209:5)在此错误源于在没有catch块的情况下抛出异步函数,或者拒绝未使用.catch()处理的promise。(拒绝ID:1)(节点:11324)[DEP0018]DeprecationWarning:拒绝未处理的promise。将来,未处理的promise拒绝将使用非零退出代码终止Node.js进程。

    原始错误:

     :app:transformClassesWithDesugarForDebug
    Exception in thread "main" java.lang.IllegalArgumentException
            at com.google.common.base.Preconditions.checkArgument(Preconditions.java:108)
            at com.google.devtools.build.android.desugar.DefaultMethodClassFixer$DefaultMethodFinder.visit(DefaultMethodClassFixer.java:471)
            at org.objectweb.asm.ClassReader.accept(Unknown Source)
            at org.objectweb.asm.ClassReader.accept(Unknown Source)
            at com.google.devtools.build.android.desugar.DefaultMethodClassFixer.defaultMethodsDefined(DefaultMethodClassFixer.java:319)
            at com.google.devtools.build.android.desugar.DefaultMethodClassFixer.visitEnd(DefaultMethodClassFixer.java:88)
            at org.objectweb.asm.ClassVisitor.visitEnd(Unknown Source)
            at com.google.devtools.build.android.desugar.InterfaceDesugaring.visitEnd(InterfaceDesugaring.java:85)
            at org.objectweb.asm.ClassVisitor.visitEnd(Unknown Source)
            at com.google.devtools.build.android.desugar.LambdaDesugaring.visitEnd(LambdaDesugaring.java:150)
            at org.objectweb.asm.ClassReader.accept(Unknown Source)
            at org.objectweb.asm.ClassReader.accept(Unknown Source)
            at com.google.devtools.build.android.desugar.Desugar.desugarClassesInInput(Desugar.java:401)
            at com.google.devtools.build.android.desugar.Desugar.desugarOneInput(Desugar.java:326)
            at com.google.devtools.build.android.desugar.Desugar.desugar(Desugar.java:280)
            at com.google.devtools.build.android.desugar.Desugar.main(Desugar.java:584)
    
    Exception in thread "main" java.lang.IllegalArgumentException
            at com.google.common.base.Preconditions.checkArgument(Preconditions.java:108)
            at com.google.devtools.build.android.desugar.DefaultMethodClassFixer$DefaultMethodFinder.visit(DefaultMethodClassFixer.java:471)
            at org.objectweb.asm.ClassReader.accept(Unknown Source)
            at org.objectweb.asm.ClassReader.accept(Unknown Source)
            at com.google.devtools.build.android.desugar.DefaultMethodClassFixer.defaultMethodsDefined(DefaultMethodClassFixer.java:319)
            at com.google.devtools.build.android.desugar.DefaultMethodClassFixer.visitEnd(DefaultMethodClassFixer.java:88)
            at org.objectweb.asm.ClassVisitor.visitEnd(Unknown Source)
            at com.google.devtools.build.android.desugar.InterfaceDesugaring.visitEnd(InterfaceDesugaring.java:85)
            at org.objectweb.asm.ClassVisitor.visitEnd(Unknown Source)
            at com.google.devtools.build.android.desugar.LambdaDesugaring.visitEnd(LambdaDesugaring.java:150)
            at org.objectweb.asm.ClassReader.accept(Unknown Source)
            at org.objectweb.asm.ClassReader.accept(Unknown Source)
            at com.google.devtools.build.android.desugar.Desugar.desugarClassesInInput(Desugar.java:401)
            at com.google.devtools.build.android.desugar.Desugar.desugarOneInput(Desugar.java:326)
            at com.google.devtools.build.android.desugar.Desugar.desugar(Desugar.java:280)
            at com.google.devtools.build.android.desugar.Desugar.main(Desugar.java:584)
    
     FAILED
    
    FAILURE: Build failed with an exception.
    
    * What went wrong:
    Execution failed for task ':app:transformClassesWithDesugarForDebug'.
    > 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 {@C:\Users\Baron\WebstormProjects\IONIC\Projects\myApp\platforms\android\app\build\intermediates\tmp\desugar_args601386030457091935}
    
    * 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 9s
    35 actionable tasks: 2 executed, 33 up-to-date
    (node:13116) UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 1): Error: cmd: Command failed with exit code 1 Error output:
    Exception in thread "main" java.lang.IllegalArgumentException
            at com.google.common.base.Preconditions.checkArgument(Preconditions.java:108)
            at com.google.devtools.build.android.desugar.DefaultMethodClassFixer$DefaultMethodFinder.visit(DefaultMethodClassFixer.java:471)
            at org.objectweb.asm.ClassReader.accept(Unknown Source)
            at org.objectweb.asm.ClassReader.accept(Unknown Source)
            at com.google.devtools.build.android.desugar.DefaultMethodClassFixer.defaultMethodsDefined(DefaultMethodClassFixer.java:319)
            at com.google.devtools.build.android.desugar.DefaultMethodClassFixer.visitEnd(DefaultMethodClassFixer.java:88)
            at org.objectweb.asm.ClassVisitor.visitEnd(Unknown Source)
            at com.google.devtools.build.android.desugar.InterfaceDesugaring.visitEnd(InterfaceDesugaring.java:85)
            at org.objectweb.asm.ClassVisitor.visitEnd(Unknown Source)
            at com.google.devtools.build.android.desugar.LambdaDesugaring.visitEnd(LambdaDesugaring.java:150)
            at org.objectweb.asm.ClassReader.accept(Unknown Source)
            at org.objectweb.asm.ClassReader.accept(Unknown Source)
            at com.google.devtools.build.android.desugar.Desugar.desugarClassesInInput(Desugar.java:401)
            at com.google.devtools.build.android.desugar.Desugar.desugarOneInput(Desugar.java:326)
            at com.google.devtools.build.android.desugar.Desugar.desugar(Desugar.java:280)
            at com.google.devtools.build.android.desugar.Desugar.main(Desugar.java:584)
    
    Exception in thread "main" java.lang.IllegalArgumentException
            at com.google.common.base.Preconditions.checkArgument(Preconditions.java:108)
            at com.google.devtools.build.android.desugar.DefaultMethodClassFixer$DefaultMethodFinder.visit(DefaultMethodClassFixer.java:471)
            at org.objectweb.asm.ClassReader.accept(Unknown Source)
            at org.objectweb.asm.ClassReader.accept(Unknown Source)
            at com.google.devtools.build.android.desugar.DefaultMethodClassFixer.defaultMethodsDefined(DefaultMethodClassFixer.java:319)
            at com.google.devtools.build.android.desugar.DefaultMethodClassFixer.visitEnd(DefaultMethodClassFixer.java:88)
            at org.objectweb.asm.ClassVisitor.visitEnd(Unknown Source)
            at com.google.devtools.build.android.desugar.InterfaceDesugaring.visitEnd(InterfaceDesugaring.java:85)
            at org.objectweb.asm.ClassVisitor.visitEnd(Unknown Source)
            at com.google.devtools.build.android.desugar.LambdaDesugaring.visitEnd(LambdaDesugaring.java:150)
            at org.objectweb.asm.ClassReader.accept(Unknown Source)
            at org.objectweb.asm.ClassReader.accept(Unknown Source)
            at com.google.devtools.build.android.desugar.Desugar.desugarClassesInInput(Desugar.java:401)
            at com.google.devtools.build.android.desugar.Desugar.desugarOneInput(Desugar.java:326)
            at com.google.devtools.build.android.desugar.Desugar.desugar(Desugar.java:280)
            at com.google.devtools.build.android.desugar.Desugar.main(Desugar.java:584)
    
    
    FAILURE: Build failed with an exception.
    
    * What went wrong:
    Execution failed for task ':app:transformClassesWithDesugarForDebug'.
    > 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 {@C:\Users\Baron\WebstormProjects\IONIC\Projects\myApp\platforms\android\app\build\intermediates\tmp\desugar_args601386030457091935}
    
    * 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 9s
    
  • 共有1个答案

    黄永怡
    2023-03-14

    问题是不同的插件对同一个库有不同的依赖关系。为了解决这个问题,我必须在build.gradle文件中启用multidex。进行更改的build.gradle文件位于Platforms>Android>App中

    android{
    
      defaultConfig{
    
        multiDexEnabled true
      }
    }
    
     类似资料: