cordova – phonegap build permissions in android-ThrowExceptions

Exception or error:

I’m using phonegap build to create my app.

Is there a way I can configure the permissions asked by android?

For now it asks for all the permissions when I actually only need internet, localstorage and notifications.

Please bare in mind – I’m only using phonegap build, Not CLI and not Cordova.
I have no AndroidManifest.xml only config.xml

Can anybody help?



This was answered by SvenT23.

We both realized that phonegap has removed this answer from their current docs and left it only in the old docs.

For future reference I’m adding the instructions from phonegap in case it will get deleted in the future.

API Features

Currently supported through this interface are the following feature names:
// maps to android:BROADCAST_STICKY permission
// maps to android:CAMERA, winphone:ID_CAP_ISV_CAMERA, and winphone:ID_HW_FRONTCAMERA permissions
// maps to android:READ_CONTACTS, android:WRITE_CONTACTS, android:GET_ACCOUNTS, and winphone:ID_CAP_CONTACTS permissions
// maps to WRITE_EXTERNAL_STORAGE permission
// maps to android:RECORD_AUDIO, android:RECORD_VIDEO, android:MODIFY_AUDIO_SETTINGS, and winphone:ID_CAP_MICROPHONE permissions
// maps to android:ACCESS_NETWORK_STATE, and winphone:ID_CAP_NETWORKING permissions
// maps to VIBRATE permission
// maps to winphone:ID_CAP_IDENTITY_DEVICE permission

Example Usage

<?xml version="1.0" encoding="UTF-8" ?>
    <widget xmlns   = ""
        xmlns:gap   = ""
        id          = "com.phonegap.example"
        versionCode = "10" 
        version     = "1.0.0" >

    <!-- versionCode is optional and Android only -->

    <name>PhoneGap Example</name>

        An example for phonegap build docs. 

    <author href="" email="">
        Hardeep Shoker 

      If you do not want any permissions to be added to your app, add the
      following tag to your config.xml; you will still have the INTERNET
      permission on your app, which PhoneGap requires.
    <preference name="permissions" value="none"/>

    <!-- to enable individual permissions use the following examples -->
    <feature name=""/>
    <feature name=""/>
    <feature name=""/>
    <feature name=""/>
    <feature name=""/>
    <feature name=""/>
    <feature name=""/>
    <feature name=""/>
How to solve:

A quick bit of googling returns the <feature> element to set permissions. Combined with <preference name="permissions" value="none"/> it should be exactly what you’re looking for.

Leave a Reply

Your email address will not be published. Required fields are marked *