nitaliano / react-native-mapbox-gl

A Mapbox GL react native module for creating custom maps
Other
2.16k stars 697 forks source link

Invariant Violation: Native component for "RCTMGLFillLayer" does not exist #1514

Closed kylesziv closed 5 years ago

kylesziv commented 5 years ago

I'm working on an android application which utilizes mapbox. When working on android in development, everything is working fine with Mapbox. When I generate a signed APK for production, I get an error "Native component for "RCTMGLFillLayer" does not exist". Any idea as to what is going on?

Below is my package.json as well as the error message that I found in the logs.

   "@mapbox/react-native-mapbox-gl": "6.0.2",
    "expo": "^30.0.1",
    "expokit": "1.7.1",
    "react": "16.3.1",
    "react-native": "https://github.com/expo/react-native/archive/sdk-30.0.0.tar.gz",
ReactNativeJS: Invariant Violation: Native component for "RCTMGLFillLayer" does not exist

                                                  This error is located at:
                                                      in RCTMGLFillLayer
                                                      in r
                                                      in RCTMGLShapeSource
                                                      in r
                                                      in RCTMGLMapView
                                                      in n
                                                      in RCTView
                                                      in t
                                                      in t
                                                      in RCTView
                                                      in t
                                                      in RCTView
                                                      in t
                                                      in RCTScrollView
                                                      in ScrollView
                                                      in RCTView
                                                      in t
                                                      in RCTView
                                                      in t
                                                      in l
                                                      in Connect(l)
                                                      in t
                                                      in RCTView
                                                      in t
                                                      in RCTView
                                                      in t
                                                      in RCTView
                                                      in t
                                                      in n
                                                      in t
                                                      in n
                                                      in RCTView
                                                      in t
                                                      in RCTView
                                                      in t
                                                      in t
                                                      in RCTView
                                                      in t
                                                      in e
                                                      in r
                                                      in Unknown
                                                      in n
                                                      in n
                                                      in t
                                                      in RCTView
                                                      in t
                                                      in n
                                                      in t
                                                      in n
                                                      in RCTView
                                                      in t
                                                      in RCTView
                                                      in t
                                                      in t
                                                      in RCTView
                                                      in t
                                                      in e
                                                      in r
                                                      in Unknown
                                                      in n
                                                      in n
                                                      in RCTView
                                                      in t
                                                      in n
                                                      in l
                                                      in r
                                                      in RCTView
                                                      in t
                                                      in RCTView
                                                      in t
                                                      in t
kristfal commented 5 years ago

Hey, that version is quite outdated. Mind try removing it (remember to unlink), and use the latest 6.1.1 instead?

Edit: Sorry, are you using expo? If so, you’ll need to detach.

kylesziv commented 5 years ago

I'm using Expo SDK 32 and have already detached. I've tried 32, 31, and 30. I've successfully used 29 in the past with Mapbox 6.0.2 which is why I decided to try that one.

Using Mapbox 6.1.1 and Expo SDK 32, I get this error only when a production build is installed. Development build is fine.

E/ReactNativeJS: Invariant Violation: requireNativeComponent: "RCTMGLFillLayer" was not found in the UIManager.

                                                This error is located at:
                                                    in RCTMGLFillLayer
                                                    in p
                                                    in RCTMGLShapeSource
                                                    in f
                                                    in RCTMGLAndroidTextureMapView
                                                    in RCTView
                                                    in b
                                                    in RCTView
                                                    in b
                                                    in RCTView
                                                    in RCTView
                                                    in RCTScrollView
                                                    in ScrollView
                                                    in RCTView
                                                    in RCTView
                                                    in p
                                                    in Connect(p)
                                                    in c
                                                    in RCTView
                                                    in RCTView
                                                    in RCTView
                                                    in N
                                                    in p
                                                    in P
                                                    in RCTView
                                                    in RCTView
                                                    in n
                                                    in RCTView
                                                    in v
                                                    in c
                                                    in Unknown
                                                    in h
                                                    in P
                                                    in c
                                                    in RCTView
                                                    in N
                                                    in p
                                                    in P
                                                    in RCTView
                                                    in RCTView
                                                    in n
                                                    in RCTView
                                                    in v
                                                    in c
                                                    in Unknown
                                                    in h
                                                    in P
                                                    in RCTView
                                                    in o
                                                    in _
                                                    in v
                                                    in RCTView
                                                    in RCTView
                                                    in c
kristfal commented 5 years ago

Could you try this fork?: https://github.com/mapbox/react-native-mapbox-gl/pull/1491

kylesziv commented 5 years ago

Same issue as before.

doodlemoonch commented 5 years ago

Also having this issue with that fork on react-native 0.58.5

mutablestudio commented 5 years ago

I'm also having the issue from #1518. On Android only, and only in Production with rn 0.57.1 and react-native-mapbox-gl "^6.1.3", expo detached:

"@mapbox/react-native-mapbox-gl": "^6.1.3", "expo": "^32.0.0", "expokit": "32.0.5", "react": "16.5.0", "react-native": "https://github.com/expo/react-native/archive/sdk-32.0.0.tar.gz",

kristfal commented 5 years ago

This should now work if you install from master. Please reopen if you still experience any issues.