react-native-maps: Android: Invariant Violation: requireNativeComponent "AIRMap" was not found in the UIManager

Is this a bug report?

Yes

Have you read the Installation Instructions?

Yes

Environment

react-native: 0.57.7
react: 16.6.1
"react-native-maps": "https://github.com/react-native-community/react-native-maps.git"

Steps to Reproduce

I’m not getting this error when I run the project with react-native run-android. However, I’m trying to add a React Native app to an Android app in Android Studio as a library, and I’m getting the error in that project.

Expected Behavior

There shouldn’t be an error.

Actual Behavior

Image of Error

Reproducible Demo

I followed this tutorial, which worked, but when I add react-native-maps, I get this error.

There have been several issues about this error. I’ve read every comment and tried every possible solution without success. There’s also a relatively new issue for iOS. I assume they’re related, but I figured I would open an issue for Android.

About this issue

  • Original URL
  • State: closed
  • Created 6 years ago
  • Comments: 15

Most upvoted comments

Please check your MainApplication.java file whether the following lines are available.

import com.airbnb.android.react.maps.MapsPackage;

The following inside getPackages()

new MapsPackage()

Have the same error, IOS works fine also “react-native”: “0.57.4”, “react-native-maps”: “^0.22.1”,

Installed google services solved the problem

Which google services? Please, could you describe it more detaily?

I Installed google services in android studio 2019-01-15 18 39 27

Hey guys I followed this tutorial and it worked for me 😀

Can you guys test too? 😉

Thanks a lot @RafaelFronteira… I’ve been stuck the whole day on android. It worked for me 😉