Status Update
Comments
ga...@google.com <ga...@google.com> #2
In order to support an API, we need to update all relevant AGP/Studio tests to run against it. Support for API 34 was added only in AGP 8.2.
Previously, we had issues when untested API levels were used with older AGPs, so that is why this warning was added. If we want to claim support for API 34 in Studio G and AGP 8.1.x, we need to update our tests to run against API 34.
xa...@google.com <xa...@google.com> #3
Or we could just not say anything like we did before because this warning is 100% unactionable.
It's not about saying AGP 8.1 officially support API 34, it's about not saying the opposite :)
ga...@google.com <ga...@google.com> #4
We need to run tests against API 34 first, confirm there are no serious regressions, and we can remove the warning after that.
au...@google.com <au...@google.com> #5
AndroidX ran against API 34 since ~March on AGP 8.1.0, it works just fine.
hu...@google.com <hu...@google.com> #6
IIUC this bug is the same as
I agree the first two lines are not helpful in isolation because the warning needs to be read in full, which is as follows:
WARNING: We recommend using a newer Android Gradle plugin to use compileSdk = 34
This Android Gradle plugin (8.1.0) was tested up to compileSdk = 33.
You are strongly encouraged to update your project to use a newer
Android Gradle plugin that has been tested with compileSdk = 34.
If you are already using the latest version of the Android Gradle plugin,
you may need to wait until a newer version with support for compileSdk = 34 is available.
To suppress this warning, add
android.suppressUnsupportedCompileSdk=34
to this project's gradle.properties.
hm...@google.com <hm...@google.com> #7
A few updates after testing AGP 8.1 with API 34.
-
Most of our integration tests right now are still running against API 33. Specifically the ones that rely on DEFAULT_COMPILE_SDK_VERSION from the common test fixtures utilities. We need to update that to API 34.
-
After updating tests to run against 34, one particular issue has come up which does not happen with 33. Unit tests (roboelectric) that reference enums in the Android API fail with errors such as:
Caused by:
java.lang.ExceptionInInitializerError: Exception java.lang.RuntimeException: Method $values in android.os.AsyncTask$Status not mocked. See https://developer.android.com/r/studio-ui/build/not-mocked for details. [in thread "Test worker"]
at android.os.AsyncTask$Status.$values(AsyncTask.java)
at android.os.AsyncTask$Status.<clinit>(AsyncTask.java:77)
After digging some more with Ivan into the disassembled bytecode, it looks like the structure of enums have changed between java 11 and 17 and the transformation that creates the mocked android.jar for SDK 34 can't handle that properly. A workaround for this is to set
testOptions.unitTests.isReturnDefaultValues = true
in the build.gradle file.
xa...@google.com <xa...@google.com> #8
are we using the latest robolectric though? When we moved our SDK to 34, we didn't update robolectric.
ga...@google.com <ga...@google.com> #9
AGP tests are still using 33, I'm not sure if there are any that run with 34 ATM. This is because
In general, this is not about Robolectric, but the fact that android.jar
34 from SDK now has a method invocation in the Enum <clinit>
. Because all methods throw by default, causing the class to initialize now breaks the tests. IIUC we provide no guarantees about the mockable jar, except that you can mock it, so this should not be considered a regression.
xa...@google.com <xa...@google.com> #10
ah makes sense, thanks.
nc...@meta.com <nc...@meta.com> #11
Hi all, What's the outcome of this conversation? Is the warning going away in a point release of AGP 8.1.x? Or what's the ETA for 8.2.0 stable?
Asking as we'd like to release a new version of React Native with buildTools 34 and the latest AGP stable. The current forecast would be to distribute to the whole ecosystem an unactionable warning, hold off on the buildTools
bump or wait till AGP 8.2 is stable.
Description
If you use AGP 8.1 with API 34 you get the following warning:
This is not useful as there isn't a newer stable AGP that's compatible (8.2 is but is in Canary/Beta).
In order to not confuse our users, we should remove this warning from 8.1.1.
When we finalize our plans regarding this and we have a better process to test platforms as early as possible, we can put something back.