Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Flutter release apk not working correcty but debug app works fine

Tags:

flutter

dart

I've built simple meme/photo editor app using flutter.It is working perfectly in debug mode but It's not working in release mode.There is a container in my app which is used to show user image loaded using image picker.When I select image in debug app it's showing but when tried it in release version It shows only a blank container and also it alignments are changed.I've tried flutter clean and have added the Internet permission to manifest file.But nothing correct that issue.

Also I've tried app bundle and split apks but Issue is remaining.Is there any method to generate and upload debug apk to playstore without getting any security issues?

This is the part with issues...It is working correctly in debug but not in release mode.

 Center(child: Stack(
           children: <Widget>[
             _image != null ?  Expanded(
                       child: Container(
                       child: Image.file(
                        _image,
                        height: 400,
                        width: 400,
                        fit: BoxFit.cover,),
                              ),
                            )
like image 400
Axen_Rangs Avatar asked Oct 29 '25 19:10

Axen_Rangs


2 Answers

By what you've shared (which is not a lot) I can assume you've missed adding the INTERNET permission on the main manifest.

Usually 3 manifests are created. Open your android/app/src folder, you'll see 3 subfolders:

  • debug
  • profile
  • main

It's easy to be mistaken and put the permission in the wrong Manifest, I've been there some times!

like image 109
magicleon94 Avatar answered Oct 31 '25 09:10

magicleon94


It's probably because your app requires internet connection, but you haven't specified this permission in your AndroidManifest.xml file at: YOUR_PROJECT/android/app/src/main/AndroidManifest.xml

Confirm whether the internet permission is enabled.

Before:

<manifest xmlns:android="http://schemas.android.com/apk/res/android">
<application...

Now:

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

I hope this helps.

like image 38
Abdullah Opadeji Avatar answered Oct 31 '25 08:10

Abdullah Opadeji



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!