In Flutter app development, adding permissions to the manifest file is one of those tasks that is easy to forget but must always be done. The app’s behavior during debugging may differ from when testing the app on actual devices after deployment. In such cases, forgetting to add permissions accounts for a large proportion of error and bug causes, so it’s essential to understand permissions.
The manifest file is “AndroidManifest.xml” and is located at a path like this:
flutter_application_2\android\app\src\main\AndroidManifest.xml
If you’re unfamiliar with Android app development, you might be confused about where to insert permissions in the manifest file. Add permissions to the manifest file as follows:
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.flutter_application_2">
<!-- added -->
<uses-permission android:name="android.permission.ACCESS_WIFI_STATE" />
<uses-permission android:name="android.permission.VIBRATE" />
<uses-permission android:name="android.permission.RECORD_AUDIO" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<application
android:name="io.flutter.app.FlutterApplication"
..
</manifest>
(References)
Manifest.permission | Android Developers android - How to add manifest permission to an application? - Stack Overflow