brook yonas
brook yonas

Reputation: 526

flutter app api calls never returns in release mode

my flutter app works on debug mode getting data from api and all. but after I built the app in release mode and try to open it on my actual phone. It is not working getting the data from the api.

Things I have tried:

  1. <uses-permission android:name="android.permission.INTERNET" /> and android:usesCleartextTraffic="true" //added in AndroidManifest.xml

  2. flutter clean and flutter build apk --release and flutter build apk --split-per-abi --no-sound-null-safety

  3. added shrinkResources and minifyEnabled in android/app/build.gradle file.

    buildTypes {
    release {
     signingConfig signingConfigs.config
     shrinkResources false //here
     minifyEnabled false //here
    }
    

    }

Any help is appreciated

Upvotes: 1

Views: 3219

Answers (2)

daniel_c
daniel_c

Reputation: 93

check your internet permission tag in android manifest.xml, just above the application tag.

<uses-permission android:name="android.permission.INTERNET" />

Upvotes: 3

MohitJadav
MohitJadav

Reputation: 954

If you wanted to find your error run it on direct release mode it can show what is cussing the error/crash

Menu->Run->ReleaseMode enter image description here

Upvotes: 2

Related Questions