1

After updating the flutter to 1.12.13+hotfix.8, Flutter gives strange errors on release build, but works perfectly fine in debug build

Error :

FAILURE: Build failed with an exception.

* What went wrong:
A problem occurred configuring root project 'intent'.
> SDK location not found. Define location with an ANDROID_SDK_ROOT environment variable or 
by setting the sdk.dir path in your project's local properties file at 
'/Users/niyantras/tools/flutter/.pub-cache/hosted/pub.dartlang.org/intent- 
1.1.0/android/local.properties'.

* 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 1s

Flutter doctor :

Doctor summary (to see all details, run flutter doctor -v):
[✓] Flutter (Channel stable, v1.12.13+hotfix.8, on Mac OS X 10.15.3 19D76, locale en-GB)

[✓] Android toolchain - develop for Android devices (Android SDK version 29.0.2)
[✓] Xcode - develop for iOS and macOS (Xcode 11.3.1)
[✓] Android Studio (version 3.5)
[✓] VS Code (version 1.42.0)
[✓] Connected device (1 available)

• No issues found! 

Can someone help me in figuring out, thanks for the help.

Yogesh Chawla
  • 595
  • 5
  • 20
  • 1
    can you try `flutter clean` and then `flutter pub cache repair`. Also look that whether intent package has an available upgrade if so change to that version – Dev Feb 14 '20 at 04:39
  • every package is up to date, if I every remove Intent then same error is shown for different package, but I build a simple app without any dependencies it worked fine, what could be reason ? – Yogesh Chawla Feb 14 '20 at 04:53

1 Answers1

1

flutter clean

flutter pub cache repair

let me know if the issue persists

check here, it's closed issues of flutter

Check for compilesdkversion everywhere in the folder and match it with one in android/app/build.gradle

Yogesh Chawla
  • 595
  • 5
  • 20
Rohit Soni
  • 1,300
  • 6
  • 12
  • delete your gradle cache. (.idea, .gradle) – Rohit Soni Feb 14 '20 at 04:55
  • so I searched for compilesdkversion everywhere and found in couple of files it was different that in android/app/build.gradle after changing that it worked fine – Yogesh Chawla Feb 14 '20 at 05:00
  • Great Working! some time generate systematically cache issues – Rohit Soni Feb 14 '20 at 05:02
  • btw, any idea what could have caused that maybe for now its resolved but could appear like nightmare anytime, I have been resolving this since yesterday evening couldn't find anything so came here – Yogesh Chawla Feb 14 '20 at 05:04