3

My app has only one declared permission in the manifest, and that is for internet to display ads.

<uses-permission 

android:name = "android.permission.INTERNET" />

For some reason, the play store gives the message that my app needs permission for identity and contacts:

enter image description here

Those are the permissions shown on the play store website. When downloading the app on a phone it only says it needs identity. My question is, why are all of these permissions stated, even though all I am using is Internet for the ads?

Thanks so much,

Ruchir

EDIT:

Build.Gradle file:

apply plugin: 'com.android.application'

android {
    compileSdkVersion 23
    buildToolsVersion "23.0.2"
    defaultConfig {
        applicationId "com.CurlyBrace.ruchir.TileTap"
        minSdkVersion 16
        targetSdkVersion 23
        versionCode 1
        versionName "1.0"
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }
    productFlavors {
    }
}

dependencies {
    compile fileTree(include: ['*.jar'], dir: 'libs')
    testCompile 'junit:junit:4.12'
    compile 'com.android.support:appcompat-v7:23.1.1'
    compile 'com.android.support:design:23.1.1'
    compile 'com.google.android.gms:play-services:8.3.0'
}

PS: Just saying I don't know much about what this file does, so an explanation would also be nice!

Ruchir Baronia
  • 7,406
  • 5
  • 48
  • 83
  • 3
    It's possible other permissions came from your dependencies. – Aaron He Jan 28 '16 at 02:10
  • @AaronHe I barely know what a dependency is. I have spent some time trying to figure it out, but there isn't much online about it. Do you mind explaining? Thanks so much Aaron! – Ruchir Baronia Jan 28 '16 at 02:12
  • 1
    It's just the libraries you are using for the app. :) – Aaron He Jan 28 '16 at 02:16
  • @AaronHe This may seem like a stupid question, but how do I know which libraries I am using? And, how can I remove these extra permissions? Feel free to provide an answer also! Thanks Aaron! :) – Ruchir Baronia Jan 28 '16 at 02:20
  • @RuchirBaronia Share your Android Manifest file and your build.gradle file. They will carry this information. – Shamas S Jan 28 '16 at 02:22
  • @ShamasS I have edited with `build.gradle` – Ruchir Baronia Jan 28 '16 at 02:27
  • @AaronHe I have edited with `build.gradle` – Ruchir Baronia Jan 28 '16 at 02:27
  • Possible duplicate of [Android studio adds unwanted permission after running application on real device](http://stackoverflow.com/questions/30546197/android-studio-adds-unwanted-permission-after-running-application-on-real-device) – Shamas S Jan 28 '16 at 02:31
  • @ShamasS Thanks so much Shamas, but that didn't help, and I actually already came across that post. I am not getting a location permission – Ruchir Baronia Jan 28 '16 at 02:33
  • @RuchirBaronia sorry to hear about that, also thanks for being a sport. :) play-services is a huge pack of library and you don't need to add the full pack. Instead you should add only the library components that you actually need. For example, if you only use `google-fit`, instead of importing entire play-services, you should only add `com.google.android.gms:play-services-fitness:8.4.0` hope it helps you troubleshoot. – Shamas S Jan 28 '16 at 02:38
  • @ShamasS Ohh okay, that clears things up a lot for me! Thanks so much for that information. Do you, by any chance, know what I would add for just advertisements. I don't want to overwhelm my users with random permissions. It's a bit hard for me to figure all of this out because I don't really understand what the `build.gradle` file does, and I'm also a bit unclear on libraries and dependencies, lol. Please let me know. Also, if you want, feel free to post an answer ;) Thanks Shermas! – Ruchir Baronia Jan 28 '16 at 02:45
  • @RuchirBaronia Sorry my bad. For ads you can use `com.google.android.gms:play-services-ads:8.4.0`. You can find details for other services at https://developers.google.com/android/guides/setup You mention all your dependencies (libraries your project depends upon and uses) in your`build.gradle` in `dependencies` section. Some of these libraries will ask for permissions to run properly and would show up in your app's permissions as well. – Shamas S Jan 28 '16 at 02:50
  • Let me know if only using `play-servcies-ads` fixes your permissions, then I will post this as an answer. – Shamas S Jan 28 '16 at 02:51
  • @ShamasS How will I know if it fixed my permissions. I will first have to update my app and then check, right? Also, how are libraries used? Thanks so much! – Ruchir Baronia Jan 28 '16 at 02:53
  • @RuchirBaronia Once you update it, install it on device or emulator and run commands mentioned at this post http://stackoverflow.com/questions/21091022/listing-permissions-of-android-application-via-adb. The un needed permissions that you were getting earlier should no longer come up. – Shamas S Jan 28 '16 at 03:00
  • @ShamasS Ok, it worked. But, after changing the Play Service version, android studio gave me a warning saying that I can't update the existing application, and I must uninstall it. So, can I still release the new APK? – Ruchir Baronia Jan 28 '16 at 03:42

1 Answers1

1

It's possible other permissions come from the app dependencies(libraries you are using for the app).

To know where those permissions come from, you may take a look at the manifest merger report file. The file path looks like app/build/outputs/logs/manifest-merger-debug-report.txt. Look for those MERGED from items.

I guess most of your permissions are from Google Play Services.

Aaron He
  • 5,509
  • 3
  • 34
  • 44
  • Wow...thats a big file. SO I found the merged from parts of the file. Now what? – Ruchir Baronia Jan 28 '16 at 02:37
  • @RuchirBaronia lol. Play services can be setup selectively. Add parts of the Play services you really need. See: https://developers.google.com/android/guides/setup – Aaron He Jan 28 '16 at 02:40
  • Alright I am looking for how to set it up for only ads. But, I'm still kind of confused on libraries and dependencies. I have searched the internet about this topic for lots of time, but I never seem to find anything. Do you mind explaining a bit? Thanks Aaron! :) – Ruchir Baronia Jan 28 '16 at 02:47
  • Also, should I replace `compile 'com.google.android.gms:play-services:8.3.0'` with `com.google.android.gms:play-services-ads:8.4.0`? – Ruchir Baronia Jan 28 '16 at 02:49
  • @RuchirBaronia Dependency/library just a little help from other friends. Like why are you using `ads`? You need to display ads, but it's too much to do on your own. :) – Aaron He Jan 28 '16 at 02:55
  • I just updated my play services. So should I just make it 8.4.0? Is that the latest version? How do I know?\ – Ruchir Baronia Jan 28 '16 at 02:57
  • So libraries just come with new classes that you can use to complete tasks easier? – Ruchir Baronia Jan 28 '16 at 02:58
  • @RuchirBaronia check release notes: https://developers.google.com/android/guides/releases. And yes. – Aaron He Jan 28 '16 at 02:59
  • What is the purpose of the gradle files? – Ruchir Baronia Jan 28 '16 at 03:37
  • And are libraries, packages (install from sdk), and dependencies all the same thing? Thanks! – Ruchir Baronia Jan 28 '16 at 03:38