Fixed
Status Update
Comments
[Deleted User] <[Deleted User]> #2
Thanks for the report Tolriq! Would it be possible for you to upload the APK built with D8 for which this fails? Is it possible to create a small reproduction project so that it is easier for us to reproduce?
[Deleted User] <[Deleted User]> #3
I've attached the bugged APK.
The application is very large and complex I'll try to create a repro app but as it can take a long time, would appreciate if you can confirm that you need it :)
And not fully related but tied to build tools I've reportedhttps://issuetracker.google.com/issues/73534863 that does not seems to be triaged. Maybe I chose a wrong section don't know if you can help to have it seen. As both aapt2 and D8 will become mandatory and both have problem with my app :(
And a thank you to the D8 team, build process with desugaring is quite faster for me :)
The application is very large and complex I'll try to create a repro app but as it can take a long time, would appreciate if you can confirm that you need it :)
And not fully related but tied to build tools I've reported
And a thank you to the D8 team, build process with desugaring is quite faster for me :)
al...@gmail.com <al...@gmail.com> #4
Thank you Tolriq! I'll have a look. Just to make sure I'm looking at the right thing: can you show me the D8 related parts of your gradle.properties when the app works and when the app doesn't work? I would like to figure out if this is related to D8 desugaring or D8 dexing.
jh...@themeetgroup.com <jh...@themeetgroup.com> #5
Gradle.properties that works.
org.gradle.daemon=true
org.gradle.parallel=true
org.gradle.caching=true
org.gradle.configureondemand=true
org.gradle.jvmargs=-Xmx4G
#-XX:MaxPermSize=4G -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8
#Android
android.enableAapt2=false
android.enableBuildCache=true
android.enableD8.desugaring=false
android.enableD8=false
I only tested both D8 and D8.desugaring to true and then it crash. Will try in a few minutes with only D8 true and D8.desugar to false. (But a release build is 8 minutes compilation on a i6850K 64G Ram on an Samsung M2 960 Pro ;)
That part of the code looks like:
JobManager.queueTask(() -> {
if (Device.hasOreoApi()) {
try {
NotificationManager notificationManager = (NotificationManager) getSystemService(Context.NOTIFICATION_SERVICE);
if (notificationManager != null) {
List<NotificationChannel> channels = notificationManager.getNotificationChannels();
Both JobManager and Device are Kotlin objects but the Application is still Java.
org.gradle.daemon=true
org.gradle.parallel=true
org.gradle.caching=true
org.gradle.configureondemand=true
org.gradle.jvmargs=-Xmx4G
#-XX:MaxPermSize=4G -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8
#Android
android.enableAapt2=false
android.enableBuildCache=true
android.enableD8.desugaring=false
android.enableD8=false
I only tested both D8 and D8.desugaring to true and then it crash. Will try in a few minutes with only D8 true and D8.desugar to false. (But a release build is 8 minutes compilation on a i6850K 64G Ram on an Samsung M2 960 Pro ;)
That part of the code looks like:
JobManager.queueTask(() -> {
if (Device.hasOreoApi()) {
try {
NotificationManager notificationManager = (NotificationManager) getSystemService(Context.NOTIFICATION_SERVICE);
if (notificationManager != null) {
List<NotificationChannel> channels = notificationManager.getNotificationChannels();
Both JobManager and Device are Kotlin objects but the Application is still Java.
ag...@gmail.com <ag...@gmail.com> #6
Ok so tested without D8 desugar and fails too.
The error message is a little different:
Process: org.leetzone.android.yatsewidgetfree, PID: 4943
java.lang.VerifyError: Verifier rejected class org.leetzone.android.yatsewidget.b due to bad method void org.leetzone.android.yatsewidget.b.run() (declaration of 'org.leetzone.android.yatsewidget.b' appears in /data/app/org.leetzone.android.yatsewidgetfree-1/base.apk)
at org.leetzone.android.yatsewidget.YatseApplication.onCreate(YatseApplication.java:383)
at android.app.Instrumentation.callApplicationOnCreate(Instrumentation.java:1011)
at android.app.ActivityThread.handleBindApplication(ActivityThread.java:4518)
at android.app.ActivityThread.access$1500(ActivityThread.java:144)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1339)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:135)
at android.app.ActivityThread.main(ActivityThread.java:5221)
at java.lang.reflect.Method.invoke(Native Method)
at java.lang.reflect.Method.invoke(Method.java:372)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:899)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:694)
The b method is the lambda passed to JobManager.queueTask
The error message is a little different:
Process: org.leetzone.android.yatsewidgetfree, PID: 4943
java.lang.VerifyError: Verifier rejected class org.leetzone.android.yatsewidget.b due to bad method void org.leetzone.android.yatsewidget.b.run() (declaration of 'org.leetzone.android.yatsewidget.b' appears in /data/app/org.leetzone.android.yatsewidgetfree-1/base.apk)
at org.leetzone.android.yatsewidget.YatseApplication.onCreate(YatseApplication.java:383)
at android.app.Instrumentation.callApplicationOnCreate(Instrumentation.java:1011)
at android.app.ActivityThread.handleBindApplication(ActivityThread.java:4518)
at android.app.ActivityThread.access$1500(ActivityThread.java:144)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1339)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:135)
at android.app.ActivityThread.main(ActivityThread.java:5221)
at java.lang.reflect.Method.invoke(Native Method)
at java.lang.reflect.Method.invoke(Method.java:372)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:899)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:694)
The b method is the lambda passed to JobManager.queueTask
[Deleted User] <[Deleted User]> #7
Thanks for being some responsive Tolriq, this is a huge help in debugging this. Can you upload the APK that works as well, then I can compare the code that works to the code that doesn't. Maybe that will give me an indication of what is going wrong here.
[Deleted User] <[Deleted User]> #8
I'll do in 2 post to not mix the files.
Here's the apk built with D8 true and D8.desugaring false
The one that works is still compiling, should only have some updated translations and build number as I'll push it to beta track too :)
You should compare this one bugged with the next one unbugged as there's other code changes since the 1st uploaded APK.
Here's the apk built with D8 true and D8.desugaring false
The one that works is still compiling, should only have some updated translations and build number as I'll push it to beta track too :)
You should compare this one bugged with the next one unbugged as there's other code changes since the 1st uploaded APK.
[Deleted User] <[Deleted User]> #9
And here's the APK that does work.
bo...@gmail.com <bo...@gmail.com> #10
Thank you!
ad...@gmail.com <ad...@gmail.com> #11
Hum I've just seen that the previous build is not a beta build, should not impact at all the code that interest you, but this change a BuildConfig so there's much more code change between the 2 than I thought. Hope it's not a problem.
If it is I can trigger a broken beta build to compare.
If it is I can trigger a broken beta build to compare.
gu...@gmail.com <gu...@gmail.com> #12
That is not a problem Tolriq. I think I see what the problem is: it looks like the verifier on these versions of Android is broken and assumes that the register for the receiver is never overwritten. That is unfortunate, but if I can verify that this is the issue I can create a workaround.
[Deleted User] <[Deleted User]> #13
Ok can test anything as I long as you can provide windows compiled things :)
[Deleted User] <[Deleted User]> #14
Great, thank you! I'll update this bug when I have a potential workaround ready for testing. :)
[Deleted User] <[Deleted User]> #15
Tolriq, I have a workaround that I think will fix this. It would be great if you could double-check on your app. I have attached a d8.jar archive. In order to use this version, go to the project build.gradle file and add this d8.jar to the classpath BEFORE the gradle plugin:
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
repositories {
google()
jcenter()
}
dependencies {
classpath files('/usr/local/google/home/ager/ssd/r8/build/libs/d8.jar') // UPDATE TO POINT TO YOUR d8.jar
classpath 'com.android.tools.build:gradle:3.1.0-beta3'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
repositories {
google()
jcenter()
}
dependencies {
classpath files('/usr/local/google/home/ager/ssd/r8/build/libs/d8.jar') // UPDATE TO POINT TO YOUR d8.jar
classpath 'com.android.tools.build:gradle:3.1.0-beta3'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
sp...@gmail.com <sp...@gmail.com> #16
This d8.jar has been modified so that if you watch the text version of the build output you should see "Using: v1.1.7-dev" in the output if the setup has correctly picked up this version of D8.
[Deleted User] <[Deleted User]> #17
It worked on Android 4 and 5 and quickly tested on Android 7.1 still works :) (See generated APK)
Build time was 8m 46s when I remembered it was faster previously when using D8. Maybe there's something else on the computer but worth noticing in case it's a side effect of your changes.
Don't know if your team only works on D8 or whole gradle build time but I'm a great example of slow build times that would love some more improvement :)
Do you have an ETA for this yo go public ? (Just to know if I should include a build with it in this beta cycle or wait for when it's ready).
Build time was 8m 46s when I remembered it was faster previously when using D8. Maybe there's something else on the computer but worth noticing in case it's a side effect of your changes.
Don't know if your team only works on D8 or whole gradle build time but I'm a great example of slow build times that would love some more improvement :)
Do you have an ETA for this yo go public ? (Just to know if I should include a build with it in this beta cycle or wait for when it's ready).
jo...@google.com <jo...@google.com> #18
Another note:
Resulting classes.dex without D8: 9970 classes with 50350 methods and references 62758 methods
With D8: 9954 classe with 51489 methods and references 63724 methods
That's nearly 1000 more references for the same code, not small number :( (Fun part is that size is smaller despite this increase).
Resulting classes.dex without D8: 9970 classes with 50350 methods and references 62758 methods
With D8: 9954 classe with 51489 methods and references 63724 methods
That's nearly 1000 more references for the same code, not small number :( (Fun part is that size is smaller despite this increase).
Description
Problem running multidex apk with annotations, the app crashes with the following exception:
java.lang.AssertionError: annotation value type != return type
at libcore.reflect.AnnotationAccess.toAnnotationInstance(AnnotationAccess.java:649)
at libcore.reflect.AnnotationAccess.toAnnotationInstance(AnnotationAccess.java:641)
at libcore.reflect.AnnotationAccess.getDeclaredAnnotation(AnnotationAccess.java:170)
at libcore.reflect.AnnotationAccess.getAnnotation(AnnotationAccess.java:72)
at java.lang.Class.getAnnotation(Class.java:343)
at org.codehaus.jackson.map.introspect.JacksonAnnotationIntrospector.isHandled(JacksonAnnotationIntrospector.java:45)
at org.codehaus.jackson.map.introspect.AnnotatedClass._collectRelevantAnnotations(AnnotatedClass.java:857)
at org.codehaus.jackson.map.introspect.AnnotatedClass._constructMethod(AnnotatedClass.java:773)
at org.codehaus.jackson.map.introspect.AnnotatedClass._addMemberMethods(AnnotatedClass.java:626)
at org.codehaus.jackson.map.introspect.AnnotatedClass.resolveMemberMethods(AnnotatedClass.java:408)
at org.codehaus.jackson.map.introspect.BasicClassIntrospector.classWithCreators(BasicClassIntrospector.java:185)
at org.codehaus.jackson.map.introspect.BasicClassIntrospector.collectProperties(BasicClassIntrospector.java:157)
at org.codehaus.jackson.map.introspect.BasicClassIntrospector.forDeserialization(BasicClassIntrospector.java:108)
at org.codehaus.jackson.map.introspect.BasicClassIntrospector.forDeserialization(BasicClassIntrospector.java:16)
at org.codehaus.jackson.map.DeserializationConfig.introspect(DeserializationConfig.java:868)
at org.codehaus.jackson.map.deser.BeanDeserializerFactory.createBeanDeserializer(BeanDeserializerFactory.java:587)
at org.codehaus.jackson.map.deser.StdDeserializerProvider._createDeserializer(StdDeserializerProvider.java:401)
at org.codehaus.jackson.map.deser.StdDeserializerProvider._createAndCache2(StdDeserializerProvider.java:310)
at org.codehaus.jackson.map.deser.StdDeserializerProvider._createAndCacheValueDeserializer(StdDeserializerProvider.java:290)
at org.codehaus.jackson.map.deser.StdDeserializerProvider.findValueDeserializer(StdDeserializerProvider.java:159)
at org.codehaus.jackson.map.deser.BasicDeserializerFactory.createCollectionDeserializer(BasicDeserializerFactory.java:284)
at org.codehaus.jackson.map.deser.StdDeserializerProvider._createDeserializer(StdDeserializerProvider.java:389)
at org.codehaus.jackson.map.deser.StdDeserializerProvider._createAndCache2(StdDeserializerProvider.java:310)
at org.codehaus.jackson.map.deser.StdDeserializerProvider._createAndCacheValueDeserializer(StdDeserializerProvider.java:290)
at org.codehaus.jackson.map.deser.StdDeserializerProvider.findValueDeserializer(StdDeserializerProvider.java:159)
at org.codehaus.jackson.map.deser.std.StdDeserializer.findDeserializer(StdDeserializer.java:620)
at org.codehaus.jackson.map.deser.BeanDeserializer.resolve(BeanDeserializer.java:379)
at org.codehaus.jackson.map.deser.StdDeserializerProvider._resolveDeserializer(StdDeserializerProvider.java:407)
at org.codehaus.jackson.map.deser.StdDeserializerProvider._createAndCache2(StdDeserializerProvider.java:352)
at org.codehaus.jackson.map.deser.StdDeserializerProvider._createAndCacheValueDeserializer(StdDeserializerProvider.java:290)
at org.codehaus.jackson.map.deser.StdDeserializerProvider.findValueDeserializer(StdDeserializerProvider.java:159)
at org.codehaus.jackson.map.deser.BasicDeserializerFactory.createCollectionDeserializer(BasicDeserializerFactory.java:284)
at org.codehaus.jackson.map.deser.StdDeserializerProvider._createDeserializer(StdDeserializerProvider.java:389)
at org.codehaus.jackson.map.deser.StdDeserializerProvider._createAndCache2(StdDeserializerProvider.java:310)
at org.codehaus.jackson.map.deser.StdDeserializerProvider._createAndCacheValueDeserializer(StdDeserializerProvider.java:290)
at org.codehaus.jackson.map.deser.StdDeserializerProvider.findValueDeserializer(StdDeserializerProvider.java:159)
at org.codehaus.jackson.map.deser.std.StdDeserializer.findDeserializer(StdDeserializer.java:620)
at org.codehaus.jackson.map.deser.BeanDeserializer.resolve(BeanDeserializer.java:379)
at org.codehaus.jackson.map.deser.StdDeserializerProvider._resolveDeserializer(StdDeserializerProvider.java:407)
at org.codehaus.jackson.map.deser.StdDeserializerProvider._createAndCache2(StdDeserializerProvider.java:352)
at org.codehaus.jackson.map.deser.StdDeserializerProvider._createAndCacheValueDeserializer(StdDeserializerProvider.java:290)
at org.codehaus.jackson.map.deser.StdDeserializerProvider.findValueDeserializer(StdDeserializerProvider.java:159)
at org.codehaus.jackson.map.deser.StdDeserializerProvider.findTypedValueDeserializer(StdDeserializerProvider.java:180)
at org.codehaus.jackson.map.ObjectMapper._findRootDeserializer(ObjectMapper.java:2829)
at org.codehaus.jackson.map.ObjectMapper._readMapAndClose(ObjectMapper.java:2728)
at org.codehaus.jackson.map.ObjectMapper.readValue(ObjectMapper.java:1863)
The following commit is the problem :
Neil Fuller 2014-03-26 16:59:44 +0000 08da684 [diff] [blame] 352. if (reader.getAnnotationType() != annotationClass.getDexTypeIndex()) {
Tested on Samsung s5 with the latest lollipop installed, this is a remote users device.
I am not an expert, but seems that multidex support breaks the annotation type and dex type index checking logic.
the following features are enabled in gradle:
multiDexEnabled true
dexOptions {
javaMaxHeapSize "4g"
jumboMode true
preDexLibraries true
incremental true
}
No code obfuscation is used.