我正在尝试通过在颤振上执行我run
的第一个测试应用程序Genymotion
,但除了控制台中的这条消息外,我什么也没得到:
Launching lib\main.dart on Motorola Moto X in debug mode...
Running Gradle task 'assembleDebug'...
FAILURE: Build failed with an exception.
* What went wrong:
A problem occurred configuring root project 'android'.
> Could not resolve all artifacts for configuration ':classpath'.
> Could not find com.android.tools.build:gradle:3.5.0.
Searched in the following locations:
- https://dl.google.com/dl/android/maven2/com/android/tools/build/gradle/3.5.0/gradle-3.5.0.pom
- https://dl.google.com/dl/android/maven2/com/android/tools/build/gradle/3.5.0/gradle-3.5.0.jar
- https://jcenter.bintray.com/com/android/tools/build/gradle/3.5.0/gradle-3.5.0.pom
- https://jcenter.bintray.com/com/android/tools/build/gradle/3.5.0/gradle-3.5.0.jar
Required by:
project :
* 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 26s
Finished with error: Gradle task assembleDebug failed with exit code 1
另外(我认为这可能会有所帮助),在 下build menu
,我找不到一些实用的子菜单;比如build
, clean
, 或 ...
可能是什么问题呢?
非常感谢任何帮助!
由于@TaufikNurRahmanda 需要响应 flutter doctor
和 flutter clean
命令作为更多详细信息,因此我将它们添加为编辑;
颤振医生:
Doctor summary (to see all details, run flutter doctor -v):
[√] Flutter (Channel stable, v1.12.13+hotfix.7, on Microsoft Windows [Version 10.0.10586], locale en-US)
[!] Android toolchain - develop for Android devices (Android SDK version 29.0.3)
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.4)
[√] IntelliJ IDEA Community Edition (version 2019.3)
[√] Connected device (1 available)
! Doctor found issues in 1 category.
扑干净:
Error: No pubspec.yaml file found.
This command should be run from the root of your Flutter project.
Do not run this command from the root of your git clone of Flutter.
的响应flutter doctor --android-licenses
也可能有用(尽管我已经Android SDK Build-tools 29.0.3
安装):
A newer version of the Android SDK is required. To update, run: C:\Users\[user]\AppData\Local\Android\android-sdk\tools\bin\sdkmanager --update
当我运行上面(sdkmanager --update
)建议的命令时,我得到了这个:
Error: Could not find or load main class '-Dcom.android.sdklib.toolsdir=C:\Users\[user]\AppData\Local\Android\android-sdk\tools\bin\\..-XX:+IgnoreUnrecognizedVMOptions