Open oakkitten opened 3 years ago
@Archinamon when will publish Android-Gradle-Aspectj:4.3.0 for fix AGP 4.1.0 bug?you merge PR #128 but isn't published
I couldn't wait more for a version compatible with AGP4.1 so I ended up compiling the latest code and sending it to JCenter.
In case it's helpful to others: implementation 'com.akaita.android:android-gradle-aspectj:4.3.0'
The official 4.3.0 was just released. Please hit that one https://bintray.com/archinamon/maven/android-gradle-aspectj/4.3.0
@Archinamon when will publish Android-Gradle-Aspectj:4.3.0 for fix AGP 4.1.0 bug?you merge PR #128 but isn't published
Got stuck using AGP 4.0.0 due to this issue, please help!
@Archinamon when will publish Android-Gradle-Aspectj:4.3.0 for fix AGP 4.1.0 bug?you merge PR #128 but isn't published
Any idea when it could get merged? It's been a blocker and my project couldn't use 4.3.0 at all. Thanks!
@cyangibm For reference, that PR is merged in 4.3.0
Hmm..When I try to run my app using 4.3.0, the app would crash with class resolution error, please see below:
AspectJ Plugin 4.3.0 Gradle 6.5.1/6.1.1 AGP 4.1.1
2021-01-19 15:17:06.608 10519-10519/com.cxa E/AndroidRuntime: FATAL EXCEPTION: main
Process: com.cxa, PID: 10519
java.lang.NoClassDefFoundError: Failed resolution of: Landroidx/appcompat/R$drawable;
at androidx.appcompat.widget.AppCompatDrawableManager$1.GyLFl18w-_vYxzan_N4p7Q==/com.cxa-YdwwJY1W7Bugh6V0o9WuuA==/base.apk"],nativeLibraryDirectories=[/data/app/GyLFl18w-_vYxzan_N4p7Q==/com.cxa-YdwwJY1W7Bugh6V0o9WuuA==/lib/x86, /system/lib, /system_ext/lib, /product/lib]]
at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:207)
at java.lang.ClassLoader.loadClass(ClassLoader.java:379)
at java.lang.ClassLoader.loadClass(ClassLoader.java:312)
at androidx.appcompat.widget.AppCompatDrawableManager$1.
@cyangibm ah yes, I actually had the exact same problem. That's actually a separate issue (#108) caused by a fix for #122 . I had commented on #122 mentioning that it had broken it but never heard back from the contributor that had made the change.
Personally, I decided to switch aspect plugins for my own projects as the resolution of issues 108 and 122 seem to be incompatible and IDK if someone will be able to figure it all out. However, if you are using more advanced features from this plugin, I don't know if switching plugins would work for you.
I couldn't wait more for a version compatible with AGP4.1 so I ended up compiling the latest code and sending it to JCenter. In case it's helpful to others:
implementation 'com.akaita.android:android-gradle-aspectj:4.3.0'
Hello,
I tried your plugin link, however, also getting below crash when using AGP 4.1.1:
2021-01-20 10:50:37.686 5635-5635/com.cxa E/AndroidRuntime: FATAL EXCEPTION: main
Process: com.cxa, PID: 5635
java.lang.NoClassDefFoundError: Failed resolution of: Landroidx/appcompat/R$drawable;
at androidx.appcompat.widget.AppCompatDrawableManager$1.xCH6ru24VPAVPhLSrJwxtA==/com.cxa-mmJx_VjiFSMoSKJ3Zd0Lgg==/base.apk"],nativeLibraryDirectories=[/data/app/xCH6ru24VPAVPhLSrJwxtA==/com.cxa-mmJx_VjiFSMoSKJ3Zd0Lgg==/lib/x86, /system/lib, /system_ext/lib, /product/lib]]
at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:207)
at java.lang.ClassLoader.loadClass(ClassLoader.java:379)
at java.lang.ClassLoader.loadClass(ClassLoader.java:312)
at androidx.appcompat.widget.AppCompatDrawableManager$1.
in case someone needs this, here's a manual way of weaving aspectj on android. you will have to tweak the Transform
a bit to suite your needs but it's gradle kotlin dsl, only depends on aspectjtools & aspectjrt, and even deals with some nasty windows issue of gradle not releasing some file locks
Upon applying plugin, I'm getting the following error when building:
Windows 10; Gradle 6.3..6.7; Android Gradle Plugin 4.1.0. AGP 4.0.+ works.