-3

When I run flutter build apk --release I get the following error:

Execution failed for task ':app:minifyReleaseWithProguard'. > java.io.IOException: Please correct the above warnings first.

When I run flutter build apk --debug or flutter build apk --profile, everything compiles fine.

I posted my log, my Flutter doctor, my pub spec.yaml file and my build.gradle file on Github.

Has anyone an idea, why this could be?

UPDATE: This question is very similar to mine, but the suggested solution doesn't works for me. The Post

Okay I found a post on a website, but I'm not sure if I understand what I says... The author had the same error and fixed it by setting the CompileSdkVersion higher on a plug in.

Here is the post

How would your do that? And how can I know which Number I have to change? Sorry for dumb questions like that, I'm really new to flutter and dart.

Jason Aller
  • 3,541
  • 28
  • 38
  • 38
Boothosh81
  • 387
  • 1
  • 5
  • 24
  • Can you try this change compileSdkVersion 28, minSdkVersion 21, targetSdkVersion 30 – Ravindra S. Patil Jul 19 '21 at 17:46
  • Same error... :( – Boothosh81 Jul 19 '21 at 17:52
  • But thanks for your quick idea – Boothosh81 Jul 19 '21 at 17:59
  • Does this answer your question? [Execution failed for task ':app:transformClassesAndResourcesWithProguardForRelease'. > java.io.IOException: Please correct the above warnings first](https://stackoverflow.com/questions/38984045/execution-failed-for-task-apptransformclassesandresourceswithproguardforrelea) – OMi Shah Jul 19 '21 at 19:15
  • Thanks for your suggestion: The question seems really different, but the suggested solution did unfortunately not work for me :( – Boothosh81 Jul 19 '21 at 19:52

1 Answers1

0

Okay so I didn't find a way to solve this error...

My Solution:

  1. I copied the /lib-folder of my flutter project, where all my Code was stored.
  2. I copied the code in my pubspec.yaml-file.
  3. Then I created a new empty flutter project, and deleted the /lib-folder.
  4. Finally, I pasted in my old /lib-folder, pasted in the pubspec.yaml-code (into my new pubspec.yaml-file) and run flutter pub get.

Now my project works fine again and flutter build apk --release don't throws an error anymore.

Boothosh81
  • 387
  • 1
  • 5
  • 24