You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Navigation issue when useHybridComposition = true on Android 9 #954
Using the latest master (b29092e) results in the map showing in front of any navigation. For example, showing an input form when the map is open, will briefly show the form (flashed on the screen), then what appears to be a new map instance shown in front of it.
Reproducible on Android 9. Based on by testing, everything works as expected iOS 15 and Android 12.
Workaround is to set useHybridComposition to false.
@yoavrofe, I'm tagging you because you submitted the useHybridComposition change and thought you might be able to offer some insight.
That how its solved in the example.
I wasn't expecting such issues on android <= 9.
For me we have three options:
Fix issue with hybrid Composition on old version
Set normal composition as the default
Automatically set proper composition
might be impossible as i could very well be an upstream issue. 2) would be a quick fix so people who want to use it can opt in with a solution similar to the one in the example. And 3) would be the most elegant solution but might be somewhat tricky to do in a robust way as of the async nature of getting android versions. (a future builder that waits for the Android version might do the trick)
So i would suggest to do a PR with 2) as this is a quick fix - as we try to workout either 1) or 3)
I guess my question should be what are, if any, the side effects for doing 2 for Android 12? IIRC, one of the reasons hybrid composition was added was because not using it could cause issues on Android 12.
I guess my question should be what are, if any, the side effects for doing 2 for Android 12? IIRC, one of the reasons hybrid composition was added was because not using it could cause issues on Android 12.
Yeah it would keep having some issues with e.g. rotation. But at least it would not be new issues surprising devs, and they would be less critical than this.
We can also put some example code into the readme or even add a static function to initialize composition that the dev can call when the app is starting up
We are using hybrid mode on our dedicated Android 9 device. Have been doing so since before this repo was forked from tobrun's original repo. And we've also switched to hybrid mode ourselves before it was implemented because of two reasons:
stopped crashes on our dedicated Andorid device, causing it to reboot (!)
significantly faster rendering
Recently we tried to use your repository but found the same issue of map being displayed all the time, even if you push a page infront of it. We are able to render a widget on top of mapbox, but whole page for some reason does not render. So we switched back to our repo for the time being. Meaning - we do use hybrid mode successfully on Android 9 but from the diff it is not clear, why it behaves correctly and why your repo does not. We can make it publically available if anybody is interested.
Please don't close this issue before resolving it.
We are using hybrid mode on our dedicated Android 9 device. Have been doing so since before this repo was forked from tobrun's original repo. And we've also switched to hybrid mode ourselves before it was implemented because of two reasons:
stopped crashes on our dedicated Andorid device, causing it to reboot (!)
significantly faster rendering
Recently we tried to use your repository but found the same issue of map being displayed all the time, even if you push a page infront of it. We are able to render a widget on top of mapbox, but whole page for some reason does not render. So we switched back to our repo for the time being. Meaning - we do use hybrid mode successfully on Android 9 but from the diff it is not clear, why it behaves correctly and why your repo does not. We can make it publically available if anybody is interested.
Please don't close this issue before resolving it.
I have found a fix for the map appear on all pages when useHybridComposition is false
You have to add to replace private final MapboxMapOptions options = new MapboxMapOptions().attributionEnabled(true);
by private final MapboxMapOptions options = new MapboxMapOptions().textureMode(true).attributionEnabled(true);
Activity
felix-ht commentedon Mar 21, 2022
maps/example/lib/main.dart
Line 78 in b29092e
That how its solved in the example.
I wasn't expecting such issues on android <= 9.
For me we have three options:
So i would suggest to do a PR with 2) as this is a quick fix - as we try to workout either 1) or 3)
cohenadair commentedon Mar 21, 2022
I guess my question should be what are, if any, the side effects for doing 2 for Android 12? IIRC, one of the reasons hybrid composition was added was because not using it could cause issues on Android 12.
felix-ht commentedon Mar 21, 2022
Yeah it would keep having some issues with e.g. rotation. But at least it would not be new issues surprising devs, and they would be less critical than this.
We can also put some example code into the readme or even add a static function to initialize composition that the dev can call when the app is starting up
srmncnk commentedon Apr 6, 2022
We are using hybrid mode on our dedicated Android 9 device. Have been doing so since before this repo was forked from tobrun's original repo. And we've also switched to hybrid mode ourselves before it was implemented because of two reasons:
Recently we tried to use your repository but found the same issue of map being displayed all the time, even if you push a page infront of it. We are able to render a widget on top of mapbox, but whole page for some reason does not render. So we switched back to our repo for the time being. Meaning - we do use hybrid mode successfully on Android 9 but from the diff it is not clear, why it behaves correctly and why your repo does not. We can make it publically available if anybody is interested.
Please don't close this issue before resolving it.
felix-ht commentedon Apr 6, 2022
yeah that might be interesting indeed
jgrandchavin commentedon Apr 7, 2022
Hello everyone 👋
I have found a fix for the map appear on all pages when
useHybridCompositionisfalseYou have to add to replace
private final MapboxMapOptions options = new MapboxMapOptions().attributionEnabled(true);by
private final MapboxMapOptions options = new MapboxMapOptions().textureMode(true).attributionEnabled(true);in MapboxMapBuilder.java line 17
SwiftyFlow commentedon Apr 20, 2022
Must be related #1008 (comment)
thanks for the .textureMode(true) that's what saved me BUT now I get 1000s of prints...
Update MapboxMapBuilder.java