When using ZIM SDK, packaging a release version of Android apk under the Flutter framework, after installing on a real device, unable to request network, how should this be handled?
Problem Cause
When developing Flutter applications on the Android platform, network permissions are not requested. The basic functions of the SDK can only be used when connected to the network.
Solution
Please follow the steps below to handle this:
-
Go to the "app/src/main" directory, open the "AndroidManifest.xml" file, and add the following permissions under the
<manifest></manifest>tag.Please note that do not place it in the
<application></application>tag.<uses-permission android:name="android.permission.INTERNET" /> <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" /> <uses-permission android:name="android.permission.ACCESS_WIFI_STATE" />
-
Re-run the packaging, install on the real device, and you can request the network normally.
