Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

when added to gradle it put a MAX SDK #2

Closed
defaultbr opened this issue Jul 14, 2017 · 5 comments
Closed

when added to gradle it put a MAX SDK #2

defaultbr opened this issue Jul 14, 2017 · 5 comments

Comments

@defaultbr
Copy link

defaultbr commented Jul 14, 2017

but when this library is added at my app gradle the manifest became this:

 <uses-permission
        android:name="android.permission.WRITE_EXTERNAL_STORAGE"
        android:maxSdkVersion="18" />
    <uses-permission
        android:name="android.permission.READ_EXTERNAL_STORAGE"
        android:maxSdkVersion="18" />

maxSdkVersion added by FaceDetector

the maxSdkVersion is not necessary for me, since most of all my users use sdk 19+

@defaultbr
Copy link
Author

@dmitry-zaitsev
Copy link
Member

android:maxSdkVersion in the context of uses-permission means that this permission is required only for devices which are using API level 18 or lower. It is not the same as maxSdkVersion which limits the maximum API version on which app can run.

@defaultbr
Copy link
Author

I understood, the question is: all my devices when i add this library remove the READ/WRITE external storage permission, so i cant give it to the device (Apps -> MyApp -> Permissions) it disappear from the list

@Diolor
Copy link
Member

Diolor commented Jul 21, 2017

Actually that right. android:maxSdkVersion="18" will be added in the merged Manifest. So if you need to use <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/> this will break the app on 19+ SDKs when trying access non-app directories

@dmitry-zaitsev
Copy link
Member

You can also use manifest merger options to force your app to overrule library's flags: https://developer.android.com/studio/build/manifest-merge.html

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants