当前位置:网站首页>[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 ;
边栏推荐
- ServiceMesh主要解决的三大痛點
- Meibeer company is called "Manhattan Project", and its product name is related to the atomic bomb, which has caused dissatisfaction among Japanese netizens
- Ransack组合条件搜索实现
- UE4 UI自适应屏幕
- Notes on key vocabulary in the English original of the biography of jobs (10) [chapter eight]
- C language, to achieve three chess games
- 影视随摘
- U++ 原始内存 学习笔记
- 【微服务|Sentinel】重写sentinel的接口BlockExceptionHandler
- Unity3d learning notes 4 - create mesh advanced interface
猜你喜欢
Utilisation de simpletk - 4. Question étrange
The book "new programmer 002" is officially on the market! From "new database era" to "software defined car"
It's not easy to say I love you | use the minimum web API to upload files (swagger support) # yyds dry inventory #
Ransack combined condition search implementation
NC50965 Largest Rectangle in a Histogram
Source code analysis - lightweight asynchronous crawler framework Ruia
【ODX Studio编辑PDX】-0.1-如何快速查看各Variant变体间的支持的诊断信息差异(服务,Sub-Function...)
大话云原生之负载均衡篇-小饭馆客流量变大了
Evolution of messaging and streaming systems under the native tide of open source cloud
wait解决僵尸进程
随机推荐
Kubernetes resource object introduction and common commands (4)
NC50965 Largest Rectangle in a Histogram
Unity publishes a method of webgl playing sound
Evolution of messaging and streaming systems under the native tide of open source cloud
UE4 game architecture learning notes
将 EMQX Cloud 数据通过公网桥接到 AWS IoT
基于ASP.net的手机销售管理系统(二手手机销售管理系统)+ASP.NET+C#语言+VS2010+数据库可以用于课设、毕设学习
【AUTOSAR-DCM】-4.3-UDS $22和$2E服务如何读取和写入NVM数据
任务和特权级保护
U++ 学习笔记 ----松弛
Oracle PL / SQL programming
PHP implements querying the data matching the date of birth according to the entered age
Tencent three sides: in the process of writing files, the process crashes, and will the file data be lost?
ArrayList analysis 2: pits in ITR, listiterator, and sublist
[shutter] shutter page life cycle (initialization period | createstate | initstate | update period | build | destroy period | dispose)
Lightgbm principle and its application in astronomical data
Market Research - current situation and future development trend of carob chocolate market
[micro service sentinel] rewrite Sentinel's interface blockexceptionhandler
Market Research - current market situation and future development trend of aircraft audio control panel system
Unity3d learning notes 4 - create mesh advanced interface