Cannot build after upgrading to 3.0


(Patrik Öhlin) #1

Hello,

After upgrading to Android Studios 3.0 I can no longer compile my application. I’m receiving the following error and I cannot find any similar case anywhere.

Executing tasks: [:app:assembleDebug]

Parallel execution is an incubating feature.
Configuration ‘compile’ in project ‘:app’ is deprecated. Use ‘implementation’ instead.
Configuration ‘testCompile’ in project ‘:app’ is deprecated. Use ‘testImplementation’ instead.
:app:buildInfoDebugLoader
:app:preBuild UP-TO-DATE
:app:preDebugBuild UP-TO-DATE
:app:compileDebugAidl UP-TO-DATE
:app:compileDebugRenderscript UP-TO-DATE
:app:checkDebugManifest UP-TO-DATE
:app:generateDebugBuildConfig UP-TO-DATE
:app:prepareLintJar UP-TO-DATE
:app:generateDebugResValues UP-TO-DATE
:app:generateDebugResources UP-TO-DATE
:app:mergeDebugResources UP-TO-DATE
:app:createDebugCompatibleScreenManifests UP-TO-DATE
:app:processDebugManifest
:app:splitsDiscoveryTaskDebug UP-TO-DATE
:app:processDebugResources
:app:generateDebugSources
:app:javaPreCompileDebug
:app:compileDebugJavaWithJavac
Note: Some input files use or override a deprecated API.
Note: Recompile with -Xlint:deprecation for details.

:app:mergeDebugShaders
:app:compileDebugShaders
:app:generateDebugAssets
:app:mergeDebugAssets
:app:packageInstantRunResourcesDebug
:app:checkManifestChangesDebug
:app:transformClassesWithStackFramesFixerForDebug
:app:transformClassesWithDesugarForDebug
Exception in thread “main” java.lang.IllegalStateException: Couldn’t desugar invokedynamic for android/view/accessibility/AccessibilityManager.run using java/lang/invoke/LambdaMetafactory.metafactory(Ljava/lang/invoke/MethodHandles$Lookup;Ljava/lang/String;Ljava/lang/invoke/MethodType;Ljava/lang/invoke/MethodType;Ljava/lang/invoke/MethodHandle;Ljava/lang/invoke/MethodType;)Ljava/lang/invoke/CallSite; (6) with arguments [()V, android/view/accessibility/AccessibilityManager.lambda$notifyAccessibilityStateChanged$0(Landroid/view/accessibility/AccessibilityManager$AccessibilityStateChangeListener;Z)V (6), ()V]
at com.google.devtools.build.android.desugar.LambdaDesugaring$InvokedynamicRewriter.visitInvokeDynamicInsn(LambdaDesugaring.java:467)
at org.objectweb.asm.ClassReader.a(Unknown Source)
at org.objectweb.asm.ClassReader.b(Unknown Source)
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)
Caused by: java.lang.NoSuchMethodException: no such method: android.view.accessibility.AccessibilityManager.lambda$notifyAccessibilityStateChanged$0(AccessibilityStateChangeListener,boolean)void/invokeStatic
at java.lang.invoke.MemberName.makeAccessException(MemberName.java:871)
at java.lang.invoke.MemberName$Factory.resolveOrFail(MemberName.java:1003)
at java.lang.invoke.MethodHandles$Lookup.resolveOrFail(MethodHandles.java:1386)
at java.lang.invoke.MethodHandles$Lookup.findStatic(MethodHandles.java:780)
at com.google.devtools.build.android.desugar.LambdaDesugaring$InvokedynamicRewriter.toMethodHandle(LambdaDesugaring.java:604)
at com.google.devtools.build.android.desugar.LambdaDesugaring$InvokedynamicRewriter.toJvmMetatype(LambdaDesugaring.java:586)
at com.google.devtools.build.android.desugar.LambdaDesugaring$InvokedynamicRewriter.visitInvokeDynamicInsn(LambdaDesugaring.java:401)
… 8 more
Caused by: java.lang.NoSuchFieldError: method resolution failed
at java.lang.invoke.MethodHandleNatives.resolve(Native Method)
at java.lang.invoke.MemberName$Factory.resolve(MemberName.java:975)
at java.lang.invoke.MemberName$Factory.resolveOrFail(MemberName.java:1000)
… 13 more

FAILED
:app:buildInfoGeneratorDebug

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 {–input D:\GitHub\sony\rat-test-app\app\build\intermediates\transforms\stackFramesFixer\debug\5.jar --output D:\GitHub\sony\rat-test-app\app\build\intermediates\transforms\desugar\debug\6.jar --input D:\GitHub\sony\rat-test-app\app\build\intermediates\transforms\stackFramesFixer\debug\0.jar --output D:\GitHub\sony\rat-test-app\app\build\intermediates\transforms\desugar\debug\1.jar --input D:\GitHub\sony\rat-test-app\app\build\intermediates\transforms\stackFramesFixer\debug\15.jar --output D:\GitHub\sony\rat-test-app\app\build\intermediates\transforms\desugar\debug\16.jar --classpath_entry D:\GitHub\sony\rat-test-app\app\build\intermediates\classes\debug --classpath_entry D:\GitHub\sony\rat-test-app\app\build\intermediates\transforms\stackFramesFixer\debug\0.jar --classpath_entry D:\GitHub\sony\rat-test-app\app\build\intermediates\transforms\stackFramesFixer\debug\1.jar --classpath_entry D:\GitHub\sony\rat-test-app\app\build\intermediates\transforms\stackFramesFixer\debug\2.jar --classpath_entry D:\GitHub\sony\rat-test-app\app\build\intermediates\transforms\stackFramesFixer\debug\3.jar --classpath_entry D:\GitHub\sony\rat-test-app\app\build\intermediates\transforms\stackFramesFixer\debug\4.jar --classpath_entry D:\GitHub\sony\rat-test-app\app\build\intermediates\transforms\stackFramesFixer\debug\5.jar --classpath_entry D:\GitHub\sony\rat-test-app\app\build\intermediates\transforms\stackFramesFixer\debug\6.jar --classpath_entry D:\GitHub\sony\rat-test-app\app\build\intermediates\transforms\stackFramesFixer\debug\7.jar --classpath_entry D:\GitHub\sony\rat-test-app\app\build\intermediates\transforms\stackFramesFixer\debug\8.jar --classpath_entry D:\GitHub\sony\rat-test-app\app\build\intermediates\transforms\stackFramesFixer\debug\9.jar --classpath_entry D:\GitHub\sony\rat-test-app\app\build\intermediates\transforms\stackFramesFixer\debug\10.jar --classpath_entry D:\GitHub\sony\rat-test-app\app\build\intermediates\transforms\stackFramesFixer\debug\11.jar --classpath_entry D:\GitHub\sony\rat-test-app\app\build\intermediates\transforms\stackFramesFixer\debug\12.jar --classpath_entry D:\GitHub\sony\rat-test-app\app\build\intermediates\transforms\stackFramesFixer\debug\13.jar --classpath_entry D:\GitHub\sony\rat-test-app\app\build\intermediates\transforms\stackFramesFixer\debug\14.jar --classpath_entry D:\GitHub\sony\rat-test-app\app\build\intermediates\transforms\stackFramesFixer\debug\15.jar --classpath_entry D:\GitHub\sony\rat-test-app\app\build\intermediates\transforms\stackFramesFixer\debug\16.jar --classpath_entry D:\GitHub\sony\rat-test-app\app\build\intermediates\transforms\stackFramesFixer\debug\17.jar --classpath_entry D:\GitHub\sony\rat-test-app\app\build\intermediates\transforms\stackFramesFixer\debug\18.jar --classpath_entry D:\GitHub\sony\rat-test-app\app\build\intermediates\transforms\stackFramesFixer\debug\19.jar --bootclasspath_entry C:\Users\23060884\AppData\Local\Android\Sdk\platforms\android-27\android.jar --bootclasspath_entry C:\Users\23060884\AppData\Local\Android\Sdk\platforms\android-27\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 24 --nodesugar_try_with_resources_if_needed --desugar_try_with_resources_omit_runtime_classes}

  • 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 29s

23 actionable tasks: 13 executed, 10 up-to-date

Logs with stacktrace: https://pastebin.com/DBG1JF6t
Logs with info: https://pastebin.com/ij4k0jD8


(Patrik Öhlin) #2

If anyone else have this problem it was “resolved” by downgrading com.android.tools.build:gradle from 3.0.1 to 2.3.3 in the build.gradle file.


(Gauri Gadkari) #3

I had the same issue on Android studio 3.1 and I got it to work just by rebuilding the project


(Igor Torba) #4

I have the same issue with Android Studio 3.1.2 and gradle plugin ‘com.android.tools.build:gradle:3.1.2’
I have the aar that use RxJava under the hood and when I try to build project that using this aar I get exception
`Exception in thread “main” java.lang.TypeNotPresentException: Type io.reactivex.functions.Consumer not present
at sun.invoke.util.BytecodeDescriptor.parseSig(BytecodeDescriptor.java:85)
at sun.invoke.util.BytecodeDescriptor.parseMethod(BytecodeDescriptor.java:63)
at sun.invoke.util.BytecodeDescriptor.parseMethod(BytecodeDescriptor.java:41)
at java.lang.invoke.MethodType.fromMethodDescriptorString(MethodType.java:1067)
at com.google.devtools.build.android.desugar.LambdaDesugaring$InvokedynamicRewriter.visitInvokeDynamicInsn(LambdaDesugaring.java:406)
at org.objectweb.asm.ClassReader.readCode(ClassReader.java:1623)
at org.objectweb.asm.ClassReader.readMethod(ClassReader.java:1126)
at org.objectweb.asm.ClassReader.accept(ClassReader.java:698)
at org.objectweb.asm.ClassReader.accept(ClassReader.java:500)
at com.google.devtools.build.android.desugar.Desugar.desugarClassesInInput(Desugar.java:477)
at com.google.devtools.build.android.desugar.Desugar.desugarOneInput(Desugar.java:361)
at com.google.devtools.build.android.desugar.Desugar.desugar(Desugar.java:314)
at com.google.devtools.build.android.desugar.Desugar.main(Desugar.java:711)
Caused by: java.lang.ClassNotFoundException: Class io.reactivex.functions.Consumer not found
at com.google.devtools.build.android.desugar.HeaderClassLoader.findClass(HeaderClassLoader.java:53)
at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
at sun.invoke.util.BytecodeDescriptor.parseSig(BytecodeDescriptor.java:83)

  • 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 {–input /Users/itorba/CopyOfAlerting/useSdkV1/app/build/intermediates/transforms/stackFramesFixer/debug/26.jar --output /Users/itorba/CopyOfAlerting/useSdkV1/app/build/intermediates/transforms/desugar/debug/28.jar --input /Users/itorba/CopyOfAlerting/useSdkV1/app/build/intermediates/transforms/stackFramesFixer/debug/11.jar --output /Users/itorba/CopyOfAlerting/useSdkV1/app/build/intermediates/transforms/desugar/debug/13.jar --input /Users/itorba/CopyOfAlerting/useSdkV1/app/build/intermediates/transforms/stackFramesFixer/debug/21.jar --output /Users/itorba/CopyOfAlerting/useSdkV1/app/build/intermediates/transforms/desugar/debug/23.jar --input /Users/itorba/.gradle/caches/transforms-1/files-1.1/alertsdk-debug.aar/b696d025dd974916506809350a8f7dd9/jars/classes.jar --output /Users/itorba/CopyOfAlerting/useSdkV1/app/build/intermediates/transforms/desugar/debug/0.jar --input /Users/itorba/CopyOfAlerting/useSdkV1/app/build/intermediates/transforms/stackFramesFixer/debug/22.jar --output /Users/itorba/CopyOfAlerting/useSdkV1/app/build/intermediates/transforms/desugar/debug/24.jar --input /Users/itorba/CopyOfAlerting/useSdkV1/app/build/intermediates/transforms/stackFramesFixer/debug/10.jar --output /Users/itorba/CopyOfAlerting/useSdkV1/app/build/intermediates/transforms/desugar/debug/12.jar --input /Users/itorba/CopyOfAlerting/useSdkV1/app/build/intermediates/transforms/stackFramesFixer/debug/15.jar --output /Users/itorba/CopyOfAlerting/useSdkV1/app/build/intermediates/transforms/desugar/debug/17.jar --input /Users/itorba/CopyOfAlerting/useSdkV1/app/build/intermediates/transforms/stackFramesFixer/debug/28.jar --output /Users/itorba/CopyOfAlerting/useSdkV1/app/build/intermediates/transforms/desugar/debug/30.jar --input /Users/itorba/CopyOfAlerting/useSdkV1/app/build/intermediates/transforms/stackFramesFixer/debug/14.jar --output /Users/itorba/CopyOfAlerting/useSdkV1/app/build/intermediates/transforms/desugar/debug/16.jar --input /Users/itorba/CopyOfAlerting/useSdkV1/app/build/intermediates/transforms/stackFramesFixer/debug/17.jar --output /Users/itorba/CopyOfAlerting/useSdkV1/app/build/intermediates/transforms/desugar/debug/19.jar --input /Users/itorba/CopyOfAlerting/useSdkV1/app/build/intermediates/transforms/stackFramesFixer/debug/29.jar --output /Users/itorba/CopyOfAlerting/useSdkV1/app/build/intermediates/transforms/desugar/debug/31.jar --classpath_entry /Users/itorba/.gradle/caches/transforms-1/files-1.1/alertsdk-debug.aar/b696d025dd974916506809350a8f7dd9/jars/classes.jar --classpath_entry /Users/itorba/CopyOfAlerting/useSdkV1/app/build/intermediates/classes/debug --classpath_entry /Users/itorba/CopyOfAlerting/useSdkV1/app/build/intermediates/transforms/stackFramesFixer/debug/0.jar --classpath_entry /Users/itorba/CopyOfAlerting/useSdkV1/app/build/intermediates/transforms/stackFramesFixer/debug/1.jar --classpath_entry /Users/itorba/CopyOfAlerting/useSdkV1/app/build/intermediates/transforms/stackFramesFixer/debug/2.jar --classpath_entry /Users/itorba/CopyOfAlerting/useSdkV1/app/build/intermediates/transforms/stackFramesFixer/debug/3.jar --classpath_entry /Users/itorba/CopyOfAlerting/useSdkV1/app/build/intermediates/transforms/stackFramesFixer/debug/4.jar --classpath_entry /Users/itorba/CopyOfAlerting/useSdkV1/app/build/intermediates/transforms/stackFramesFixer/debug/5.jar --classpath_entry /Users/itorba/CopyOfAlerting/useSdkV1/app/build/intermediates/transforms/stackFramesFixer/debug/6.jar --classpath_entry /Users/itorba/CopyOfAlerting/useSdkV1/app/build/intermediates/transforms/stackFramesFixer/debug/7.jar --classpath_entry /Users/itorba/CopyOfAlerting/useSdkV1/app/build/intermediates/transforms/stackFramesFixer/debug/8.jar --classpath_entry /Users/itorba/CopyOfAlerting/useSdkV1/app/build/intermediates/transforms/stackFramesFixer/debug/9.jar --classpath_entry /Users/itorba/CopyOfAlerting/useSdkV1/app/build/intermediates/transforms/stackFramesFixer/debug/10.jar --classpath_entry /Users/itorba/CopyOfAlerting/useSdkV1/app/build/intermediates/transforms/stackFramesFixer/debug/11.jar --classpath_entry /Users/itorba/CopyOfAlerting/useSdkV1/app/build/intermediates/transforms/stackFramesFixer/debug/12.jar --classpath_entry /Users/itorba/CopyOfAlerting/useSdkV1/app/build/intermediates/transforms/stackFramesFixer/debug/13.jar --classpath_entry /Users/itorba/CopyOfAlerting/useSdkV1/app/build/intermediates/transforms/stackFramesFixer/debug/14.jar --classpath_entry /Users/itorba/CopyOfAlerting/useSdkV1/app/build/intermediates/transforms/stackFramesFixer/debug/15.jar --classpath_entry /Users/itorba/CopyOfAlerting/useSdkV1/app/build/intermediates/transforms/stackFramesFixer/debug/16.jar --classpath_entry /Users/itorba/CopyOfAlerting/useSdkV1/app/build/intermediates/transforms/stackFramesFixer/debug/17.jar --classpath_entry /Users/itorba/CopyOfAlerting/useSdkV1/app/build/intermediates/transforms/stackFramesFixer/debug/18.jar --classpath_entry /Users/itorba/CopyOfAlerting/useSdkV1/app/build/intermediates/transforms/stackFramesFixer/debug/19.jar --classpath_entry /Users/itorba/CopyOfAlerting/useSdkV1/app/build/intermediates/transforms/stackFramesFixer/debug/20.jar --classpath_entry /Users/itorba/CopyOfAlerting/useSdkV1/app/build/intermediates/transforms/stackFramesFixer/debug/21.jar --classpath_entry /Users/itorba/CopyOfAlerting/useSdkV1/app/build/intermediates/transforms/stackFramesFixer/debug/22.jar --classpath_entry /Users/itorba/CopyOfAlerting/useSdkV1/app/build/intermediates/transforms/stackFramesFixer/debug/23.jar --classpath_entry /Users/itorba/CopyOfAlerting/useSdkV1/app/build/intermediates/transforms/stackFramesFixer/debug/24.jar --classpath_entry /Users/itorba/CopyOfAlerting/useSdkV1/app/build/intermediates/transforms/stackFramesFixer/debug/25.jar --classpath_entry /Users/itorba/CopyOfAlerting/useSdkV1/app/build/intermediates/transforms/stackFramesFixer/debug/26.jar --classpath_entry /Users/itorba/CopyOfAlerting/useSdkV1/app/build/intermediates/transforms/stackFramesFixer/debug/27.jar --classpath_entry /Users/itorba/CopyOfAlerting/useSdkV1/app/build/intermediates/transforms/stackFramesFixer/debug/28.jar --classpath_entry /Users/itorba/CopyOfAlerting/useSdkV1/app/build/intermediates/transforms/stackFramesFixer/debug/29.jar --classpath_entry /Users/itorba/CopyOfAlerting/useSdkV1/app/build/intermediates/transforms/stackFramesFixer/debug/30.jar --bootclasspath_entry /Users/itorba/Library/Android/sdk/platforms/android-27/android.jar --bootclasspath_entry /Users/itorba/Library/Android/sdk/platforms/android-27/optional/org.apache.http.legacy.jar --bootclasspath_entry /Applications/Android Studio.app/Contents/jre/jdk/Contents/Home/jre/lib/resources.jar --bootclasspath_entry /Applications/Android Studio.app/Contents/jre/jdk/Contents/Home/jre/lib/rt.jar --bootclasspath_entry /Applications/Android Studio.app/Contents/jre/jdk/Contents/Home/jre/lib/jsse.jar --bootclasspath_entry /Applications/Android Studio.app/Contents/jre/jdk/Contents/Home/jre/lib/jce.jar --bootclasspath_entry /Applications/Android Studio.app/Contents/jre/jdk/Contents/Home/jre/lib/charsets.jar --min_sdk_version 14 --desugar_try_with_resources_if_needed --desugar_try_with_resources_omit_runtime_classes --legacy_jacoco_fix}
`