Home > Enterprise >  Web Page Not Available error on Release mode in flutter
Web Page Not Available error on Release mode in flutter

Time:08-01

I am using url_launcher package to open a Hyper Link when I press a button.

The problem is that in Debug Mode it works fine and shows the webpage while in Release Mode, it shows that the page is not found error.

I have added the internet permission on AndroidManifest.xml file. in the following path android/app/src/profile/AndroidManifest.xml.

Like the following:

<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    package="com.example.gtu_marks">
    <!-- The INTERNET permission is required for development. Specifically,
             the Flutter tool needs it to communicate with the running application
             to allow setting breakpoints, to provide hot reload, etc.
    -->
    <uses-permission android:name="android.permission.INTERNET"/>
</manifest>

For hyper link my code is:

Container(
   margin: EdgeInsets.only(left: 20, top: 10),
   height: 60,
   width: 60,
   // color: Colors.white,
   child: IconButton(
       onPressed: () {
           launchUrlString("https://github.com/dhruv061");
       },
       icon: Image.asset("assets/icons/Github_Icone.png")
   ),
),

The that I am getting:

Error Photo

CodePudding user response:

It is not working in the Release Mode because you are adding the permission to the AndroidManifest.xml that is located inside the profile folder, which is related to the Profile Mode not Release Mode.

To fix the problem, add the Internet Permission to the AndroidManifest.xml file that is located in the main folder in the following path:

android\app\src\main\AndroidManifest.xml
  • Related