【发布时间】:2021-05-22 08:10:13
【问题描述】:
- 我试过
flutter clean -
flutter pub cache repair, - fluttertoast 包的更改和版本,以及删除它,
- 删除android/.gradle目录并重新构建。
没有任何效果。
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)
【问题讨论】:
-
能否提供您的 MethodCallHandlerImpl 代码?
-
尝试以前的版本 7.1.6
-
我遇到了同样的错误。我尝试回滚到 7.1.6,使缓存无效,颤抖干净......没有解决问题。我知道我在 Android Studio 中安装了与 Android 相关的更新。也许与此有关?
标签: android flutter kotlin gradle