Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/flutter/9.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Flutter 无法解析配置';的所有项目:类路径';。梯度依赖_Flutter_Android Studio_Gradle_Gradle Dependencies - Fatal编程技术网

Flutter 无法解析配置';的所有项目:类路径';。梯度依赖

Flutter 无法解析配置';的所有项目:类路径';。梯度依赖,flutter,android-studio,gradle,gradle-dependencies,Flutter,Android Studio,Gradle,Gradle Dependencies,我试图在android studio中运行我的第一个Flatter应用程序,但当我运行$flatter run-v时,执行以错误结束。见下文: [ +161 ms] executing: uname -m [ +66 ms] Exit code 0 from: uname -m [ ] x86_64 [ +28 ms] executing: [/home/luis/snap/flutter/common/flutter/] git -c log.showSignature=fa

我试图在android studio中运行我的第一个Flatter应用程序,但当我运行
$flatter run-v
时,执行以错误结束。见下文:

[ +161 ms] executing: uname -m
[  +66 ms] Exit code 0 from: uname -m
[        ] x86_64
[  +28 ms] executing: [/home/luis/snap/flutter/common/flutter/] git -c log.showSignature=false log -n 1 --pretty=format:%H
[+1698 ms] Exit code 0 from: git -c log.showSignature=false log -n 1 --pretty=format:%H
[        ] 8264cb3e8a797eef39cbcd32bb56fd07790efb7f
[   +1 ms] executing: [/home/luis/snap/flutter/common/flutter/] git tag --points-at 8264cb3e8a797eef39cbcd32bb56fd07790efb7f
[+8413 ms] Exit code 0 from: git tag --points-at 8264cb3e8a797eef39cbcd32bb56fd07790efb7f
[        ] 2.1.0-12.1.pre
[  +83 ms] executing: [/home/luis/snap/flutter/common/flutter/] git rev-parse --abbrev-ref --symbolic @{u}
[   +7 ms] Exit code 0 from: git rev-parse --abbrev-ref --symbolic @{u}
[        ] origin/dev
[        ] executing: [/home/luis/snap/flutter/common/flutter/] git ls-remote --get-url origin
[  +10 ms] Exit code 0 from: git ls-remote --get-url origin
[        ] https://github.com/flutter/flutter.git
[ +301 ms] executing: [/home/luis/snap/flutter/common/flutter/] git rev-parse --abbrev-ref HEAD
[  +13 ms] Exit code 0 from: git rev-parse --abbrev-ref HEAD
[        ] dev
[+1073 ms] Artifact Instance of 'AndroidGenSnapshotArtifacts' is not required, skipping update.
[        ] Artifact Instance of 'AndroidInternalBuildArtifacts' is not required, skipping update.
[        ] Artifact Instance of 'IOSEngineArtifacts' is not required, skipping update.
[        ] Artifact Instance of 'FlutterWebSdk' is not required, skipping update.
[  +83 ms] Artifact Instance of 'WindowsEngineArtifacts' is not required, skipping update.
[        ] Artifact Instance of 'MacOSEngineArtifacts' is not required, skipping update.
[        ] Artifact Instance of 'LinuxEngineArtifacts' is not required, skipping update.
[        ] Artifact Instance of 'LinuxFuchsiaSDKArtifacts' is not required, skipping update.
[        ] Artifact Instance of 'MacOSFuchsiaSDKArtifacts' is not required, skipping update.
[        ] Artifact Instance of 'FlutterRunnerSDKArtifacts' is not required, skipping update.
[        ] Artifact Instance of 'FlutterRunnerDebugSymbols' is not required, skipping update.
[ +209 ms] executing: /home/luis/Android/Sdk/platform-tools/adb devices -l
[  +64 ms] List of devices attached
           emulator-5554          device product:sdk_gphone_x86 model:sdk_gphone_x86 device:generic_x86_arm transport_id:1
[  +11 ms] /home/luis/Android/Sdk/platform-tools/adb -s emulator-5554 shell getprop
[ +322 ms] Artifact Instance of 'AndroidInternalBuildArtifacts' is not required, skipping update.
[        ] Artifact Instance of 'IOSEngineArtifacts' is not required, skipping update.
[        ] Artifact Instance of 'FlutterWebSdk' is not required, skipping update.
[   +2 ms] Artifact Instance of 'WindowsEngineArtifacts' is not required, skipping update.
[        ] Artifact Instance of 'MacOSEngineArtifacts' is not required, skipping update.
[        ] Artifact Instance of 'LinuxEngineArtifacts' is not required, skipping update.
[        ] Artifact Instance of 'LinuxFuchsiaSDKArtifacts' is not required, skipping update.
[        ] Artifact Instance of 'MacOSFuchsiaSDKArtifacts' is not required, skipping update.
[        ] Artifact Instance of 'FlutterRunnerSDKArtifacts' is not required, skipping update.
[        ] Artifact Instance of 'FlutterRunnerDebugSymbols' is not required, skipping update.
[ +340 ms] Skipping pub get: version match.
[+2496 ms] Generating /home/luis/AndroidStudioProjects/flutter_app/android/app/src/main/java/io/flutter/plugins/GeneratedPluginRegistrant.java
[ +319 ms] ro.hardware = ranchu
[  +30 ms] Using hardware rendering with device sdk gphone x86. If you notice graphics artifacts, consider enabling software rendering with "--enable-software-rendering".
[ +673 ms] Initializing file store
[  +17 ms] Skipping target: gen_localizations
[  +15 ms] complete
[   +8 ms] Launching lib/main.dart on sdk gphone x86 in debug mode...
[  +10 ms] /home/luis/snap/flutter/common/flutter/bin/cache/dart-sdk/bin/dart --disable-dart-dev
/home/luis/snap/flutter/common/flutter/bin/cache/artifacts/engine/linux-x64/frontend_server.dart.snapshot --sdk-root
/home/luis/snap/flutter/common/flutter/bin/cache/artifacts/engine/common/flutter_patched_sdk/ --incremental --target=flutter --debugger-module-names
--experimental-emit-debug-metadata -DFLUTTER_WEB_AUTO_DETECT=true --output-dill /tmp/flutter_tools.FFPOYP/flutter_tool.VSASRR/app.dill --packages
/home/luis/AndroidStudioProjects/flutter_app/.dart_tool/package_config.json -Ddart.vm.profile=false -Ddart.vm.product=false --enable-asserts --track-widget-creation
--filesystem-scheme org-dartlang-root --initialize-from-dill build/3c113a45063dc6628e68a4111abcacad.cache.dill.track.dill --enable-experiment=alternative-invalidation-strategy
[ +103 ms] executing: /home/luis/Android/Sdk/platform-tools/adb -s emulator-5554 shell -x logcat -v time -t 1
[  +12 ms] <- compile package:flutter_app/main.dart
[+1382 ms] --------- beginning of main
                    05-03 11:52:35.336 I/Bugle   ( 4150): VerifiedSmsStartupTask: Not enqueuing Verified SMS periodic task, Verified SMS is disabled.
[  +25 ms] executing: /home/luis/Android/Sdk/platform-tools/adb version
[   +9 ms] Android Debug Bridge version 1.0.41
           Version 31.0.0-7110759
           Installed as /home/luis/Android/Sdk/platform-tools/adb
[   +4 ms] executing: /home/luis/Android/Sdk/platform-tools/adb start-server
[   +9 ms] Building APK
[ +193 ms] Running Gradle task 'assembleDebug'...
[ +563 ms] Using gradle from /home/luis/AndroidStudioProjects/flutter_app/android/gradlew.
[+1454 ms] executing: /snap/android-studio/101/android-studio/jre/bin/java -version
[+14462 ms] Exit code 0 from: /snap/android-studio/101/android-studio/jre/bin/java -version
[        ] openjdk version "1.8.0_242-release"
           OpenJDK Runtime Environment (build 1.8.0_242-release-1644-b3-6222593)
           OpenJDK 64-Bit Server VM (build 25.242-b3-6222593, mixed mode)
[  +33 ms] executing: [/home/luis/AndroidStudioProjects/flutter_app/android/] /home/luis/AndroidStudioProjects/flutter_app/android/gradlew -Pverbose=true
-Ptarget-platform=android-x86 -Ptarget=/home/luis/AndroidStudioProjects/flutter_app/lib/main.dart -Pdart-defines=RkxVVFRFUl9XRUJfQVVUT19ERVRFQ1Q9dHJ1ZQ==
-Pdart-obfuscation=false -Ptrack-widget-creation=true -Ptree-shake-icons=false -Pfilesystem-scheme=org-dartlang-root assembleDebug
[+26873 ms] Starting a Gradle Daemon (subsequent builds will be faster)
[+51866 ms] FAILURE: Build failed with an exception.
[   +7 ms] * What went wrong:
[        ] A problem occurred configuring root project 'android'.
[        ] > Could not resolve all artifacts for configuration ':classpath'.
[   +1 ms]    > Could not find builder-4.1.0.jar (com.android.tools.build:builder:4.1.0).
[  +19 ms]      Searched in the following locations:
[        ]          https://dl.google.com/dl/android/maven2/com/android/tools/build/builder/4.1.0/builder-4.1.0.jar
[        ]    > Could not find bundletool-0.14.0.jar (com.android.tools.build:bundletool:0.14.0).
[   +7 ms]      Searched in the following locations:
[        ]          https://dl.google.com/dl/android/maven2/com/android/tools/build/bundletool/0.14.0/bundletool-0.14.0.jar
[        ]    > Could not find protos-27.1.0.jar (com.android.tools.analytics-library:protos:27.1.0).
[        ]      Searched in the following locations:
[   +6 ms]          https://dl.google.com/dl/android/maven2/com/android/tools/analytics-library/protos/27.1.0/protos-27.1.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.
[  +10 ms] * Get more help at https://help.gradle.org
[        ] BUILD FAILED in 1m 17s
[+1108 ms] Running Gradle task 'assembleDebug'... (completed in 96.4s)
[  +34 ms] Exception: Gradle task assembleDebug failed with exit code 1
[   +2 ms] "flutter run" took 103,413ms.
[   +6 ms] 
           #0      throwToolExit (package:flutter_tools/src/base/common.dart:12:3)
           #1      RunCommand.runCommand (package:flutter_tools/src/commands/run.dart:659:9)
           <asynchronous suspension>
           #2      FlutterCommand.run.<anonymous closure> (package:flutter_tools/src/runner/flutter_command.dart:1037:27)
           <asynchronous suspension>
           #3      AppContext.run.<anonymous closure> (package:flutter_tools/src/base/context.dart:152:19)
           <asynchronous suspension>
           #4      CommandRunner.runCommand (package:args/command_runner.dart:197:13)
           <asynchronous suspension>
           #5      FlutterCommandRunner.runCommand.<anonymous closure> (package:flutter_tools/src/runner/flutter_command_runner.dart:283:9)
           <asynchronous suspension>
           #6      AppContext.run.<anonymous closure> (package:flutter_tools/src/base/context.dart:152:19)
           <asynchronous suspension>
           #7      FlutterCommandRunner.runCommand (package:flutter_tools/src/runner/flutter_command_runner.dart:239:5)
           <asynchronous suspension>
           #8      run.<anonymous closure>.<anonymous closure> (package:flutter_tools/runner.dart:62:9)
           <asynchronous suspension>
           #9      AppContext.run.<anonymous closure> (package:flutter_tools/src/base/context.dart:152:19)
           <asynchronous suspension>
           #10     main (package:flutter_tools/executable.dart:92:3)
           <asynchronous suspension>
           
           
[ +254 ms] ensureAnalyticsSent: 252ms
[   +1 ms] Running shutdown hooks
[        ] Shutdown hook priority 4
[   +2 ms] Shutdown hooks complete
[        ] exiting with code 1

即使在那之后,错误仍然存在

文件build.gradle:

buildscript {
    repositories {
        google()
        jcenter()
    }

    dependencies {
        classpath 'com.android.tools.build:gradle:4.1.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-wrapper.properties:

#Fri Jun 23 08:50:38 CEST 2017
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-6.7-all.zip
我能做什么

.gradle/caches/modules-2/files-2.1/com.android.tools.analytics-library/protos/27.1.0/SHA1/protos-27.1.0.jar
buildscript {
    repositories {
        google()
        jcenter()
    }

    dependencies {
        classpath 'com.android.tools.build:gradle:4.1.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
}
#Fri Jun 23 08:50:38 CEST 2017
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-6.7-all.zip