eclipse - Migrated to Android Studio - now my app requests additional permissions -


i migrated app eclipse android studio. tried exporting signed apk , uploaded google play check working.

that's when noticed app requests 2 additional permissions except ones have declared in manifest! 2 permissions android.permission.wake_lock , com.google.android.c2dm.permission.receive.

what's going on here? haven't changed code since last time uploaded app, , manifest doesn't declare these permissions. i'm guessing google component responsible this, why did happen because migrated android studio? can turn off these permissions?

i'm using google play services , google admob, i've been doing long time without these permissions...

 

manifest.xml

<?xml version="1.0" encoding="utf-8"?> <manifest xmlns:android="http://schemas.android.com/apk/res/android"       package="com.example.app"       android:versioncode="70"       android:versionname="7.0" >      <uses-permission android:name="android.permission.internet"/>     <uses-permission android:name="android.permission.access_network_state" />     <uses-permission android:name="android.permission.write_external_storage"/>     <uses-permission android:name="com.android.vending.check_license" />      <uses-sdk          android:minsdkversion="10"         android:targetsdkversion="23" />      <application android:name="com.example.app.myapplication"                  android:icon="@mipmap/ic_launcher_icon"                   android:label="@string/app_name"                   android:allowbackup="true"                  android:uioptions="none">          <meta-data android:name="com.google.android.gms.version" android:value="@integer/google_play_services_version" />           <activity android:name="com.example.app.mainactivity"                   android:label="@string/app_name"                   android:theme="@style/theme.mytheme.app"                   android:windowsoftinputmode="adjustpan" >                      <intent-filter>                         <action android:name="android.intent.action.main" />                         <category android:name="android.intent.category.launcher" />                     </intent-filter>         </activity>          <activity                        android:name="com.example.app.otheractivity"             android:label="@string/otheractivitytitle"             android:theme="@style/theme.mytheme.app"             android:parentactivityname="com.example.app.mainactivity" >              <meta-data                 android:name="android.support.parent_activity"                 android:value="com.example.app.mainactivity" />                                          </activity>                               <activity             android:name="com.example.app.preferencesactivity"             android:label="@string/prefstitle" >                     </activity>                               <activity android:name="com.google.android.gms.ads.adactivity"             android:configchanges="keyboard|keyboardhidden|orientation|screenlayout|uimode|screensize|smallestscreensize"             android:theme="@android:style/theme.translucent" />       </application> </manifest> 

 

here's screenshot of apk built using android studio:

enter image description here

i couldn't change language english, says it's supporting 22 less devices, requires 2 new permissions , uses opengl 2.0+ instead of 1.0+.

here's screenshot of same apk built using eclipse:

enter image description here

after more searching found thread on stackoverflow: android studio adds unwanted permission after running application on real device.

one of answers there (not accepted one) solved issues. seems android studio import process added dependency build.gradle:

compile 'com.google.android.gms:play-services:+' 

after changing to

compile 'com.google.android.gms:play-services-base:8.4.0' // needed api availability test compile 'com.google.android.gms:play-services-ads:8.4.0' compile 'com.google.android.gms:play-services-analytics:8.4.0' 

the apk no longer requests unwanted permissions, targets same devices before , uses same opengl version before - i.e. way eclipse! except file size of apk 1 mb smaller added bonus!

for people coming here in future, might want investigate google play services version numbers should use @ gradle, please and/or setting google play services.


Comments

Popular posts from this blog

Delphi XE2 Indy10 udp client-server interchange using SendBuffer-ReceiveBuffer -

Qt ActiveX WMI QAxBase::dynamicCallHelper: ItemIndex(int): No such property in -

Enable autocomplete or intellisense in Atom editor for PHP -