react-native-maps: Android runtime error - ‘RNMapsAirModule’ Could Not Be Found”- on react native 0.79

Summary

@salah-ghanim

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)

Commits related to this issue

Most upvoted comments

Same issue with

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:

"react-native": "0.79.2",
"react-native-maps": "^1.23.7",
Invariant Violation: TurboModuleRegistry.getEnforcing(...): 'RNMapsAirModule' could not be found. Verify that a module by this name is 
registered in the native binary., js engine: hermes

I also still have this issue with

"react-native": "0.79.2",
"react-native-maps": "^1.23.7"

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

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.

@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

"expo": "~53.0.9",
"react-native": "0.79.2",
"react-native-maps": "1.20.1" / "react-native-maps": "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.7 works for me on expo@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 :

  "dependencies": {
    "@expo/vector-icons": "^14.0.2",
    "@react-navigation/bottom-tabs": "^7.2.0",
    "@react-navigation/native": "^7.0.14",
    "@vgatica9/react-native-leaflet-maps": "^0.2.3",
    "expo": "~52.0.46",
    "expo-blur": "~14.0.3",
    "expo-constants": "~17.0.8",
    "expo-font": "~13.0.4",
    "expo-haptics": "~14.0.1",
    "expo-linking": "~7.0.5",
    "expo-location": "^18.0.10",
    "expo-router": "~4.0.20",
    "expo-splash-screen": "~0.29.24",
    "expo-status-bar": "~2.0.1",
    "expo-symbols": "~0.2.2",
    "expo-system-ui": "~4.0.9",
    "expo-web-browser": "~14.0.2",
    "react": "18.3.1",
    "react-dom": "18.3.1",
    "react-native": "0.76.9",
    "react-native-gesture-handler": "~2.20.2",
    "react-native-leaflet-view": "^1.0.3",
    "react-native-maps": "^1.22.6",
    "react-native-reanimated": "~3.16.1",
    "react-native-safe-area-context": "4.12.0",
    "react-native-screens": "~4.4.0",
    "react-native-web": "~0.19.13",
    "react-native-webview": "13.12.5"
  },
  "devDependencies": {
    "@babel/core": "^7.25.2",
    "@types/jest": "^29.5.12",
    "@types/react": "~18.3.12",
    "@types/react-test-renderer": "^18.3.0",
    "jest": "^29.2.1",
    "jest-expo": "~52.0.6",
    "react-test-renderer": "18.3.1",
    "typescript": "^5.3.3"

I created the project yesterday with this command:

npx create-expo-app@latest

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-maps issue 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 :

  • npm uninstall react-native-maps
  • yarn install
  • cd ios && pod install && cd …
  • npm install react-native-maps@1.18.0
  • yarn install
  • cd ios && pod install && cd …
  • Rebuild the app

This hacks worked perfectly for me on React Native 0.78.0.