Obsolete
Status Update
Comments
jt...@temp.thunderhead.com <jt...@temp.thunderhead.com> #2
Information redacted by Android Beta Feedback.
rm...@google.com <rm...@google.com> #3
Thank you for reporting this issue. We have shared this with our product and engineering team and will update this issue with more information as it becomes available.
jt...@temp.thunderhead.com <jt...@temp.thunderhead.com> #4
Could you please let me know if without Android Auto
usage and not using com.njm.njmsafedrivego
and com.august.bennu
lessen battery drain?
je...@google.com <je...@google.com>
ga...@google.com <ga...@google.com> #5
jt...@temp.thunderhead.com <jt...@temp.thunderhead.com> #6
Could you please capture a bug report and share it here?
jt...@temp.thunderhead.com <jt...@temp.thunderhead.com> #7
Please provide the requested information to proceed further. Unfortunately the issue will be closed within 7 days if there is no further update.
Description
Android Plugin Version: 3.0.1
Module Compile Sdk Version: 27
Module Build Tools Version: 27.0.3
Android SDK Tools version: 28.0.3
Android Gradle Plugin Configuration using
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
Scenario:
We weave pre compiled Aspects (AspectJ/AJ) into an APK using the Android Gradle Plugin (AGP) transform api. These aspects are compiled and packaged in an AAR which is then included as a dependency for the APK. When source and target compatibility are set to java 1_7 the desugar transform does not occur and no desugaring happens. The AJ transform is then run on the inputs (piped through the AJ toolchain) and the resulting woven code is then packaged into the APK.
Problem:
When target and source compatability are set to java 1_8 the desugar transform occurs before our AJ transform can run. The desugar tool appears to be making optimizations to the class constant pool and removing things it feels are not referenced or needed in our precompiled aspect byte code. This results in an error during the AJ tool process as the precompiled aspects reference the constant pool.
Caused by: org.aspectj.weaver.BCException: malformed org.aspectj.weaver.PointcutDeclaration attribute (length:452)org.aspectj.weaver.BCException: Bad type signature intentCallHandler
See the last comment on this issue:
We can actually see the difference in the byte code (see attached files)
Flow:
|Compile AJ Aspects into java byte code| ==> |package java aspects into AAR| ==> |include AAR in APK| ==> |build| ==> |desugar transform| ==> |AJ transform|
I understand that the transform has to happen but we have no control of when it runs and have no way to configure it, like a proguard setting saying to not optimize a certain class.
The AGP transform api only has an "add" method and I can't modify the transform order.
Is there a workaround to this or is there some way to not optimize certain bytecode files in the desugar tool?