Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
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

@opooletech

This comment has been minimized.

Copy link

@opooletech opooletech commented Mar 21, 2020

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 find any matches for com.onesignal:OneSignal:[3.11.2,3.99.99] as no versions of com.onesignal:OneSignal are available.
Required by:
project :app
Could not find any matches for com.onesignal:OneSignal:[3.11.2,3.99.99] as no versions of com.onesignal:OneSignal are available.
Required by:
project :app > project :onesignal_flutter

  • 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 35s
Finished with error: Gradle task assembleDebug failed with exit code 1

@minhcasi

This comment has been minimized.

Copy link
Owner Author

@minhcasi minhcasi commented Mar 24, 2020

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

@HassanChmsdn

This comment has been minimized.

Copy link

@HassanChmsdn HassanChmsdn commented Mar 27, 2020

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

This comment has been minimized.

Copy link

@somanath123 somanath123 commented Jul 2, 2020

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

This comment has been minimized.

Copy link

@dreamtouchapp dreamtouchapp commented Aug 3, 2020

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.