react-native-maps: Android runtime error - ‘RNMapsAirModule’ Could Not Be Found”- on react native 0.79
Summary
It seems something changed in the codegen config for RN 0.79 or RN 0.78, as I’m getting
Invariant Violation: TurboModuleRegistry.getEnforcing(…): ‘RNMapsAirModule’ Could Not Be Found” Error in React Native
upon launch. This works perfectly fine on RN 0.77. Not sure what the issue is exactly
Reproducible sample code
Available here: https://github.com/fobos531/react-native-maps-repro
Steps to reproduce
Add your google maps api key to the android manifest, compile and run the app, and use npx expo start to connect the development client.
Expected result
The android map should be initialized correctly.
Actual result
Getting Invariant Violation: TurboModuleRegistry.getEnforcing(…): ‘RNMapsAirModule’ Could Not Be Found” Error in React Native
React Native Maps Version
1.22.1
What platforms are you seeing the problem on?
Android
React Native Version
0.79.0
What version of Expo are you using?
SDK 53
Device(s)
Android emulator
Additional information
No response
About this issue
- Original URL
- State: closed
- Created 2 years ago
- Reactions: 9
- Comments: 53 (3 by maintainers)
Invariant Violation: TurboModuleRegistry.getEnforcing(...): 'RNMapsAirModule' could not be found. Verify that a module by this name is registered in the native binary.Same issue with “react-native-maps”: “^1.23.7”,
Also having the same issue, but using expo on a fresh project:
I also still have this issue with
Same issue with react native 0.79.1 and Expo 53
same issue with react native 0.76.9 and expo 52
@salah-ghanim updated to “expo”: “^53.0.9”, “react-native”: “0.79.2”, “react-native-maps”: “1.23.7”,
the problem persists
@salah-ghanim Is there a reason why the generated code needs to be shipped with the library instead of letting codegen run on app build?
I’m just using react-native 0.79.3 without expo and I got the same error testing react-native-maps in 1.24.3, 1.23.7, 1.20.1, 1.21.0
I did not see this problem when using react-native-maps version 1.20.1 or 1.23.8
Built the apk locally (with
npx expo run:android) and using eas and both were fine.Edit: Seems like everyone is still having this issue. I did encounter the issue once, but I assumed that was because I connected a development build running maps v1.20.1 to a development server with maps v1.23.8.
@elisjoaquim I managed to resolve the issue on Android with the following versions:
“expo”: “53.0.11” “react”: “19.0.0” “react-native”: “0.79.3” “react-native-maps”: “1.20.1”
I realized that my map was hidden and had to update my css with a fixed width property. Thanks for the help!
try to reinstall the package with
npx expo install react-native-maps, it should install a compatable version with your expo version, it fixed the issue for me.Expo is lil tricky with versioning, so its always the best to install using expo install rather than [npm | yarn …] install
I have the same error, please let me know if anyone has fixed it😥
Verified
react-native-maps@~1.23.7works for me onexpo@53.0.7,react-native@0.79.2, and new architecture is enabled for Android.this could be due to the fact that we’re shipping the generated code as part of the lib itself, which is not often used by react-native libs.
I will try to update the lib to support latest react-native and run codegen again, this might solve the issue, but then we’re again having to use a fixed version of the lib with fixed react-native version which I dislike.
Hi @fobos531, thanks for your reply, if I use the latest version of react-native-maps I get this warning:
The following packages need to be updated for better compatibility with the installed expo version: react-native-maps@1.22.6 - expected version: 1.18.0 Your project may not work properly until you install the expected package versions.
My package.json :
I created the project yesterday with this command:
Any update?
i got the same issue its related to how you install i think , i am using expo and i installed using
react native maps.but when i uninstalled react-native-maps and then installed it with expo
npx expo install react-native-mapsissue is fixed even the new arch is enabled.Hello,
I’m using Expo 53, updated to version 1.24.3, and it appears the issue has been resolved.
“dependencies”: { “expo”: “~53.0.9”, “react-native-maps”: “^1.24.3” }
Hello, It’s still not working. I don’t understand why this issue is closed.
I just tried npx expo install react-native-maps as recommended, it’s installing version “react-native-maps”: “1.20.1”
but i have this issue PluginError: Package “react-native-maps” does not contain a valid config plugin. Learn more: https://docs.expo.dev/guides/config-plugins/#creating-a-plugin
Unexpected token ‘<’
@NishS2211 hack worked for me on React Native 0.79.1
I’m experiencing the same issue. As a temporary workaround, try downgrading react-native-maps to version 1.18.0 until the issue is resolved in 1.22.1.
Also, make sure to modify your Podfile as follows: Keep this line: pod ‘react-native-google-maps’, :path => ‘…/node_modules/react-native-maps’ Remove or comment out this line (if present): pod ‘react-native-maps-generated’, :path => ‘…/node_modules/react-native-maps’
After making these changes, follow below steps :
This hacks worked perfectly for me on React Native 0.78.0.