Status Update
Comments
es...@google.com <es...@google.com>
ar...@google.com <ar...@google.com> #2
Need to acquire a Pixel 7 device.
di...@google.com <di...@google.com> #3
I was able to reproduce this in an older version. With a Pixel 7 pro and a newer version of AS (Giraffe | 2022.3.1 Patch 2) and AGP 8.1.0, tests pass. attaching Screenshot. Can you check if you still see the issue
di...@google.com <di...@google.com> #4
em...@google.com <em...@google.com> #5
Using Giraffe Patch 1 + AGP 8.1.2, When I hit Run
(as described in
If I click 'Got it', the test fails with INSTALL_FAILED_VERIFICATION_FAILURE
.
There is an 'install anyway' option when I expand the 'More Details' part. If I do that, the test passes.
Note that this project has:
compileSdk=33
minSdk=24
targetSdk not set
(i.e., default)
When I add targetSdk 33
, then the test always passes, so I'm guessing the test (and/or AGP 8.1.2) is using a default targetSdk that's just too old for Android 14 that the OS is rejecting the install?
- Would that be correct?
- Do we think we should update some defaults in AGP to fix this?
// The same happens when I comment out targetSdk 33
in the app
module, so this doesn't seem module specific, but rather a generic concern for instrumented tests.
di...@google.com <di...@google.com>
cm...@google.com <cm...@google.com> #6
Yes, target sdk defaults to min SDK in AGP if it's not set (this mimics the platform's behavior)
We have discussed changing that default in AGP to the compileSdkVersion, especially for library tests, but it's a behavioural breaking change so we'd want to wait for a major version
em...@google.com <em...@google.com> #7
Then, at the moment, I believe we should fix the template for File > New > New Module..."
so that it sets targetSdk
field (similar to how the default Empty Activity template sets targetSdk = compileSdk
).
em...@google.com <em...@google.com> #8
But then I discover these:
=> Remove targetSdkValue from gradle.builds for library modulesb/234472788 http://ag/21487220 => Don't set targetSdk in libraries
...which conflicts with what I want/need here. How can we set targetSdk
for an instrumented test inside a library module?
em...@google.com <em...@google.com> #9
+cc alex and james
di...@google.com <di...@google.com> #10
HI,
I have created a bug to track changing the default targetSdk to compileSdk for AGP 9.0.
an...@google.com <an...@google.com> #11
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 Iguana | 2023.2.1 Canary 14
- Android Gradle Plugin 8.3.0-alpha14
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!
Description
Repro instructions:
nativelib
module that has native code. Nothing special.NativeLibInstrumentedTest
targetExpected result:
Actual result:
Error message on the build window:
Logs and project are attached.