Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Execution failed for task ':fluttertoast:compileDebugKotlin' [closed]

  1. I tried flutter clean
  2. flutter pub cache repair,
  3. changing and versions of the fluttertoast package, and by removing it too,
  4. deleted the android/.gradle directory and rebuilt.

Nothing worked.

Launching lib\main.dart on Redmi Note 4 in debug mode...
lib\main.dart:1
Parameter format not correct -
e: C:\src\flutter\.pub-cache\hosted\pub.dartlang.org\fluttertoast-7.1.8\android\src\main\kotlin\io\github\ponnamkarthik\toast\fluttertoast\MethodCallHandlerImpl.kt: (45, 84): Unresolved reference: R
e: C:\src\flutter\.pub-cache\hosted\pub.dartlang.org\fluttertoast-7.1.8\android\src\main\kotlin\io\github\ponnamkarthik\toast\fluttertoast\MethodCallHandlerImpl.kt: (70, 68): Unresolved reference: R
e: C:\src\flutter\.pub-cache\hosted\pub.dartlang.org\fluttertoast-7.1.8\android\src\main\kotlin\io\github\ponnamkarthik\toast\fluttertoast\MethodCallHandlerImpl.kt: (85, 64): Unresolved reference: R
2

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':fluttertoast:compileDebugKotlin'.
> Compilation error. See log for more details

* 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 39s
Exception: Gradle task assembleDebug failed with exit code 1
Exited (sigterm)
like image 943
M.K. Malik Avatar asked Feb 19 '21 10:02

M.K. Malik


1 Answers

Updating the compileSdkVersion to 30 in my app/build.gradle solved it and allowed me to keep the latest gradle.

OLD ANSWER:

I'm not sure why, but I was able to resolve the problem by rolling back to

classpath 'com.android.tools.build:gradle:3.5.4'

in my top level build.gradle.

like image 194
jon Avatar answered Oct 31 '22 21:10

jon