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.

Cannot read property 'StyleURL' of undefined

See original GitHub issue

Describe the bug After following the installation instructions, as soon as I load the app I get the following error: Cannot read property 'StyleURL' of undefined. It’s caused by the following line during initialization: https://github.com/react-native-mapbox-gl/maps/blob/master/javascript/components/MapView.js#L23. It appears the NativeModule MGLModule is not loaded despite the fact that I added RCTMGLPackage to the packages list in MainApplication.java (and other gradle files).

To Reproduce Install, import maps, run the app with Expo.

Expected behavior App loads without crashing.

Screenshots Screenshot_2019-09-17-13-15-57-611_host exp exponent

Versions

  • Platfrom: Android
  • Device: Xiomi Redmi 6
  • OS: Android 8.1.0
  • SDK Version: 28
  • React Native Version: 0.59.10

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Reactions:3
  • Comments:7 (3 by maintainers)

github_iconTop GitHub Comments

2reactions
ferdicuscommented, Feb 23, 2021

If this was documented it would have saved having to dig

it is kinda: https://github.com/react-native-mapbox-gl/maps#expo-support

1reaction
cgibsonmmcommented, Jan 1, 2020

Where does it say we can’t run in expo?

Read more comments on GitHub >

github_iconTop Results From Across the Web

Cannot read property 'StyleURL' of undefined #386 - GitHub
After following the installation instructions, as soon as I load the app I get the following error: Cannot read property 'StyleURL' of undefined...
Read more >
Cannot read property 'StyleURL' of undefined - Bountysource
After following the installation instructions, as soon as I load the app I get the following error: Cannot read property 'StyleURL' of undefined...
Read more >
Mapbox React Native can't access the map's methods
I wasn't defining a ref property on the MapView. It should have had a reference defined as this. ... _map = c} styleURL={Mapbox.StyleURL....
Read more >
Cannot read properties of undefined (reading 'title') 2 - Angular
Dear Mr. Jason & everyone I am getting this error the add new-product page is not working I appreciate any help, I am...
Read more >
rnmapbox/Lobby - Gitter
I keep getting the error undefined cannot read property usertrackingModes of ... that The Project with path mapbox/react-native-mapboxgl could not be found.
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