https://kotlinlang.org logo
#compose
Title
# compose
b

Bradleycorn

08/01/2022, 6:55 PM
👋 Hi Everyone! I have updated my app to target
API level 33
, and as soon as I did that, all of my instrumented tests that use
createComposeRule
no longer work, and fail with an
ActivityNotFoundException
(it’s looking for androidx.test.core.app.InstrumentationActivityInvoker$BootstrapActivity). Has anyone else run into this problem? I can reproduce the issue using the latest stable Android Studio (Chipmunk 2021.2.1 Patch 1), following these steps: 1. Create a New project using the “Empty Compose Activity” template. 2. Add a compose rule to the included
ExampleIntrumentedTest
, like this:
@get:Rule var composerule = createComposeRule()
3. Run the example
useAppContext
test, and note that it passes. 4. Now, in the app module’s build.gradle, update the
compileSdk
and
targetSdk
to use
33
. 5. Run the example
useAppContext
test again, and see that it fails with
ActivityNotFoundException
… Has anyone else found this? How can we fix it? Thanks!
1
It would appear that perhaps this is an issue related to
ActivityScenario
and Android 13 (API 33), not necessarily an issue specific to Compose
a

Alex Vanyo

08/01/2022, 8:30 PM
Thanks for bringing this up! Yup, this looks like the same as https://github.com/android/android-test/issues/1412, I can reproduce while trying to update the compile and target sdk for Now in Android too. I haven’t tried the workaround that’s in the android-test issue
b

Bradleycorn

08/01/2022, 8:32 PM
@Alex Vanyo Yep, I was just looking at that issue. 🤞 for a fix. I haven’t yet tried the workaround either.
4 Views