简体   繁体   中英

Permissions in AndroidManifest.xml are ignored in Flutter

In my Flutter application I need to use microphone. As I test application in emulator in myproject/android/app/src/debug/AndroidManifest.xml I have:

<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    package="temp.myproject.myproject">
    <uses-permission android:name="android.permission.INTERNET"/>
    <uses-permission android:name="android.permission.RECORD_AUDIO"/>
</manifest>

However, my application still doesn't have permission to use microphone. So, I need to use permission_handler library to make it work:

Map<Permission, PermissionStatus> statuses = await [Permission.microphone].request();

I thought that adding uses-permission.. in AndroidManifest is enough, but it doesn't work without permission_handler . Could anyone explain why, or what I do/understand wrong.

You can uninstall the app and install it again on your physical or emulator device, in order make sure that the app is running from fresh install, and to make sure that the AndroidManifest is re-register into the device

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM