How to install Geolocation in react-native v0.63 the easy way 💪

Ridwan Ajibola
Sep 2 · 2 min read

A step-by-step guide on how to install @react-native-community/geolocation

The react-native team recently launched react-native v0.6. Surprisingly, the geolocation API was moved to @react-native-community/geolocation, causing a bit of change in how it is used due to its installation. In this article, I’m going to show you how to install it and how to solve a common problem whilst installing it.

Setting up our project

Follow this link to setup your development environment for android, then switch to React Native CLI Quickstart.

Create a new React Native project

npx react-native init MyGeolocation

cd MyGeolocation

Run the line of code in your terminal to start your project npx react-native run-android


Let’s get started 🔥

Install @react-native-community/geolocation for android

run yarn add @react-native-community/geolocation or npm install @react-native-community/geolocation

Add user permission to AndroidManifest.xml

Go to AndroidManifest.xml in android/app/src/main/AndroidManifest.xml and add or check here

Restart your project

Run npx react-native run-android in your terminal

💎 Tip

Note: you might get this error in your terminal

Task :app:mergeDexDebug Failed

this usually occur when you have imported a lot of packages which is unable to fit in a yaml file, which then causes a problem for the multidex builder.

Now re-run npx react-native run-android and tadaaa 🎉

Is that all?

i can’t believe it
i can’t believe it

Yeah! Yeah!! Yeah!!!

Like and share.

Welcome to a place where words matter. On Medium, smart voices and original ideas take center stage - with no ads in sight. Watch

Follow all the topics you care about, and we’ll deliver the best stories for you to your homepage and inbox. Explore

Get unlimited access to the best stories on Medium — and support writers while you’re at it. Just $5/month. Upgrade

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store