当前位置:网站首页>[error record] the flutter reports an error (could not read script 'xxx\flutter\u tools\gradle\app\u plugin\u loader.gradle')
[error record] the flutter reports an error (could not read script 'xxx\flutter\u tools\gradle\app\u plugin\u loader.gradle')
2022-07-02 22:44:00 【Programmer community】
One 、 Error message
Problem environment description : stay The computer A Created on Flutter application , Uploaded to GitHub in , And then in The computer B Download the source code , The compilation times the following error ;
FAILURE: Build failed with an exception.* Where:Settings file 'D:\002_Project\002_Android_Learn\flutter_photo\android\settings.gradle' line: 11* What went wrong:A problem occurred evaluating settings 'android'.> Could not read script 'D:\001_Programs\004_Flutter\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.orgBUILD FAILED in 1sRunning Gradle task 'assembleRelease'... 3.1sGradle task assembleRelease failed with exit code 1Process finished with exit code 1
Two 、 Problem analysis
Problem core error :
Could not read script 'D:\001_Programs\004_Flutter\flutter\packages\flutter_tools\gradle\app_plugin_loader.gradle' as it does not exist.
Compile time requires D:\001_Programs\004_Flutter\flutter\packages\flutter_tools\gradle\app_plugin_loader.gradle
file , I am here D:\001_Programs\004_Flutter\flutter\packages\flutter_tools\gradle\ Not found in the directory app_plugin_loader.gradle file ;
Check the problem android/setting.gradle file ;
include ':app'def localPropertiesFile = new File(rootProject.projectDir, "local.properties")def properties = new Properties()assert localPropertiesFile.exists()localPropertiesFile.withReader("UTF-8") {
reader -> properties.load(reader) }def flutterSdkPath = properties.getProperty("flutter.sdk")assert flutterSdkPath != null, "flutter.sdk not set in local.properties"apply from: "$flutterSdkPath/packages/flutter_tools/gradle/app_plugin_loader.gradle"
Other applications that can run on this computer android/setting.gradle file ;
include ':app'def flutterProjectRoot = rootProject.projectDir.parentFile.toPath()def plugins = new Properties()def pluginsFile = new File(flutterProjectRoot.toFile(), '.flutter-plugins')if (pluginsFile.exists()) {
pluginsFile.withReader('UTF-8') {
reader -> plugins.load(reader) }}plugins.each {
name, path -> def pluginDirectory = flutterProjectRoot.resolve(path).resolve('android').toFile() include ":$name" project(":$name").projectDir = pluginDirectory}
The computer B Created on Flutter Engineering can be done in The computer A Up operation ;
The computer A Created on Flutter The project cannot be in The computer B Up operation ;
It is suspected that the environment version , Flutter edition , Dart edition , Android Studio edition , Android SDK edition Caused by inconsistencies ;
It is recommended to use the same configuration for all ;
3、 ... and 、 Solution
Delete android Catalog , Delete the whole , And then in Terminal Into Source root , perform
flutter create .
command , It will regenerate android Catalog ;
The command line print data is as follows : flutter_photo Is the root directory of the source code ;
D:\002_Project\002_Android_Learn\flutter_photo>flutter create .Recreating project .... .idea\libraries\Flutter_for_Android.xml (created) .idea\libraries\KotlinJavaRuntime.xml (created) .idea\runConfigurations\main_dart.xml (created) android\app\build.gradle (created) android\app\src\main\kotlin\com\example\flutter_photo\MainActivity.kt (created) android\build.gradle (created) android\flutter_photo_android.iml (created) android\.gitignore (created) android\app\src\debug\AndroidManifest.xml (created) android\app\src\main\AndroidManifest.xml (created) android\app\src\main\res\drawable\launch_background.xml (created) android\app\src\main\res\mipmap-hdpi\ic_launcher.png (created) android\app\src\main\res\mipmap-mdpi\ic_launcher.png (created) android\app\src\main\res\mipmap-xhdpi\ic_launcher.png (created) android\app\src\main\res\mipmap-xxhdpi\ic_launcher.png (created) android\app\src\main\res\mipmap-xxxhdpi\ic_launcher.png (created) android\app\src\main\res\values\styles.xml (created) android\app\src\profile\AndroidManifest.xml (created) android\gradle\wrapper\gradle-wrapper.properties (created) android\gradle.properties (created) android\settings.gradle (created) flutter_photo.iml (created)Wrote 25 files.All done![√] Flutter: is fully installed. (Channel stable, v1.12.13+hotfix.8, on Microsoft Windows [Version 10.0.18363.1139], locale zh-CN)[√] Android toolchain - develop for Android devices: is fully installed. (Android SDK version 29.0.3)[√] Android Studio: is fully installed. (version 4.0)[!] IntelliJ IDEA Community Edition: is partially installed; more components are available. (version 2019.3)[√] Connected device: is fully installed. (1 available)Run "flutter doctor" for information about installing additional components.In order to run your application, type: $ cd . $ flutter runYour application code is in .\lib\main.dart.D:\002_Project\002_Android_Learn\flutter_photo>
Then compile and run , success ;
边栏推荐
- APP页面分享口令Rails实现
- 附加:【登录信息存储】与【登录状态校验】;(包括:总结了到目前为止,有关【登录信息存储】与【登录状态校验】的所有内容;)
- The book "new programmer 002" is officially on the market! From "new database era" to "software defined car"
- [QT] QT multithreading development - four methods to realize multithreading design
- Market Research - current market situation and future development trend of aircraft front wheel steering system
- NC24325 [USACO 2012 Mar S]Flowerpot
- Scrcpy this software solves the problem of sharing mobile screen with colleagues | community essay solicitation
- JS获取display为none的隐藏元素的宽度和高度的解决方案
- [shutter] shutter opens a third-party application (url|launcher plug-in search and installation | url| launcher plug-in official example | open browser | open a third-party application)
- [staff] Sibelius 7.5.1 score software installation (software download | software installation)
猜你喜欢
phpcms实现订单直接支付宝支付功能
[shutter] shutter application theme (themedata | dynamic modification theme)
Struct, bit segment, enumeration, union
Tencent three sides: in the process of writing files, the process crashes, and will the file data be lost?
Official announcement! The golden decade of new programmers and developers was officially released
Dynamic memory allocation (malloc calloc realloc free)
[ODX studio edit PDX] -0.1- how to quickly view the differences in supported diagnostic information between variant variants (service, sub function...)
Radis:Linux上安装Redis(步骤)
[shutter] shutter application life cycle (foreground state resumed | background state paused | inactive | component separation state detached)
附加:【登录信息存储】与【登录状态校验】;(包括:总结了到目前为止,有关【登录信息存储】与【登录状态校验】的所有内容;)
随机推荐
使用 EMQX Cloud 实现物联网设备一机一密验证
C language, to achieve three chess games
#include errors detected. Please update your includePath.
I admire that someone explained such an obscure subject as advanced mathematics so easily
【leetcode】1380. Lucky number in matrix
Try to get property'num for PHP database data reading_ rows' of non-object?
[shutter] shutter opens a third-party application (url|launcher plug-in search and installation | url| launcher plug-in official example | open browser | open a third-party application)
[autosar-dcm] - 4.3-how UDS $22 and $2e services read and write NVM data
基于ASP.net的手机销售管理系统(二手手机销售管理系统)+ASP.NET+C#语言+VS2010+数据库可以用于课设、毕设学习
PHP wechat red packet grabbing algorithm
[leetcode] sword finger offer 11 Rotate the minimum number of the array
Market Research - current market situation and future development trend of genome editing mutation detection kit
Technological Entrepreneurship: failure is not success, but reflection is
Mathematical modeling -- graph and network models and methods (I)
UE4 UI adaptive screen
数据库系统概论第一章简答题-期末考得怎么样?
Market Research - current market situation and future development trend of aircraft front wheel steering system
Struct, bit segment, enumeration, union
Market Research - current market situation and future development trend of intravenous injection (IV) bottles
【ODX Studio编辑PDX】-0.1-如何快速查看各Variant变体间的支持的诊断信息差异(服务,Sub-Function...)