-
Notifications
You must be signed in to change notification settings - Fork 128
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
google map crashed with instrumentation test #211
Comments
@rakshitsoni02 could you test if it also happens with version 2.7.0? |
Hi @rakshitsoni02 @polivmi1 , I am facing the same issue and it also happens with upgraded version, is there any fix/workaround for this issue? |
hey @minaxiDH unfortunately no solid workaround I tried to dispose compose view in onstop() but still randomly failing the test suite |
@minaxiDH @rakshitsoni02 Would you be able to provide a sample project with a test that causes this crash? Our project has instrumentation tests that don't have this issue, so there may be something different in your setup that we can investigate. |
Reopening for comments from developers reporting this issue in the Maps SDK for Android issue tracker. |
Experiencing the same issue when writing an automation test - crashing due to the following issue: Has anyone found any workarounds? |
It doesn't throw if you change the rule from being Here's a project that reproduces the issue https://github.com/amrfarid140/googlemapscompose-issue-reporducer. It has 2 tests.
To run the sample project you will need to replace Google Maps API key in the AndroidManifest. The key in there is not valid anymore. |
Not sure if anyone is looking into this yet but something interesting I found was when the test fails. The call to disposingComposition changes threads at the point of calling
When we launch a Google Map containing activity, the cancellation signal comes from a LifecycleObserver inside When we launch an activity then navigate to a GoogleMap containing activity , the cancellation signal comes from Still don't know why this is happening. |
I'm facing the same issue as well. Any update on this issue? |
The workaround I have so far is to finish the activity/activities as part of the test instead of waiting for the test to tear down. |
I'm using ActivityScenario to launch activities in test. I have this same issue when the Google Map containing activity is launched from another one. Closing the activity with |
@amrfarid140 @Ayskin thank you so much. Finally, it works. |
This doesn't work if we need to assert on map screen, has anyone found any workaround on it? |
@minaxiDH Any workaround for this issue? |
@shriharsha-bhagwat this is still an open issue, we can't assert anything on map screen with composeView as it crashes with same exception, but it can be successfully closed using Espresso.pressBackUnconditionally() |
Please comment here if you're still seeing this issue with v3.1.0. |
started experiencing this issue with the same stacktrace as above with one of the instrumentation test that launches an Activity after updating the androidx.navigation library from 2.7.4 to the latest 2.7.5, is there a known conflict between the latest version of maps-compose and androidx.navigation? |
Facing the same issue. Using last version. |
Fix: @get:Rule val composeTestRule = createComposeRule(
effectContext = EmptyCoroutineContext + Dispatchers.Main.immediate
) (EmptyCoroutineContext is not necessary) |
We're still seeing this on version 4.3.3 of the lib. Closing the app using |
Device: Pixel 5 API 30
sdk version: 2.5.3 & 2.7.2
i've implemented GoogleMap with ComposeView, it's crashing in the instrumentation test case with the following stack trace:
ComposeView:
component:
I've tried running the test on the UI thread but no luck it seems like an issue when disposing of the mapview. The implementation used from the activity also tried setting different disposition strategy.
The text was updated successfully, but these errors were encountered: