Yyyeey
Yyyeey

Reputation: 75

React-native-maps module, missing gradle files?

I'm trying to set up react-native-maps module at my react-native app, however the component I've put in the code is blank.

To configure it properly I'm following the instructions (https://github.com/react-native-community/react-native-maps/blob/master/docs/installation.md), however at the very first step I've encountered a problem.

The android/settings.gradle file is missing, even the android directory. Should I launch some command to generate these? The remaining screens seem to work.

There are plenty of gradle files in node_modules folder, the one from expo module could be the match, but changing it doesn't seem right.

Where is the settings.gradle file located by default?

Upvotes: 2

Views: 1062

Answers (2)

Vagtse
Vagtse

Reputation: 121

for ''Where is the settings.gradle file located by default?'' android->app and (usually last file is)settings.gradle

Upvotes: 0

Leo
Leo

Reputation: 1800

Since you tagged expo in your question:

If you are using Expo you don't have to got through the integration steps, as react-native-maps is already included in Expo: https://docs.expo.io/versions/latest/sdk/map-view/

Just import the MapView from Expo:

...
import { MapView } from 'expo';
...

If you are not using Expo the settings.gradle file should look like this:

rootProject.name = '<your appname>'
include ':react-native-maps'
project(':react-native-maps').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-maps/lib/android')

include ':app'

Upvotes: 2

Related Questions