Android 疑难杂症

1、在某些Android10手机上申请权限(如WRITE_EXTERNAL_STORAGE),尽管点击授权,但是回调返回值是-1,导致实际上使用不了对应的权限功能。需要修改如下:

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

to

<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" tools:node="replace" />

同时加上android:requestLegacyExternalStorage="true"
ref:https://developer.android.com/studio/build/manifest-merge?hl=zh-cn
https://stackoverflow.com/questions/61140976/required-permission-was-denied-when-requesting-write-external-storage

你可能感兴趣的:(android,android)