gpt4 book ai didi

flutter - 任务 ':path_provider:extractDebugAnnotations' 执行失败

转载 作者:行者123 更新时间:2023-12-03 03:55:23 25 4
gpt4 key购买 nike

我最近更新了 android studio 和 flutter(android studio 版本 3.6.1 和 flutter SDK v1.12.13+hotfix.8)。当我尝试运行我以前的项目时,我面临以下 错误 :

Launching lib\main.dart on Google Nexus 5 0 in debug mode...
Running Gradle task 'assembleDebug'...


FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':path_provider:extractDebugAnnotations'.
> Could not resolve all files for configuration ':path_provider:lintClassPath'.
> Could not find lint-gradle.jar (com.android.tools.lint:lint-gradle:26.5.0).
Searched in the following locations:
https://dl.google.com/dl/android/maven2/com/android/tools/lint/lint-gradle/26.5.0/lint-gradle-26.5.0.jar
> Could not find lint.jar (com.android.tools.lint:lint:26.5.0).
Searched in the following locations:
https://dl.google.com/dl/android/maven2/com/android/tools/lint/lint/26.5.0/lint-26.5.0.jar
> Could not find lint-checks.jar (com.android.tools.lint:lint-checks:26.5.0).
Searched in the following locations:
https://dl.google.com/dl/android/maven2/com/android/tools/lint/lint-checks/26.5.0/lint-checks-26.5.0.jar
> Could not find lint-api.jar (com.android.tools.lint:lint-api:26.5.0).
Searched in the following locations:
https://dl.google.com/dl/android/maven2/com/android/tools/lint/lint-api/26.5.0/lint-api-26.5.0.jar
> Could not find intellij-core.jar (com.android.tools.external.com-intellij:intellij-core:26.5.0).
Searched in the following locations:
https://dl.google.com/dl/android/maven2/com/android/tools/external/com-intellij/intellij-core/26.5.0/intellij-core-26.5.0.jar
> Could not find kotlin-compiler.jar (com.android.tools.external.com-intellij:kotlin-compiler:26.5.0).
Searched in the following locations:
https://dl.google.com/dl/android/maven2/com/android/tools/external/com-intellij/kotlin-compiler/26.5.0/kotlin-compiler-26.5.0.jar
> Could not find uast.jar (com.android.tools.external.org-jetbrains:uast:26.5.0).
Searched in the following locations:
https://dl.google.com/dl/android/maven2/com/android/tools/external/org-jetbrains/uast/26.5.0/uast-26.5.0.jar

* 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 22s
Finished with error: Gradle task assembleDebug failed with exit code 1

这是 pubspec.yaml文件
name: someproject
description: A new Flutter application.

version: 1.0.0+1

environment:
sdk: ">=2.1.0 <3.0.0"

dependencies:
auto_size_text: ^2.1.0
cupertino_icons: ^0.1.2
flutter:
sdk: flutter
flutter_localizations:
sdk: flutter
font_awesome_flutter: ^8.7.0
flutter_custom_clippers: ^1.1.0
http: ^0.12.0+4
html_unescape: ^1.0.1+3
path_provider: ^1.6.5
sqflite: ^1.3.0



dev_dependencies:
flutter_test:
sdk: flutter


flutter:

uses-material-design: true

assets:

这是我的 build.gradle
buildscript {
repositories {
google()
jcenter()
maven { url 'https://maven.google.com' }
}

dependencies {
classpath 'com.android.tools.build:gradle:3.5.0'
}
}

allprojects {
repositories {
google()
jcenter()
}
}

rootProject.buildDir = '../build'
subprojects {
project.buildDir = "${rootProject.buildDir}/${project.name}"
}
subprojects {
project.evaluationDependsOn(':app')
}

task clean(type: Delete) {
delete rootProject.buildDir
}

gradle.properties
org.gradle.jvmargs=-Xmx1536M
android.enableR8=true
android.useAndroidX=true
android.enableJetifier=true

应用程序\build.gradle
def localProperties = new Properties()
def localPropertiesFile = rootProject.file('local.properties')
if (localPropertiesFile.exists()) {
localPropertiesFile.withReader('UTF-8') { reader ->
localProperties.load(reader)
}
}

def flutterRoot = localProperties.getProperty('flutter.sdk')
if (flutterRoot == null) {
throw new GradleException("Flutter SDK not found. Define location with flutter.sdk in the local.properties file.")
}

def flutterVersionCode = localProperties.getProperty('flutter.versionCode')
if (flutterVersionCode == null) {
flutterVersionCode = '1'
}

def flutterVersionName = localProperties.getProperty('flutter.versionName')
if (flutterVersionName == null) {
flutterVersionName = '1.0'
}

apply plugin: 'com.android.application'
apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle"

android {
compileSdkVersion 28

lintOptions {
disable 'InvalidPackage'
}

defaultConfig {
// TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html).
applicationId "mojtaba.azmoonasli"
minSdkVersion 16
targetSdkVersion 28
versionCode flutterVersionCode.toInteger()
versionName flutterVersionName
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
}

buildTypes {
release {
// TODO: Add your own signing config for the release build.
// Signing with the debug keys for now, so `flutter run --release` works.
signingConfig signingConfigs.debug
}
}
}

flutter {
source '../..'
}

dependencies {
testImplementation 'junit:junit:4.12'
androidTestImplementation 'androidx.test:runner:1.1.1'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.1.1'
}

flutter 医生
[√] Flutter (Channel stable, v1.12.13+hotfix.8, on Microsoft Windows [Version 10.0.18363.720], locale en-US)
• Flutter version 1.12.13+hotfix.8 at D:\FlutterSDK\flutter
• Framework revision 0b8abb4724 (5 weeks ago), 2020-02-11 11:44:36 -0800
• Engine revision e1e6ced81d
• Dart version 2.7.0

[!] Android toolchain - develop for Android devices (Android SDK version 28.0.3)
• Android SDK at C:\Users\mojta\AppData\Local\Android\sdk
• Android NDK location not configured (optional; useful for native profiling support)
• Platform android-Q, build-tools 28.0.3
• Java binary at: D:\Android Studio\jre\bin\java
• Java version OpenJDK Runtime Environment (build 1.8.0_212-release-1586-b04)
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)
• Android Studio at D:\Android Studio
• Flutter plugin version 44.0.2
• Dart plugin version 192.7761
• Java version OpenJDK Runtime Environment (build 1.8.0_212-release-1586-b04)

[√] Connected device (1 available)
• Google Nexus 5 0 • 192.168.96.103:5555 • android-x86 • Android 5.0 (API 21)

! Doctor found issues in 1 category.

感谢您的时间❤

最佳答案

好吧,我尝试了以下方法,问题解决了。

  • 在 android studio 打开 pubspec.yaml文件并在窗口顶部单击 flutter Upgrade。或者从这里下载并安装它:https://flutter.dev/docs/get-started/install/windows .
    enter image description here
    更新flutter后,问题应该解决了。
  • 如果不起作用,请删除 flutter SDK 并从 https://flutter.dev/docs/get-started/install 下载它并再次运行该项目。
  • (不推荐)如果问题仍然存在,您可以删除包括 flutter 在内的所有内容,重新安装并更改为稳定 channel ,它应该再次没问题。
  • 关于flutter - 任务 ':path_provider:extractDebugAnnotations' 执行失败,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/60703015/

    25 4 0
    Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
    广告合作:1813099741@qq.com 6ren.com