Skip to content

FlutterKerala/common-errors

Repository files navigation

Solutions to common errors for Flutter Devs

Potential errors while working with Flutter and their solutions.

01. A dependency may have only one source

ScreenShots
Logs
Running flutter pub get` in demo app
sdk: flutter
shared_prefrences: 0.5.x+y <2.0.0
.
.
.
pub get failed (65) exit code 65.

Solution 01

by @joe733

  • If you are using smoother ecosystem migration then re-check the version(s) of the plugin.
  • Replace x's and y's with recomended version numbers (for example as of 10 May 2020 the version(s) of shared preferences must be like '>=0.5.7+1' <2.0.0).
  • Check if your intendation is correct (in the screenshot the shared_preferences dependency must be aligned to flutter i.e. not within the flutter block). e.g.
dependencies:
  flutter:
    sdk: flutter
  shared_prefrences: '>=0.5.7+1 <2.0.0' # note the intendation

02. Gradle Dependency Error

ScreenShots
Logs

Solution 02

by @Adheela
Try changing the class path gradle version 1.0.0 build gradle in Android
By changing the gradle version (which is shown in the screenshot as required) in the distribution URL in gradle-wrapper.properties (in projectappgradlewrappergradle-wrapper.properties)


03. No rule to make target

ScreenShots
Logs
Launching lib/main.dart on Linux in debug mode...
Makefile:117: warning: overriding recipe for target '/home/joe/Documents/Workspace/GitHub/Flutter/LearnFlutter/flutter_kerala'
Makefile:109: warning: ignoring old recipe for target '/home/joe/Documents/Workspace/GitHub/Flutter/LearnFlutter/flutter_kerala'
Makefile:117: warning: overriding recipe for target 'weekly_challenge/week_2'
Makefile:109: warning: ignoring old recipe for target 'weekly_challenge/week_2'
Makefile:117: warning: overriding recipe for target '-'
Makefile:109: warning: ignoring old recipe for target '-'
Makefile:116: *** mixed implicit and normal rules: deprecated syntax
Makefile:121: warning: overriding recipe for target '/home/joe/Documents/Workspace/GitHub/Flutter/LearnFlutter/flutter_kerala'
Makefile:117: warning: ignoring old recipe for target '/home/joe/Documents/Workspace/GitHub/Flutter/LearnFlutter/flutter_kerala'
Makefile:121: warning: overriding recipe for target 'weekly_challenge/week_2'
Makefile:117: warning: ignoring old recipe for target 'weekly_challenge/week_2'
Makefile:121: warning: overriding recipe for target '-'
Makefile:117: warning: ignoring old recipe for target '-'
Makefile:125: warning: overriding recipe for target '/home/joe/Documents/Workspace/GitHub/Flutter/LearnFlutter/flutter_kerala'
Makefile:121: warning: ignoring old recipe for target '/home/joe/Documents/Workspace/GitHub/Flutter/LearnFlutter/flutter_kerala'
Makefile:125: warning: overriding recipe for target 'weekly_challenge/week_2'
Makefile:121: warning: ignoring old recipe for target 'weekly_challenge/week_2'
Makefile:125: warning: overriding recipe for target '-'
Makefile:121: warning: ignoring old recipe for target '-'
Makefile:131: warning: overriding recipe for target '/home/joe/Documents/Workspace/GitHub/Flutter/LearnFlutter/flutter_kerala'
Makefile:125: warning: ignoring old recipe for target '/home/joe/Documents/Workspace/GitHub/Flutter/LearnFlutter/flutter_kerala'
Makefile:131: warning: overriding recipe for target 'weekly_challenge/week_2'
Makefile:125: warning: ignoring old recipe for target 'weekly_challenge/week_2'
Makefile:131: warning: overriding recipe for target '-'
Makefile:125: warning: ignoring old recipe for target '-'
Makefile:130: *** mixed implicit and normal rules: deprecated syntax
make: *** No rule to make target '%.cc', needed by '/home/joe/Documents/Workspace/GitHub/Flutter/LearnFlutter/flutter_kerala'. Stop.
Exception: Build process failed
Exited (sigterm)

Solution 03

by @joe733

Happens while building on Linux (Ubuntu based)
Solution Status: NAY


04. Syntax highlight is suddenly missing

ScreenShots
Logs

Solution 04

by @joe733

  • Check if you have dart plugin installed from VSCodium / VSCode marketpace.
  • If yes simply close and reopen the file you're working on.
  • Try to remove all the errors in your code.

About

Common errors when working with Flutter

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published