androidflutterandroid-studioflutter-androidwebview-flutter

flutter build apk --release build the apk file but it give error after installing on Android


I have converted google website into Web app for android using webview_flutter: ^1.0.7 package when I run the code in my physical device by making it external emulator the app work perfectly but when I build the APK using flutter build apk --release I got the the APK file and when I install the APK after opening the application it say Web page not available you can see the image below. I think it was not able to connect through internet enter image description here

and when I install the app by making my device emulator it run perfectly you can see below

enter image description here

if you need more information regarding this please comment.


Solution

  • android\app\src\main\AndroidManifest.xml Add internet permission

    examble :

    <manifest xmlns:android="http://schemas.android.com/apk/res/android"
        package="com.example.test">
    
        <uses-permission android:name="android.permission.INTERNET" /> // add this line
    
       <application
            android:label="test1"
            android:name="${applicationName}"
            android:icon="@mipmap/ic_launcher">
    

    Visit this page for more information INTERNET PERMISSION