Unwanted android.permission.GET_ACCOUNTS

Hi all,

After updating to the latest cordova cli (1.7.13), building stopped working.
So I had to do a
ionic state reset

What a mistake! It removes half of my plugins.
It has been a big hassle to get them back clean, but it’s okay now.

However, now that I build, an unwanted and unneeded android permission keeps adding to my androidmanifest !!
the android.permission.GET_ACCOUNTS, which is quite an invasive one.

I cannot get rid of it! If I remove it from the manifest, it comes back after building the app.

Here is my list of plugins:

cc.fovea.cordova.purchase 4.0.0 "Purchase"
com.ionic.keyboard 1.0.4 "Keyboard"
com.jcjee.plugins.emailcomposer 1.4.6 "Email Composer with Attachments"
com.phonegap.plugins.PushPlugin 2.5.0 "PushPlugin"
com.telerik.plugins.nativepagetransitions 0.5.5 "Native Page Transitions"
cordova-plugin-android-support-v4 21.0.1 "Android Support v4"
cordova-plugin-app-version 0.1.8 "AppVersion"
cordova-plugin-camera 1.2.0 "Camera"
cordova-plugin-console 1.0.2 "Console"
cordova-plugin-facebook4 1.3.0-0 "Facebook Connect"
cordova-plugin-globalization 1.0.2-dev "Globalization"
cordova-plugin-themeablebrowser 0.2.12 "ThemeableBrowser"
cordova-plugin-whitelist 1.0.0 "Whitelist"
cordova-plugin-x-socialsharing 5.0.7 "SocialSharing"
cordova-plugin-x-toast 2.2.1 "Toast"
ionic-plugin-deploy 0.4.1 "IonicDeploy"
ionic-plugin-keyboard 1.0.8 "Keyboard"
onesignal-cordova-plugin 1.9.0 "OneSignal Push Notifications"
org.apache.cordova.device 0.3.0 "Device"
org.apache.cordova.inappbrowser 0.6.0 "InAppBrowser"
org.apache.cordova.splashscreen 1.0.0 "Splashscreen"
org.apache.cordova.statusbar 0.1.10 "StatusBar"

Any help would be much appreciated!

I found the solution, for those who might be interested.

In the android.json file (located under patforms/android/), there was an added line:

 "/manifest": [
                {
                    "xml": "<uses-permission android:name=\"android.permission.GET_ACCOUNTS\" />",
                    "count": 1
                },

Removing that get account part solved it.

Hello My Friend . I know you have solved this issue . But now the android apk deployment policy has been changed drastically .

All the permission you are using in you app you should add it in the ANdroidManifest.xml file as

<manifest xmlns:android="http://schemas.android.com/apk/res/android"
      package="org.apache.cordova" android:versionName="1.0" android:versionCode="1">
    <uses-sdk android:minSdkVersion="19" />

  <uses-permission android:name="android.permission.INTERNET" />
  <uses-permission android:name="android.permission.GET_ACCOUNTS" />
  <uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
  <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
</manifest>

For more information
Click Here

It is not possible as it will overlap every time you will build your ionic project .