flutter clean
flutter pub cache repair
,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)
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
.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With