You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cordova.apache.org by GitBox <gi...@apache.org> on 2019/04/29 20:10:40 UTC

[GitHub] [cordova] ekrapfl edited a comment on issue #95: Android location permissions not being requested using Cordova 9

ekrapfl edited a comment on issue #95: Android location permissions not being requested using Cordova 9
URL: https://github.com/apache/cordova/issues/95#issuecomment-487718321
 
 
   Yeah, sorry I should have narrowed this down sooner.  Basically, I just started with a simple `cordova create`.
   Here is the package.json I am using:
   ```
   {
     "main": "index.js",
     "dependencies": {
       "cordova": "^9.0.0",
       "cordova-android": "^8.0.0",
       "cordova-plugin-geolocation": "4.0.1"
     },
     "cordova": {
       "plugins": {
         "cordova-plugin-geolocation": {}
       },
       "platforms": [
         "android"
       ]
     }
   }
   ```
   
   And here is the config.xml:
   ```
   <?xml version='1.0' encoding='utf-8'?>
   <widget id="io.cordova.hellocordova" version="1.0.0" xmlns="http://www.w3.org/ns/widgets" xmlns:cdv="http://cordova.apache.org/ns/1.0">
       <name>HelloCordova</name>
       <description>Hello</description>
       <author email="dev@cordova.apache.org" href="http://cordova.io">hello</author>
       <content src="index.html" />
       <access origin="*" />
       <allow-intent href="http://*/*" />
       <allow-intent href="https://*/*" />
       <plugin name="cordova-plugin-geolocation" spec="4.0.1" />
       <platform name="android">
           <allow-intent href="market:*" />
           <!-- <config-file parent="/*" target="AndroidManifest.xml">
               <uses-permission android:name="android.permission.CAMERA" />
           </config-file> -->
       </platform>
       <engine name="android" spec="^7.1.4" />
   </widget>
   ```
   
   If you leave that line commented out and run an `npx cordova prepare`, you will see that the generated `platforms/android/app/src/main/AndroidManifest.xml` will have the proper location permissions:
   ```
   <uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
   <uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
   <uses-feature android:name="android.hardware.location.gps" />
   ```
   
   If you uncomment the lines in the config.xml, however, and re-run your `npx cordova prepare`, it will remove those permissions.
   
   It is worth noting that I do see the following warning on prepare:
   ```
   Conflict found, edit-config changes from config.xml will overwrite plugin.xml changes
   ```
   However, I have always seen that warning, so I thought nothing of it when upgrading to Cordova 9.  Using Cordova 8, I saw that warning, but it still had all of the permissions in the AndroidManifest file.  It may very well be that I should be requesting camera permission in a different way than what I am attempting to do here, because it is clearly not allowing both the way I am specifying and the way the plugin wants to use.  What am I doing wrong?
   
   Thanks,
   Eben

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@cordova.apache.org
For additional commands, e-mail: commits-help@cordova.apache.org