我在运行应用程序时遇到问题。
我的 flutter 细节是:
Flutter 版本:1.12.13+hotfilx.9
Doctor summary (to see all details, run flutter doctor -v):
[√] Flutter (Channel stable, v1.12.13+hotfix.9, on Microsoft Windows [Version 10.0.17763.1098], locale en-IN)
[!] Android toolchain - develop for Android devices (Android SDK version 30.0.0-rc2)
X Android license status unknown.
Try re-installing or updating your Android SDK Manager.
See https://developer.android.com/studio/#downloads or visit https://flutter.dev/setup/#android-setup for detailed instructions.[√] Android Studio (version 3.6)
[√] VS Code (version 1.44.2)
[√] Connected device (1 available)
! Doctor found issues in 1 category.
在 Visual Studio 中运行 flutter 运行时,它显示了这一点:
Launching lib\main.dart on CPH1859 in debug mode...
FAILURE: Build failed with an exception.
* Where:
Settings file 'project_name\android\settings.gradle' line: 15
* What went wrong:
A problem occurred evaluating settings 'android'.
> Could not read script '\flutter\packages\flutter_tools\gradle\app_plugin_loader.gradle' as it does not exist.
* 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 2s
Gradle task assembleDebug failed with exit code 1
Exited (sigterm)
提前感谢您帮助我。
最佳答案
在主 channel 上创建的 Flutter 项目将生成 android/settings.gradle
文件指向 Flutter 工具中存在于 1.18.0-dev.5.0 ( currently available on all channels ) 中的文件。
从 master 切换 -> stable “降级” Flutter 相对于该更改,并且该文件不再存在。
您可以通过重新生成 android/settings.gradle
来解决此问题。在稳定时:
$ rm android/settings.gradle
$ flutter create .
见GitHub issue更多细节。
关于android - 运行应用程序时出现错误 "$flutterSdkpath\packages\flutter_tools\gradle\app_plugin_loader.gradle",我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/61436827/