Status Update
Comments
sg...@google.com <sg...@google.com> #2
Matthew, any thoughts on how best to do this? I know that we have the LanguageFeatureProvider
abstraction in the Java plugin (and our own AndroidLanguageFeatureProvider
which does API level checks) in order to silence a number of inspections. But this particular inspection (JavaApiUsageInspection
) does not seem to reference any JavaFeatures, it unconditionally reports them.
sg...@google.com <sg...@google.com> #3
Fixed by Change I7a57ba085bfd8c64679cf4bf3c05ce70da8cb5b8 using the InspectionSuppressor
EP.
ge...@paymentsense.com <ge...@paymentsense.com> #4
Thank you for your patience while our engineering team worked to resolve this issue. A fix for this issue is now available in:
- Android Studio Koala | 2024.1.1 Canary 4
- Android Gradle Plugin 8.5.0-alpha04
We encourage you to try the latest update.
If you notice further issues or have questions, please file a new bug report.
Thank you for taking the time to submit feedback — we really appreciate it!
sg...@google.com <sg...@google.com> #5
Android Studio Koala | 2024.1.1 Canary 4
Android Gradle Plugin 8.5.0-alpha04
does not work...
Objects.requireNonNullElse(
is still flagged as error
ge...@paymentsense.com <ge...@paymentsense.com> #6
Gradle Plugin 8.5.0-alpha04 seems be very broken in fact. My project does not even deploy now due to missing classes in the dex. I tried invalidating caches, full rebuild, a fresh emulator install....
Reverting to 8.3.2 and all is well again.
sg...@google.com <sg...@google.com> #7
Android Studio Koala | 2024.1.1 Canary 7
Android Gradle Plugin 8.4
Gradle 8.7
Still an issue
ge...@paymentsense.com <ge...@paymentsense.com> #8
I'm not seeing this using the latest Koala canary and the above test case. Can you provide more instructions for how to reproduce what you're seeing?
sg...@google.com <sg...@google.com> #9
No idea what is going on to be fair....
- a brand new project, and requireNonNullElse shows no problem.
- any existing project of mine (checked 4) show the problem.
However, it seems Gradle Plugin 8.4 is having the same problems as I saw with 8.5.0-alpha04. Missing classes in the dex / failures to build. The identical setup with Plugin 8.3.2 and all builds/deploys fine (except the RNNE warning obviously)
rant... each "upgrade" brings new problems.... I'll need to drop back to 8.3.2 AGAIN for now.
If/when eventually the gradle plugin decides to play nice again, I'll check the RNNE again.
ge...@paymentsense.com <ge...@paymentsense.com> #10
ok - I managed to fix the AGP 8.4 upgrade issue.
Current setup: Koala canary 8 + AGP 8.4 + Gradle 8.7
Android Studio Koala | 2024.1.1 Canary 8 Build #AI-241.15989.150.2411.11792637, built on May 2, 2024 Runtime version: 17.0.10+8-b1207.12 amd64 VM: OpenJDK 64-Bit Server VM by JetBrains s.r.o. Windows 11.0 GC: G1 Young Generation, G1 Old Generation Memory: 12288M Cores: 20 Registry: ide.browser.jcef.testMode.enabled=true ide.browser.jcef.sandbox.enable=false ide.images.show.chessboard=true Non-Bundled Plugins: name.kropp.intellij.makefile (241.14494.150) artsiomch.cmake (241.1.1)
- a brand new project, and requireNonNullElse shows no problem.
- requireNonNullElse is still showing up as error in existing projects
sg...@google.com <sg...@google.com> #11
Hm. Any other clues for how the two scenarios might be different? Do they have the same minSdkVersion? Is the usage in a library or in an app module? Is one of the projects using core library desugaring?
ge...@paymentsense.com <ge...@paymentsense.com> #12
Actually, never mind, I was confusing this with the NewApi lint check where those things might matter -- they don't for this. But this is the IntelliJ inspection. The thing that matters there is whether the module which contains this violation is considered an Android module in the IDE. I think that's influenced by which Gradle plugins are applied in that module -- whether it's an Android module (library or app), or some other Gradle module (like a Java library).
ge...@paymentsense.com <ge...@paymentsense.com> #13
Matthew, for lint's API check there's a similar issue with Java libraries -- we want API check to apply the minSdkVersion for the app module -- which may not be where we find an API call. So in the lint setup in the IDE we look for the first app module and pull the constraints from there.
I wonder if we should do the same thing here -- if there is any Android module in the project, we probably want to suppress the Java API inspections (since lint will kick in instead; the assumption is that these libraries will get consumed in the app and then processed by the Android tooling -- D8/R8, etc.)
sg...@google.com <sg...@google.com> #14
I've got something I think :)
app/library: makes no difference.
desugaring: YES.... I added desugaring (2.0.4) to the test/new project, and it's now also flagging up RNNE as an error.
Hope this helps.
ap...@google.com <ap...@google.com> #16
sure:
Call requires API level 30 (current min is 26): java.util.Objects#requireNonNullElse
an...@paymentsense.com <an...@paymentsense.com> #17
Interesting, thanks! That has a slightly different root cause; this bug was originally about an error coming from an IntelliJ inspection, whereas your error seems to be a false positive coming from Android Lint. Let's continue investigating your scenario at
cl...@google.com <cl...@google.com>
ap...@google.com <ap...@google.com> #18
Branch: main
commit c0f3646d88824dd0b1a376858d435b417c147f3f
Author: Clément Béra <clementbera@google.com>
Date: Tue Jul 30 10:57:37 2024
Fix SplitBranch with invalid phi
-Regress Tivi size by 0.007%
Bug:
Change-Id: Ie42724bf73b57ebbaa5145a054cce9e6bae06f56
M src/main/java/com/android/tools/r8/ir/conversion/passes/SplitBranch.java
M src/test/java/com/android/tools/r8/ir/optimize/ifs/Regress343136777Test.java
cl...@google.com <cl...@google.com> #19
Fixed, I need now to backport a bit.
ap...@google.com <ap...@google.com> #20
Branch: 8.6
commit 041afb7d25f7d2bb53d88066bcd212b3a4ebcabf
Author: Clément Béra <clementbera@google.com>
Date: Tue Jul 30 13:03:42 2024
Fix SplitBranch with invalid phi
-Regress Tivi size by 0.007%
Bug:
Change-Id: Ie42724bf73b57ebbaa5145a054cce9e6bae06f56
M src/main/java/com/android/tools/r8/ir/conversion/passes/SplitBranch.java
M src/test/java/com/android/tools/r8/ir/optimize/ifs/Regress343136777Test.java
ap...@google.com <ap...@google.com> #21
Branch: 8.6
commit 3ec73ce1dbb45b2b43148cb32753ef1e9fada74d
Author: Clément Béra <clementbera@google.com>
Date: Tue Jul 30 13:07:49 2024
Version 8.6.16
Bug:
Bug:
Bug:
Bug:
Change-Id: I9f2ad5022503a910fad4e649cf5df8dbbb616316
M src/main/java/com/android/tools/r8/Version.java
ap...@google.com <ap...@google.com> #22
Branch: 8.5
commit d360da0f12e43c2e9798aaa1bdf3443cb7661e51
Author: Clément Béra <clementbera@google.com>
Date: Tue Jul 30 13:26:24 2024
Version 8.5.34
Bug:
Bug:
Bug:
Bug:
Change-Id: Ife8945c8f8ed416af360c78e5fc4267bba97b967
M src/main/java/com/android/tools/r8/Version.java
ap...@google.com <ap...@google.com> #23
Branch: 8.5
commit 53afe8ea0c3600e3c5a6e50232759f65db70f3ce
Author: Clément Béra <clementbera@google.com>
Date: Tue Jul 30 13:23:19 2024
Fix SplitBranch with invalid phi
-Regress Tivi size by 0.007%
Bug:
Change-Id: Ie42724bf73b57ebbaa5145a054cce9e6bae06f56
M src/main/java/com/android/tools/r8/ir/conversion/passes/SplitBranch.java
M src/test/java/com/android/tools/r8/ir/optimize/ifs/Regress343136777Test.java
ap...@google.com <ap...@google.com> #24
Branch: 8.5
commit eba4c3e1e92b583c5f352ed87d2e660c0b15dbbf
Author: Clément Béra <clementbera@google.com>
Date: Tue Jul 30 13:22:42 2024
Add reproduction of
Change-Id: I110623e94cfb747b1d3b014fa7f20be9c8003bf7
Bug:
A src/test/java/com/android/tools/r8/ir/optimize/ifs/Regress343136777Test.java
cl...@google.com <cl...@google.com>
an...@google.com <an...@google.com> #25
Thank you for your patience while our engineering team worked to resolve this issue. A fix for this issue is now available in:
- Android Studio Koala Feature Drop | 2024.1.2 RC 1
- Android Gradle Plugin 8.6.0-rc01
We encourage you to try the latest update.
If you notice further issues or have questions, please file a new bug report.
Thank you for taking the time to submit feedback — we really appreciate it!
an...@google.com <an...@google.com> #26
The fixes for this issue are now also available in:
- Android Studio Koala | 2024.1.1 Patch 2
- Android Gradle Plugin 8.5.2
We encourage you to try the latest update.
If you notice further issues or have questions, please file a new bug report.
cu...@gmail.com <cu...@gmail.com> #27
Hello, i encounter with similar issue in AGP 8.7.3 and R8 8.7.18:
goto :goto_5b
:cond_59
move-object/from16 v15, p24
:goto_5b
const/high16 v16, 0x4000000
and-int v0, v0, v16
if-eqz v0, :cond_64
const/16 v8, 0x0
goto :goto_67
:cond_64
move-object/16 v264, p25
...
move-object/from16 v2, v264
java.lang.VerifyError: Verifier rejected class:[0x430] copy1 v2<-v264 type=Undefined cat=3
ch...@google.com <ch...@google.com> #28
Re:
In order to diagnose this issue, we would likely need a reproduction. If it would be possible for you to share a compiler dump, which contains the inputs to the D8 compilation, that should allow us to reproduce the issue. You can share this privately with
You can generate such a dump by running ./gradlew assembleRelease --no-daemon -Dcom.android.tools.r8.dumpinputtodirectory=/path/to/dumps
.
Description
Hello,
The issue continues to happen for us even with AGP 8.4.1. I am attaching the smali output here.
java.lang.VerifyError: Verifier rejected class com.pax.log.LogUtils: java.lang.StackTraceElement com.pax.log.LogUtils.getCaller(com.pax.log.b, java.lang.StackTraceElement[], int) failed to verify: java.lang.StackTraceElement com.pax.log.LogUtils.getCaller(com.pax.log.b, java.lang.StackTraceElement[], int): [0x21] type Undefined unexpected as arg to if-eqz/if-nez (declaration of 'com.pax.log.LogUtils' appears in /data/app/******-1/base.apk:classes8.dex)
at com.pax.log.LogUtils.isAndroid(LogUtils.java:125)
at com.pax.log.PaxLogWrapper.<init>(PaxLogWrapper.java:63)
at com.pax.log.PaxLogWrapper.<init>(PaxLogWrapper.java:52)
at com.pax.log.LogWrapperBinding.<clinit>(LogWrapperBinding.java:1)
at com.pax.log.LogWrapperBinding.registerLog(LogWrapperBinding.java:1)
at com.pax.poscomm.utils.CommLog.<clinit>(CommLog.java:1)
at com.pax.poscomm.utils.CommLog.v(CommLog.java:1)
at com.pax.poscomm.posapi.peripheries.NeptuneBase.getDalObjFromNeptuneLite(NeptuneBase.java:5)
at com.pax.poscomm.posapi.peripheries.NeptuneBase.getDalObjectFromNeptuneLib(NeptuneBase.java:6)
at com.pax.poscomm.posapi.peripheries.NeptuneBase.getClassLoader(NeptuneBase.java:2)
at com.pax.poscomm.posapi.peripheries.NeptuneBase.loadDex(NeptuneBase.java:4)
at com.pax.poslink.POSLinkAndroid.a(POSLinkAndroid.java:2)
at com.pax.poslink.POSLinkAndroid.init(POSLinkAndroid.java:21)