Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Execution failed for task ':blsAndroid:compileRetrolambdaDebug'. #31

Closed
cypressious opened this issue Jul 23, 2014 · 9 comments
Closed

Comments

@cypressious
Copy link
Contributor

My builds fail with the following error:

Execution failed for task ':myModule:compileRetrolambdaDebug'.
> Process 'command 'D:\Program Files\Java\jdk1.8.0_11\bin\java.exe'' finished with non-zero exit value 1

Here's my build.gradle:

apply plugin: 'com.android.application'
apply plugin: 'retrolambda'
apply plugin: 'com.neenbedankt.android-apt'

android {
    signingConfigs {
        release {
            //sign config here
        }
    }

    compileSdkVersion 19
    buildToolsVersion '20.0.0'

    defaultConfig {
        applicationId 'package.name'
        minSdkVersion 9
        targetSdkVersion 19
        versionCode 33
        versionName "2.3 alpha1"

        compileOptions {
            sourceCompatibility JavaVersion.VERSION_1_8
            targetCompatibility JavaVersion.VERSION_1_8
        }

        testApplicationId 'my.package.test'
        testInstrumentationRunner 'android.test.InstrumentationTestRunner'
    }

    lintOptions {
        abortOnError false
    }

    packagingOptions {
        exclude 'META-INF/services/javax.annotation.processing.Processor'
        exclude 'META-INF/LICENSE'
        exclude 'META-INF/LICENSE.txt'
        exclude 'META-INF/NOTICE'
    }
    buildTypes {
        release {
            runProguard true
            proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-project.txt'
            signingConfig signingConfigs.release
        }
    }

    productFlavors {
    }
}

dependencies {
    compile project(':dateTimePicker')
    compile 'com.google.android.gms:play-services:+'
    compile 'com.actionbarsherlock:actionbarsherlock:4.4.0@aar'
    compile 'com.android.support:support-v4:19.1.0'
    compile 'ch.acra:acra:4.5.0'
    compile 'com.google.code.gson:gson:2.2.4'
    compile 'com.squareup.retrofit:retrofit:1.6.1'
    compile 'commons-primitives:commons-primitives:1.0'
    compile 'com.jakewharton:butterknife:5.1.1'
    compile 'com.squareup.dagger:dagger:1.2.0'
    compile 'javax.annotation:jsr250-api:1.0'
    compile 'com.google.auto.factory:auto-factory:0.1-beta1'

    apt 'com.squareup.dagger:dagger-compiler:1.2.0'
    apt 'com.google.auto.factory:auto-factory:0.1-beta1'

    androidTestCompile 'org.mockito:mockito-core:1.9.5'
    androidTestCompile 'com.google.dexmaker:dexmaker:1.1'
    androidTestCompile 'com.google.dexmaker:dexmaker-mockito:1.1'
}

It used to work until some point, but I'm not sure what changed. When I go back to an older revision of my code, the same error appears. I tried cleaning the project with no luck, too.

@cypressious
Copy link
Contributor Author

So here's a stacktrace from the build:

15:54:46.846 [INFO] [system.out] Error! Failed to transform some classes
15:54:46.851 [INFO] [system.out] java.lang.RuntimeException: java.lang.IllegalAccessException: no such method: my.package.android.view.MarkerMapFragment.lambda$init$11(View)void/invokeSpecial
15:54:46.857 [INFO] [system.out]        at net.orfjackal.retrolambda.LambdaReifier.reifyLambdaClass(LambdaReifier.java:42)
15:54:46.862 [INFO] [system.out]        at net.orfjackal.retrolambda.LambdaUsageBackporter$InvokeDynamicInsnConvertingMethodVis
itor.backportLambda(LambdaUsageBackporter.java:165) 
15:54:46.866 [INFO] [system.out]        at net.orfjackal.retrolambda.LambdaUsageBackporter$InvokeDynamicInsnConvertingMethodVis
itor.visitInvokeDynamicInsn(LambdaUsageBackporter.java:154)
15:54:46.870 [INFO] [system.out]        at net.orfjackal.retrolambda.asm.ClassReader.readCode(ClassReader.java:1439)
15:54:46.875 [INFO] [system.out]        at net.orfjackal.retrolambda.asm.ClassReader.readMethod(ClassReader.java:1017)
15:54:46.880 [INFO] [system.out]        at net.orfjackal.retrolambda.asm.ClassReader.accept(ClassReader.java:693)
15:54:46.886 [INFO] [system.out]        at net.orfjackal.retrolambda.asm.ClassReader.accept(ClassReader.java:506)
15:54:46.891 [INFO] [system.out]        at net.orfjackal.retrolambda.LambdaUsageBackporter.transform(LambdaUsageBackporter.java
:22)                                                
15:54:46.896 [INFO] [system.out]        at net.orfjackal.retrolambda.Main$1.transform(Main.java:46)
15:54:46.899 [INFO] [system.out]        at net.orfjackal.retrolambda.BytecodeTransformingFileVisitor.visitFile(BytecodeTransfor
mingFileVisitor.java:25)                            
15:54:46.903 [INFO] [system.out]        at net.orfjackal.retrolambda.BytecodeTransformingFileVisitor.visitFile(BytecodeTransfor
mingFileVisitor.java:11)                            
15:54:46.908 [INFO] [system.out]        at java.nio.file.Files.walkFileTree(Files.java:2667)
15:54:46.914 [INFO] [system.out]        at java.nio.file.Files.walkFileTree(Files.java:2739)
15:54:46.919 [INFO] [system.out]        at net.orfjackal.retrolambda.Main.visitFiles(Main.java:60)
15:54:46.925 [INFO] [system.out]        at net.orfjackal.retrolambda.Main.main(Main.java:43)
15:54:46.929 [INFO] [system.out] Caused by: java.lang.IllegalAccessException: no such method: my.package.android.view.Ma
rkerMapFragment.lambda$init$11(View)void/invokeSpecial
15:54:46.934 [INFO] [system.out]        at java.lang.invoke.MemberName.makeAccessException(MemberName.java:872)
15:54:46.938 [INFO] [system.out]        at java.lang.invoke.MemberName$Factory.resolveOrFail(MemberName.java:993)
15:54:46.943 [INFO] [system.out]        at java.lang.invoke.MethodHandles$Lookup.resolveOrFail(MethodHandles.ja9):137
15:54:46.949 [INFO] [system.out]        at java.lang.invoke.MethodHandles$Lookup.findSpecial(MethodHandles.java:997)
15:54:46.955 [INFO] [system.out]        at net.orfjackal.retrolambda.Types.toMethodHandle(Types.java:42)
15:54:46.961 [INFO] [system.out]        at net.orfjackal.retrolambda.Types.asmToJdkType(Types.java:19)
15:54:46.966 [INFO] [system.out]        at net.orfjackal.retrolambda.LambdaReifier.callBootstrapMethod(LambdaReifier.java:106)
15:54:46.970 [INFO] [system.out]        at net.orfjackal.retrolambda.LambdaReifier.reifyLambdaClass(LambdaReifier.java:37)
15:54:46.974 [INFO] [system.out]        ... 14 more 
15:54:46.978 [INFO] [system.out] Caused by: java.lang.VerifyError: Expecting a stackmap frame at branch target 11
Exception Details:                                  
  Location:
    com/google/android/gms/maps/SupportMapFragment.getMap()Lcom/google/android/gms/maps/GoogleMap; @6: ifnonnull
  Reason:
    Expected stackmap frame at this location.
  Bytecode:
    0000000: 2ab6 0023 4c2b c700 0501 b02b b900 3601
    0000010: 004d a700 0d4e bb00 0c59 2db7 0033 bf2c
    0000020: c700 0501 b02a b400 0ec6 0018 2ab4 000e
    0000030: b600 20b9 0035 0100 2cb9 0035 0100 a500
    0000040: 0f2a bb00 0559 2cb7 001f b500 0e2a b400
    0000050: 0eb0
  Exception Handler Table:
    bci [11, 18] => handler: 21

15:54:46.984 [INFO] [system.out]        at java.lang.invoke.MethodHandleNatives.resolve(Native Method)
15:54:46.990 [INFO] [system.out]        at java.lang.invoke.MemberName$Factory.resolve(MemberName.java:965)
15:54:46.997 [INFO] [system.out]        at java.lang.invoke.MemberName$Factory.resolveOrFail(MemberName.java:990)
15:54:47.003 [INFO] [system.out]        ... 20 more 

When I remove all the lambdas from this particular class, the build finishes successfully.

@evant
Copy link
Owner

evant commented Jul 23, 2014

Looks like retrolambda is failing to process your particular lambda usage in this case. Could you post an example on what you are doing in that class? If this was working previously, you may be able to revert to an older version of retrolambda by doing

dependencies {
  retrolambdaConfig 'net.orfjackal.retrolambda:retrolambda:OLDER_VERSION'
}

@cypressious
Copy link
Contributor Author

I've reduced the crash to a minimal example. You can find it here: https://gist.github.com/cypressious/5ccfe84a31fd836fe125

As it seems, any class that extends Google's SupportMapFragment and uses any lambdas will crash retrolambda. Should I open a new issue on the original project?

@evant
Copy link
Owner

evant commented Jul 23, 2014

Yeah you should do that, I can't think of anything gradle-plugin specific that would cause this.

@cypressious
Copy link
Contributor Author

Ok, here's the issue in case anyone stumbles over this: luontola/retrolambda#25

@cypressious
Copy link
Contributor Author

So the issue was closed over there. Apparently Google's code is to blame. The suggestion is to add the JVM option -noverify. Can this option be added to the gradle plugin?

@luontola
Copy link

A generic method for adding JVM options to gradle-retrolambda would be the best, because it might be dangerous to always use -noverify. And also, adding some custom JVM options might come in handly even in other situations.

@cypressious
Copy link
Contributor Author

This solution would be perfectly fine with me.

@cahyofendhi
Copy link

cahyofendhi commented Jan 26, 2018

i have added -noverify but sttill error, help me please

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants