Skip to content
Advertisement

java.lang.ExceptionInInitializerError when running flutter release mode

My flutter app works fine in debug mode. But, when I run it with flutter run --release I am getting the following error.

JavaScript

I’ve tried some ways like upgrading gradle, upgrading some dependencies to latest versions. But still it’s not solved. Can you give any ideas on how to solve this?

Advertisement

Answer

I am using flutter and , I have found solution.

There are some steps , you must do, please follow correctly:

STEP 1:

In /Android/app folder:

find below files: proguard-android.txt proguard-rules.pro

if they are not exists create them, with same name.

STEP 2:

Paste this code into both files (proguard-android.txt and proguard-rules.pro):

JavaScript

STEP 3:

in /Android/app/build.gradle make sure that, theese lines have added:

JavaScript

STEP 4:

in terminal of Android Studio

JavaScript

then

JavaScript

after theese steps it must work.

Advertisement