react-native-maps: "AIRMap" was not found in the UIManager.
Is this a bug report?
Yes and No, as it has been answered in many other Issues, but none of the answers seems to work for me…
Invariant Violation: requireNativeComponent: “AIRMap” was not found in the UIManager.
This error is located at: in AIRMap (at MapView.js:760) in MapView (at Home.js:118)

Have you read the Installation Instructions?
Yes
Environment
“react-native”: “^0.57.0-rc.4”, “react-native-maps”: “^0.21.0”,
Target platform: iOS Simulator: iPhone 6
Steps to Reproduce
I tried this:
- rm -rf ios android node_modules
- npm install
- react-native upgrade
- react-native link
- libAirMaps.a is added in Build Phases
- AirGoogleMaps and AirMaps is added to Frameworks
- Followed this guide to add Maps SDK for iOS manually without CocoaPods: https://developers.google.com/maps/documentation/ios-sdk/start
- Added @import GoogleMaps; and [GMSServices provideAPIKey:@“YOUR_API_KEY”]; to AppDelegate.m
Expected Behavior
I have not added this to package.json, as I am unsure what path it is asking for? I found this at https://github.com/react-community/react-native-maps/blob/master/docs/installation.md
{
"name": "your-app",
"scripts": {
"postinstall": "./node_modules/react-native-maps/enable-google-maps REPLACE_ME_RELATIVE_PATH_TO_GOOGLE_MAPS_INSTALL"
}
}
The Map would be displayed. But I get the error no matter what I do.
Actual Behavior
Added this to my component, followed the guides excactly. Also tried creating a new app, but it doesn’t work:
import MapView from 'react-native-maps';
<MapView
initialRegion={{
latitude: 37.78825,
longitude: -122.4324,
latitudeDelta: 0.0922,
longitudeDelta: 0.0421,
}}
/>
Reproducible Demo
Working on setting this up.
About this issue
- Original URL
- State: closed
- Created 6 years ago
- Reactions: 16
- Comments: 43
My issues fixed by using this step
Using
"react-native-maps": "https://github.com/react-community/react-native-maps.git"in my package.json and runyarn installIn my
android/build.gradle, add:May be you must adjust with your project
In
android/app/build.gradeaddcompile project(':react-native-maps')independenciesobjectIn
android/app/src/main/java/com/projectName/MainApplication.javaedit in getPackages() function so it look like thisI fixed my issue by adding this last step. I got the
AIRMaperror when I forget to addingnew MapsPackage()in my MainApplication.javaMay be you must adjust with yout ios setting, btw I didn’t develop in ios 😄
I love how every issue gets simply closed without solution or help. A simple statement what could be wrong/missing would help. People writing their Android “solution” to an ios OP is also not very helpful and only clutters everything.
I get that it might be a stupid little error. Something missing or clashing. But giving a hint how to validate that everything is linked correctly would be nice. Something like “downgrade your RN until it works” like many stated is clearly no solution or option whatsoever.
As the podfile in the instructions differs significantly from the default one - and simply replacing it is normally not an option (we have other pods, you know?) - my guess would be people not including all the dependencies correctly. But no one can validate things like that without knowing what is actually needed from the podfile.
These steps fixed this error for me.
Try this before you try anything of the above (I tried a bunch of them and none worked, but they made it more difficult to apply the fix below as I screwed up my project in the process)
I fixed this one by
The instructions are simply unclear on what to do - the implication seems to be one can either use react native link OR install CocoaPods. When in actuality you have manually run pod install
It’s not difficult to fix! The problem is there’s poor documentation, and a lot of the “fixes” above are unnecessary and don’t work. I am guessing they were for version 0.21 and possibly others that actually had an issue with integration.
0.22 works!
You only have to go to ./ios and run ‘pod install’.
When you install react native map, react native keep the old build. You must remote iOS/build and node modules and re-build your application ! In new version builded there are AirMap ! Enjoy
For me
This fixed my, I forgot to add new MapsPackage() to getPackages after RNN install. what a painnnnn 🗡
I got the same error but fix it. In android/build.gradle, set minSdkVersion value to 22
Anyone have fix this issue for RN version 0.60 ?
I have got this lib working, after completely updating node and yarn to the latest versions. In the end I’ve used yarn instead npm, so there might be a problem with npm install.
@vemundeldegard did you run
react-native link react-native-maps?What worked for me was using yarn instead of npm.
I ran
yarn add react-native-maps -Einstead ofnpm install react-native-maps.The package was missing under node_modules folder, using yarn did the trick.
Then
cd iospod installIf you followed all instructions on the react-native-maps properly, the way to fix this issue is simply to uninstall the app from your device / simulator, then re-running it.
This is a general advice when installing new pods.
I had the same issue and I fixed it by the folowing steps :
android/app/src/java/MainApplication.javafile and add :import com.airbnb.android.react.maps.MapsPackage;And add
new MapsPackages()to getPackages() that return a list, something like this :compile project(':react-native-maps')to dependencies block.I hope this will help you, I am waiting for your feedbacks
I solved it by adding the .xcodeproj in node_modules/react-native-maps/lib to Libraries by right clicking and then adding it to link binary with libraries and linked frameworks and libraries.
Shout out to @spearmootz for guiding me on this 😄
@vemundeldegard sadly no, there is only one person that is allowed to publish to npm and he’s very busy
@vemundeldegard many other issues say to use the github version - did you try?