-
Notifications
You must be signed in to change notification settings - Fork 227
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
Using obfuscated dependency results in "java finished with non-zero exit value 1" #124
Comments
I experimented a bit more with this. Seems like the issue can be worked around if I extract the code triggering the error into a private class. So, instead of
I can write:
and it starts working. |
I think the error is caused by any conditional evaluation in MyLibService. E.g. this variant also reproduces it:
If I remove the |
Here is the debug log from running gradle.
Relevant parts of the output of
There is a stack map table in the method that the exception mentions, so I'm confused. Otherwise it smells like issue #25 |
Ah, found it. The file
|
In summary, this is the same issue as #25. The workaround is to add |
Please try configuring Retrolambda to produce Java 6 bytecode. I added the following lines to
|
Now that I read your message better, I see you don't need Retrolambda in the published library. So just configuring gradle to compile it as Java 6 should fix it. I managed to compile the sample project by configuring sourceCompatibility and targetCompatibility in
|
The library uses some Java 7 language features, so I ended up adding retrolambda to it, with sourceCompatibility and targetCompatibility set to Java 7. Thank you for helping. By the way, Proguard seems to have a StackMapTable attribute that I can tell it to keep. It doesn't seem to affect the error though. Do you think it's a proguard bug? |
Short version:
I created a minimal self-contained Gradle project that reproduces the issue: RetrolambdaTest.zip
Please run
./gradlew clean :app:assembleRelease
in the project directory. It will fail with:Slightly longer version:
I'm developing a closed source Android library that I'm obfuscating using proguard before uploading it to Maven. The library is using Java 6 syntax, so no retrolambda.
When I try to use this library in my app (using retrolambda, gradle-retrolambda and Java 8 syntax), I get the aforementioned error. The app itself is not proguarded, only the library.
If I include a non-obfuscated version of my library in the app, it works fine.
If I include
-noverify
in my JVM args as mentioned in #25, it also works fine, but I'm not exactly comfortable with this solution.I tried to narrow down the exact cause of the error. I've found that those few lines of code in the test project are necessary to reproduce it. In particular, please take a look at the MyLibService and TestService classes. It turned out to not matter whether the obfuscated library comes from Maven or just another gradle module, so in the test project, it's in the
lib
module.The text was updated successfully, but these errors were encountered: