0

I want to get permissions at install time in my Android application. For this reason, I had to downgrade the targetsdk from 27 to 22. Currently, my build.gradle information is as follows:

minSDK 17 
targetSdkVersion 22
compileSdkVersion 27
buildToolsVersion '27.0.0'

and in my application, these libraries have been used:

compile 'com.android.support:appcompat-v7:27.0.1'
compile 'com.android.support:design:27.0.1'
compile 'com.android.support:support-v4:27.0.1'
compile 'com.android.support:recyclerview-v7:27.0.1'

The problem is that it is not installed on my Android 8.1 (Pixel phone), but on other phones there is no problem with the lower Android versions.

Floern
  • 33,559
  • 24
  • 104
  • 119
lara
  • 1
  • 4
  • If you are upgrading an App which is already on store with target>22 then you can't do that. If not What error you getting on Pixel during installation ? – ADM Jan 05 '18 at 13:06
  • `it is not installed on my Android 8.1(pixel phone)` share your crash log than – AskNilesh Jan 05 '18 at 13:06
  • 4
    "i want get permissions at installing time in my android application.For this reason, I had to downgrade the targetsdk from 27 to 22" -- bear in mind that [you will not be able to ship updates to your app on the Play Store starting later in 2018](https://android-developers.googleblog.com/2017/12/improving-app-security-and-performance.html). – CommonsWare Jan 05 '18 at 13:09

1 Answers1

0

You can't request permission at install time, this is outdated, because it was used like in 5.x and less versions of Android, now you need to request permissions inside the app

the user grants the permission either when they install the app (on Android 5.1.1 and lower) or while running the app (on Android 6.0 and higher).

https://developer.android.com/training/permissions/declaring.html

halfer
  • 19,824
  • 17
  • 99
  • 186
Gastón Saillén
  • 12,319
  • 5
  • 67
  • 77