-
Notifications
You must be signed in to change notification settings - Fork 316
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Running tests with ActivityScenario on Andriod 13 device with the targetSdk 33 throws the ActivityNotFoundException #1412
Comments
Same issue with |
Also hit this issue. As a temporary workaround, I had success adding the following to the AndroidManifest.xml under our <activity
android:name="androidx.test.core.app.InstrumentationActivityInvoker$BootstrapActivity"
tools:node="merge">
<intent-filter tools:node="removeAll" />
</activity>
<activity
android:name="androidx.test.core.app.InstrumentationActivityInvoker$EmptyActivity"
tools:node="merge">
<intent-filter tools:node="removeAll" />
</activity> It is possible that there is some AndroidX test code that relies on the |
I've also run into this issue ... Any word on a fix? |
We're working on a fix, stay tuned... |
Fixed in androidx.test:core:1.5.0-alpha02 |
Need `androidx.test:core:1.5.0-alpha02` to fix android/android-test#1412 in Espresso: `android.content.ActivityNotFoundException: Unable to find explicit activity class InstrumentationActivityInvoker$BootstrapActivity`.
Note that if targeting 12+, you have to specify or you will experience a build failure:
|
…tests on emulator with api 33 android/android-test#1412
Didn't have the <manifest
…
xmlns:tools='http://schemas.android.com/tools'
>
<application
…
>
…
<activity
android:exported='true'
android:name='androidx.test.core.app.InstrumentationActivityInvoker$BootstrapActivity'
tools:node='merge'
>
<intent-filter
tools:node='removeAll'
></intent-filter>
</activity>
<activity
android:exported='true'
android:name='androidx.test.core.app.InstrumentationActivityInvoker$EmptyActivity'
tools:node='merge'
>
<intent-filter
tools:node='removeAll'
></intent-filter>
</activity>
</application>
…
</manifest> |
We're using an out-of-date androidx.test package. Rather than upgrading, which can be quite complex occasionally, I'm just fixing the concrete issue being encountered by the CI/CD for SDK 33 testing See android/android-test#1412 for details of the issue
Upgraded the androidx.test.core to address this issue: android/android-test#1412 Still having issues with flaky tests on SDK 33. Appears the way that focus is handled in the application is problematic for espresso. A quick look turned up some non-obvious code (the code under test handles clicks but returns false indicating that it did not handle them, and the view is a nest of activity-fragment-fragment that will take me a moment to unpack). Chose to just maintain the SDK that was being tested previosuly (30) but put 33 into the list as something to be fixed
Upgraded the androidx.test.core to address this issue: android/android-test#1412 Still having issues with flaky tests on SDK 33. Appears the way that focus is handled in the application is problematic for espresso. A quick look turned up some non-obvious code (the code under test handles clicks but returns false indicating that it did not handle them, and the view is a nest of activity-fragment-fragment that will take me a moment to unpack). Chose to just maintain the SDK that was being tested previosuly (30) but put 33 into the list as something to be fixed
Description
After upgrading
targetSdk
to33
Android tests on Android 13 device start to fail with the exception:android.content.ActivityNotFoundException: Unable to find explicit activity class {com.appsflyer.engagement.test/androidx.test.core.app.InstrumentationActivityInvoker$BootstrapActivity}; have you declared this activity in your AndroidManifest.xml, or does your intent not match its declared <intent-filter>?
Steps to Reproduce
Precondition:
Android 13 device
targetSdk 33
Run some test:
ActivityScenario.launch( TestActivity::class.java )
Expected Results
Test should pass
Actual Results
Test fails with exception:
android.content.ActivityNotFoundException: Unable to find explicit activity class {com.appsflyer.engagement.test/androidx.test.core.app.InstrumentationActivityInvoker$BootstrapActivity}; have you declared this activity in your AndroidManifest.xml, or does your intent not match its declared <intent-filter>?
AndroidX Test and Android OS Versions
androidTestImplementation 'androidx.test:runner :1.4.0'
targetSdk 33
Android 13
Link to a public git repo demonstrating the problem:
The text was updated successfully, but these errors were encountered: