Skip to content

Instantly share code, notes, and snippets.

@minhcasi
Last active April 25, 2024 02:33
Show Gist options
  • Star 50 You must be signed in to star a gist
  • Fork 17 You must be signed in to fork a gist
  • Save minhcasi/2362b8ed369738cea2bf10a57ac569e1 to your computer and use it in GitHub Desktop.
Save minhcasi/2362b8ed369738cea2bf10a57ac569e1 to your computer and use it in GitHub Desktop.
These are common issues on Flutter and solutions to fix

Quick Clean Cache

  1. Open android studio Tools->Flutter->Clean
  2. Go to File -> Invalidate Caches / Restart
  3. Or open terminal run "flutter clean"
  4. Remove pubspec.lock
  5. Double check the Flutter SDK Path config correcty - https://tppr.me/qn6dP

Or open the terminal and try this script:

flutter clean
flutter pub cache repair
flutter pub get

Rebuild the project again

Update Flutter to Channel Stable

  1. Open termimal on Mac or CommandLine on Window:
    flutter channel stable
    flutter upgrade --force
    
  2. Also run "flutter doctor" and fix all the issues
  3. Update the Flutter SDK Path from Android Studio - https://tppr.me/qn6dP

Fix build issue on iOS

  1. Remove following files and folders (see this screenshot - https://tppr.me/vwqX0 )

    - Go to ios: remove Pods folder, Podfile and fodfile.lock, .symlink folder (this folder is hidden)
    - remove build folder
    
  2. Open XCode, File > Workspace Settings > Select 'New Build System' - https://tppr.me/CRHLC

  3. Open terminal (at ios folder) and run:

    pod cache clean --all
    pod repo update
    pod install
    
    // if you are using Fluxstore try to run 
    pod update OneSignal
    
  4. Open Android Studio and run the green button - https://tppr.me/h3aTb

Fix build issue on Android

  1. Go to to android folder and run
// mac os
./gradlew clean

// window os
gradlew.bat clean
  1. Go to android folder and remove the .grade hidden folder
  2. Go the Android Studio and run the project again.

Issue: "Registered as a Git root, but no Git repositories were found there" or "This package referenced a Flutter repository via the .packages file that is no longer available."

Solution:

  1. Delete .packages file and .idea hidden folder.
  2. Run following command flutter pub get or click the Pub get when open Pubspec.yaml file on Android Studio

Xcode 11.4 changed the way frameworks are linked and embedded, and you may experience issues switching between iOS devices and simulators. Flutter v1.15.3 and later will automatically migrate your Xcode project

Please follow the guide from this link: https://flutter.dev/docs/development/ios-project-migration

@minhcasi
Copy link
Author

@oppoletech - update the latest version will fix the issue - thanks

@HassanChmsdn
Copy link

I did this to make it work:

Once you run flutter build ios a Podfile and Podfile.lock will be created for you in the ios directory.

@somanath123
Copy link

Showing Recent Issues
/Users/mac/Documents/Developer/FluxStore-woo 1.7.5/source/ios/Flutter/Release.xcconfig:2: could not find included file 'Generated.xcconfig' in search paths

@dreamtouchapp
Copy link

FAILURE: Build failed with an exception.

  • What went wrong:
    Could not determine the dependencies of task ':app:compileDebugJavaWithJavac'.

Could not resolve all task dependencies for configuration ':app:debugCompileClasspath'.
Could not resolve com.google.firebase:firebase-iid:[20.0.1].
Required by:
project :app > com.google.firebase:firebase-messaging:20.0.1
> Failed to list versions for com.google.firebase:firebase-iid.
> Unable to load Maven meta-data from https://dl.google.com/dl/android/maven2/com/google/firebase/firebase-iid/maven-metadata.xml.
> org.xml.sax.SAXParseException; lineNumber: 1; columnNumber: 1; Content is not allowed in prolog.

please help

@davidAg9
Copy link

app release shows a launch screen and its stuck there

@hengsoheak
Copy link

Me too
app release shows a launch screen and its stuck there

@vaguemind
Copy link

app release shows a launch screen and its stuck there ?! did anyone fixed this ?!! i face this issue too !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment