Skip to content

Snappy1

  • Home
  • Android
  • What
  • How
  • Is
  • Can
  • Does
  • Do
  • Why
  • Are
  • Who
  • Toggle search form

[FIXED] android – Build not succed in flutter

Posted on November 11, 2022 By

Solution 1 :

Not sure what is the issue but as per the error logs, you have to remove all the unused resource from code and then you have to set in gradle.

android {
...
buildTypes {
    release {
        shrinkResources true
        minifyEnabled true
        proguardFiles getDefaultProguardFile('proguard-android.txt'),
                'proguard-rules.pro'
    }
}}

Also, if you will remove unused resouces, It will reduce the size of the iOS build.

Happy coding…

Problem :

when i try flutter build apk –release , i get following error

FAILURE: Build failed with an exception.                                

* Where:                                                                
Build file 

'/Users/flutter/Documents/project_name/android/
build.gradle' line: 27

* What went wrong:                                                      
A problem occurred evaluating root project 
'android'.                   
> A problem occurred configuring project ':app'.                        
> Removing unused resources requires unused code 
shrinking to be turned on. See 
http://d.android.com/r/tools/shrink-resources.html 
for more information.

* Try:                                                                  
Run with --stacktrace option to get the stack 
trace. Run with --info or --debug option to get 
more log output. Run with --scan to get full 
insights.

* Get more help at https://help.gradle.org                              

BUILD FAILED in 33s   

When i build for ios, i gets output. but having very large size around 400 mb.

How to resolve all these issues…….

Comments

Comment posted by project ed500

thanks man , it works for android. but it is only for android, right? so how it reduce size of ios build

Comment posted by Pratik Satani

Yes, correct. But after removing unused resources, you can also reduce the size of ios build.

READ  [FIXED] android - How to keep Kotlin property syntax when defining an Interface?
Powered by Inline Related Posts
Android Tags:android, flutter, ios

Post navigation

Previous Post: [FIXED] java – The Android LoaderManager is deprecated. Now what?
Next Post: [FIXED] android – Is WorkManager the right solution for me?

Related Posts

[FIXED] kotlin – How to minimize “very long vector path” in android vector drawable files Android
[FIXED] horizontal scrolling – How can scroll calendar horizontally on React Native like Way of Life App. you can see a video by the link Android
[FIXED] android – After scanning the QR code normally, it stops running and cannot display the scanned content: Android
[FIXED] android – How to check if a string has a specified character? Android
[FIXED] flutter – Jump to source android studio on windows not working Android
[FIXED] android – Problem with Kotlin Generics in a ListAdapter Android

Archives

  • March 2023
  • February 2023
  • January 2023
  • December 2022
  • November 2022
  • October 2022
  • September 2022

Categories

  • ¿Cómo
  • ¿Cuál
  • ¿Cuándo
  • ¿Cuántas
  • ¿Cuánto
  • ¿Qué
  • Android
  • Are
  • At
  • C'est
  • Can
  • Comment
  • Did
  • Do
  • Does
  • Est-ce
  • Est-il
  • For
  • Has
  • Hat
  • How
  • In
  • Is
  • Ist
  • Kann
  • Où
  • Pourquoi
  • Quand
  • Quel
  • Quelle
  • Quelles
  • Quels
  • Qui
  • Should
  • Sind
  • Sollte
  • Uncategorized
  • Wann
  • Warum
  • Was
  • Welche
  • Welchen
  • Welcher
  • Welches
  • Were
  • What
  • What's
  • When
  • Where
  • Which
  • Who
  • Who's
  • Why
  • Wie
  • Will
  • Wird
  • Wo
  • Woher
  • you can create a selvedge edge: You can make the edges of garter stitch more smooth by slipping the first stitch of every row.2022-02-04
  • you really only need to know two patterns: garter stitch

Recent Posts

  • What is a good substitute for condensed milk?
  • ¿Como el cuerpo te avisa cuando te va a dar un infarto?
  • What is the luxury brand of Jaguar?
  • Who is Big poppa baseball player?
  • What material are foam runners?

Recent Comments

No comments to show.

Copyright © 2023 Snappy1.

Powered by PressBook Grid Dark theme