Closed MisterRager closed 7 years ago
I see that you are using Robolectric. Are you sure that this is not related to this (because robolectric provides an implementation of android.jar but it may not be suitable in that particular test).
This also shows up in the designer view - no Robolectric there. I think I have an idea on how to fix it. PR imminent...
I can't seem to test this. When I use debug builds of the library, I can't get the client app to crash, but I can't seem to even use the aar from release builds. @moagrius what is the setup you use for building the actual lib?
This is the fix I'm trying to find a way to test:
https://github.com/moagrius/TileView/compare/master...MisterRager:compile-with-1.8-support
Another oddity: when I run the test with the -noverify
flag, this is the error:
https://github.com/robolectric/robolectric-gradle-plugin/issues/145
i've never tried with java 8. i don't do anything special to build in AS, but i do publish the artifacts using a gradle task, based off this: https://raw.githubusercontent.com/blundell/release-android-library/master/android-release-aar.gradle
does that help?
i'm going to close this since Jack is being abandoned by google
Opened a pull request: https://github.com/moagrius/TileView/pull/407
Also, the library is incompatible with the preview desugar that Google is using for JDK 8 support going forward. My intuition says "yes" since the bytecode produced by proguard will be incompatible with the runtime doing the dexing.
Granted, this is Java 8 in the build toolchain, not Java 8 in the actual project.
I can't seem to compile, still, and javap -v com/qozix/tileview/widgets/ZoomPanLayout
on the decompressed classes.jar
I obtain form bintray shows no stackmap frames as well as bytecode version 0x51
(JDK 7).
@moagrius I think bintray might not update the artifacts w/o a version bump. Could you possibly throw me the .aar
file for the release you sent out so I can see whether the settings took effect on your build?
Desugar bug: https://issuetracker.google.com/issues/37909288
yeah i have to manually upload to bintray - i'll try to do it tonight
i'm getting errors when building master (for the release):
:demo:transformClassesWithDexForDebug
Running dex in-process requires build tools 23.0.2.
For faster builds update this project to use the latest build tools.
Dex: Error converting bytecode to dex:
Cause: Dex cannot parse version 52 byte code.
This is caused by library dependencies that have been compiled using Java 8 or above.
If you are using the 'java' gradle plugin in a library submodule add
targetCompatibility = '1.7'
sourceCompatibility = '1.7'
to that submodule's build.gradle file.
UNEXPECTED TOP-LEVEL EXCEPTION:
com.android.dx.cf.iface.ParseException: bad class file magic (cafebabe) or version (0034.0000)
at com.android.dx.cf.direct.DirectClassFile.parse0(DirectClassFile.java:472)
at com.android.dx.cf.direct.DirectClassFile.parse(DirectClassFile.java:406)
at com.android.dx.cf.direct.DirectClassFile.parseToInterfacesIfNecessary(DirectClassFile.java:388)
at com.android.dx.cf.direct.DirectClassFile.getMagic(DirectClassFile.java:251)
at com.android.dx.command.dexer.Main.processClass(Main.java:704)
at com.android.dx.command.dexer.Main.processFileBytes(Main.java:673)
at com.android.dx.command.dexer.Main.access$300(Main.java:83)
at com.android.dx.command.dexer.Main$1.processFileBytes(Main.java:602)
at com.android.dx.cf.direct.ClassPathOpener.processArchive(ClassPathOpener.java:284)
at com.android.dx.cf.direct.ClassPathOpener.processOne(ClassPathOpener.java:166)
at com.android.dx.cf.direct.ClassPathOpener.process(ClassPathOpener.java:144)
at com.android.dx.command.dexer.Main.processOne(Main.java:632)
at com.android.dx.command.dexer.Main.processAllFiles(Main.java:510)
at com.android.dx.command.dexer.Main.runMonoDex(Main.java:280)
at com.android.dx.command.dexer.Main.run(Main.java:246)
at com.android.dx.command.dexer.Main.main(Main.java:215)
at com.android.dx.command.Main.main(Main.java:106)
...while parsing com/qozix/tileview/BuildConfig.class
1 error; aborting
:demo:transformClassesWithDexForDebug FAILED
FAILURE: Build failed with an exception.
I remember we tried to move to Java 8 at work and finally rolled it back because A) it created a ton of hassle, and B) Jack has been abandoned by Google
Does this change require Java 8?
Let me try to get an environment with JDK 7 - I wasn't able to test on my dev laptop because Ubuntu dropped the package.
Here's a test project to demonstrate the errors with the new desugar tool: https://github.com/MisterRager/TestDesugarJdk7Libs
so this change won't work with 7?
Hi, Android plugin for Gradle dev here. The issue with the StackMapTable is due to usage of -dontpreverify
flag, which got added to the build.gradle of 2.2.6 tileview library:
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
The issue is that the default Proguard settings in the plugin contain this flag. We are tracking this issue https://issuetracker.google.com/issues/37137716.
To publish a version that contains a valid StackMapTable, you don't have to specify -target 8
in you Proguard rules (this would make it incompatible with projects which do not use Desugar). Just avoid including the default, proguard-android.txt
, in the build until we resolve the issue.
Thanks!
@gavra0 thanks for the info. @MisterRager have you got it from here?
@gavra0 thanks for chiming in. @moagrius PR opened - see that for more info #412
I have a test failure related to how the library is compiled when using Java 8/JACK: