question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Black flicker when opening map on Android

See original GitHub issue

Describe the bug On android when loading the map there is a black flicker when rendering a MapView. You can see this visually on the gif below

To Reproduce Reproduction code:

export class MapComponent extends Component {
    constructor() {
        super()
        this.state = {
            mapIsVisible: false
        }
    }
    showMap = () => {
        this.setState({ mapIsVisible: !this.state.mapIsVisible })
    }
    render() {
        return (
            <View style={{ flex: 1, backgroundColor: "red" }}>
                <TouchableOpacity style={{ backgroundColor: "green", alignItems: "center", justifyContent: "center", height: 50, width: '100%' }} onPress={this.showMap}>
                    <Text>{this.state.mapIsVisible ? "Hide Map" : "Show Map"}</Text>
                </TouchableOpacity>
                {this.state.mapIsVisible ?
                    <MapboxGL.MapView
                        style={{ flex: 1, }}
                        zoomLevel={11}
                        showsMyLocationButton={true}
                        animated={false}
                    >
                        <MapboxGL.Camera
                            animationDuration={10}
                            animated={false}
                            zoomLevel={11}
                            centerCoordinate={[23.73153880, 37.99280960]}
                        >
                            <MapboxGL.UserLocation visible={true} />
                        </MapboxGL.Camera>

                    </MapboxGL.MapView>
                    : null}</View>
        )
    }
}

Expected behavior No black flickering as it degrades the user experience (edited)

Screenshots Peek 2020-01-15 11-37

Versions (please complete the following information):

  • Platfrom: Android
  • Device: [Nexus 5X simulator, Pocophone F1]
  • OS: [Android 9 , Android 10]
  • SDK Version [28,29]
  • React Native Version [0.60.4, 0.61.3]

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Reactions:2
  • Comments:13 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
dancherbcommented, Jun 11, 2020

@psusmars I just had to ensure that the coloured overlay was in fact rendering above the map before it disappeared, instead of under it (which would have no effect). Maybe make it bright pink while you’re figuring the absolute ordering out to get it on top (i.e. zIndex and order of absolutely positioned components).

1reaction
mattijsfcommented, Jan 15, 2020
Read more comments on GitHub >

github_iconTop Results From Across the Web

Black flicker when opening map on Android #617 - GitHub
It's the initial map view without the tiles being loaded in. I guess, that's just the way it is ‍♂ . You can...
Read more >
Google Maps V2 black screen flicker when adding or removing it
After loading the map i.e. you will get to know in onActivityCreated() of the map fragment. You should call the following method
Read more >
Why is my phone flickering and having issues when i go to ...
The issue is that when Google Maps is navigating and i try go to another app, the app viewer or the home screen,...
Read more >
How to Fix Screen Flickering on Android - Lifewire
Stop your Android screen from flickering or acting glitchy. Try these steps to diagnose, troubleshoot, and repair a flickering display.
Read more >
Google Maps causing screen flickering in latest update
When updating too the latest Google Maps version, my screen flickering pretty bad. Is anybody else having this issue or is this time...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found