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.

Map displays as a black screen in V10 example (iOS)

See original GitHub issue

Description
The map displays a black frame instead of the expected map contents. It looks like the screenshot below - the same on simulator and device.

I know the V10 library is very much a work in progress, but my understanding is that it should at least display a map at this point, so I’m wondering if anybody else has had success with the example.

Reproduction

  1. Do a standard installation of rnmapbox/maps with $RNMapboxMapsImpl = 'mapbox':
git clone git@github.com:rnmapbox/maps.git
cd maps && npm i
cd example && npm i
  1. Delete the existing MapLibre Swift package, and add https://github.com/mapbox/mapbox-maps-ios.git as a new one.
  2. Launch the app on device or simulator.
  3. Navigate to the V10 section and launch either of the options.

Expected behavior
The map should look like a … map.

Actual behavior
The map looks like a flat black rectangle.

Screenshots

Versions (please complete the following information):

  • Platform: iOS
  • Platform OS: iOS 15.3.1
  • Device: iPhone 12s
  • Emulator/ Simulator: Simulator and device
  • Dev OS: macOS 12.2 (21D49)
  • @rnmapbox/maps Version: 10.0.0-beta.0
  • React Native Version: 0.66.0

Other Note that I was getting a Multiple commands produce... build error, which I was able to resolve by deleting one of the binary links - specifically the one at Build Phases > Link Binary With Libraries > MapboxMaps.

Issue Analytics

  • State:closed
  • Created a year ago
  • Comments:7 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
mfazekascommented, Apr 8, 2022

Got it working!

Good to hear. We certainly can and should make it fail with a more visible error if accessToken is not passed/not valid.

0reactions
naftalibedercommented, Apr 8, 2022

Got it working!

A little embarrassing, but for the sake of any future travelers: check example/ios/env.json and make sure that the access token is in there as well.

I hadn’t thought through the fact (clearly listed in the readme 🤦) that the token is added during dependency installation (the postinstall script), not at build time. It’s a silly mistake but hard to debug!

Read more comments on GitHub >

github_iconTop Results From Across the Web

Black screen on some devices after v10.0.0 #976 - GitHub
mapbox up to v10.0.0 works on these devices. starting mapbox v10.1.0-beta.1 the black screen is shown and map doesn't load.
Read more >
Black screen when assigning google maps to subview
I tried the solution you proposed but it still gives a black screen. I have a outlet to my viewcontroller.h file for the...
Read more >
app has black screen on device. wo… - Apple Developer
problem - app shows launch screen and then shows a black screen without any UI. the app works fine on simulator ios 13...
Read more >
Blank or missing map tiles | Help - Mapbox docs
Learn why you may be seeing blank or missing tiles. ... If you're hiding your map initially with CSS rules like display:none ,...
Read more >
How To Fix Google Maps App Black Screen Issue Android & Ios
How To Fix Google Maps App Black Screen Issue Android & IosSubscribe my YouTube Channel:https://rb.gy/1utce0In This tutorial will apply for ...
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