Reputation: 101
I am trying to get Geolocation to work on my React Native App on my physical android device.
When I include the line
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
into my AndroidManifest.xml file, and then run react-native, the file reverts to what it was before, and I am unable to run react-native with that permission line in the file. In fact, I can write anything in the file and it will all get deleted.
Does anyone know why this happens and how to fix it? My AndroidManifest.xml file is as follows:
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.finalditto"
android:versionCode="1"
android:versionName="1.0" >
<uses-sdk
android:minSdkVersion="16"
android:targetSdkVersion="22" />
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.SYSTEM_ALERT_WINDOW" />
<android:uses-permission
android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<android:uses-permission
android:name="android.permission.READ_PHONE_STATE" />
<android:uses-permission
android:name="android.permission.READ_EXTERNAL_STORAGE" />
<application
android:name="com.finalditto.MainApplication"
android:allowBackup="false"
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
android:theme="@style/AppTheme" >
<activity
android:name="com.finalditto.MainActivity"
android:configChanges="keyboard|keyboardHidden|orientation|screenSize"
android:label="@string/app_name"
android:windowSoftInputMode="adjustResize" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity
android:name="com.facebook.react.devsupport.DevSettingsActivity" />
</application>
</manifest>
This is also what the file reverts to after running:
react-native run-android
Upvotes: 0
Views: 2275
Reputation: 101
After much trial and error:
The problem lies in the incorrect AndroidManifest.xml file being edited. The first file shown by window's search engine was incorrect. The correct file lies in the path:
android/app/src/main/AndroidManifest.xml
Upvotes: 1