Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Google play APK upload error Duplicate declarations of permission

I have tried to upload new apk (signed with my own relese key store), and got follwing error in google play developer console.

Duplicate declarations of permission android.permission.ACCESS_COARSE_LOCATION with different maxSdkVersions.

However previously I was able to upload APK fine without any error, I did not do eny change releted to permissions, so this is strange issue, I have searched on google and could not find workable solution. Is this because of new update on google play developer console ?

Manifest permission declarations enter image description here

Gradle dependancies

compile 'com.google.android:annotations:4.1.1.4'
compile 'com.google.android.gms:play-services-location:9.4.0'
compile "com.google.android.gms:play-services-gcm:9.4.0"
compile 'com.google.android.gms:play-services-places:9.4.0'
compile 'com.google.android.gms:play-services-maps:9.4.0'
compile 'com.google.android.gms:play-services-auth:9.4.0'
compile 'com.google.android.gms:play-services-plus:9.4.0'
compile 'com.google.android.gms:play-services-appindexing:9.4.0'
compile 'com.google.android.gms:play-services-wallet:9.4.0'
compile 'com.google.zxing:core:2.2'
compile('com.facebook.android:facebook-android-sdk:4.17.0') {
    exclude group: 'com.android.support', module: 'support-v4'
    exclude group: 'com.android.support', module: 'appcompat-v7'
}
compile 'com.android.support:recyclerview-v7:24.2.0'
compile('com.twitter.sdk.android:twitter:1.12.0@aar') {
    transitive = true;
    exclude group: 'com.android.support', module: 'appcompat-v7'
    exclude group: 'com.android.support', module: 'support-v4'
}
compile 'com.android.support:appcompat-v7:24.2.0'
compile 'com.android.support:multidex:1.0.1'
compile 'com.android.support:cardview-v7:24.2.0'
compile 'com.android.support:design:24.2.0'

Merged manifest enter image description here

like image 853
Dinesh Anuruddha Avatar asked Nov 17 '25 01:11

Dinesh Anuruddha


1 Answers

I had the same issue. Probably you are using a third party library that declare ACCESS_COARSE_LOCATION for api level equal or greater than 23. In order to solve this problem you can split the permission in manifest. Just replace this line with your existing uses permission line:

<uses-permission
  android:name="android.permission.ACCESS_COARSE_LOCATION"
  android:maxSdkVersion="22"/>

Warning: Be careful that if the third-party library change/remove this permission, your app won't work for api level 23 and higher. So you should check your apk before upload to make sure it works fine

like image 175
Ali Mehrpour Avatar answered Nov 18 '25 16:11

Ali Mehrpour



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!