【发布时间】:2018-07-06 20:25:56
【问题描述】:
我的 Gradle Sync 有问题。
我使用 IntelliJ 和 Android Studio 构建了一个 Flutter / Dart 应用程序。
我添加了 2 个新依赖项,现在我遇到了 Gradle 问题。 在 Android Studio 中一切正常(Gradle Sync 在没有失败或警告的情况下完成),但在 IntelliJ 中它不起作用。
* Error running Gradle: Exit code 1 from: C:\Users\stesc\Documents\Programming\timecoder-flutter\android\gradlew.bat app:properties: NDK is missing a "platforms" directory. If you are using NDK, verify the ndk.dir is set to a valid NDK directory. It is currently set to C:\Users\stesc\AppData\Local\Android\Sdk\ndk-bundle. If you are not using NDK, unset the NDK variable from ANDROID_NDK_HOME or local.properties to remove this warning.
BUILD FAILED
Total time: 4.669 secs
FAILURE: Build failed with an exception.
* Where:
Build file 'C:\Users\stesc\Documents\Programming\timecoder-flutter\android\build.gradle' line: 25
* What went wrong: A problem occurred evaluating root project 'android'.
> A problem occurred configuring project ':app'.
> Could not resolve all dependencies for configuration ':app:_debugApk'. Finished with error: Please review your Gradle project setup in the android/ folder.
> A problem occurred configuring project ':shared_preferences'.
> Could not resolve all dependencies for configuration ':shared_preferences:classpath'.
> Could not find com.android.tools.build:gradle:3.0.1.
Searched in the following locations:
https://jcenter.bintray.com/com/android/tools/build/gradle/3.0.1/gradle-3.0.1.pom
https://jcenter.bintray.com/com/android/tools/build/gradle/3.0.1/gradle-3.0.1.jar
Required by:
project :shared_preferences
* Try: Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.
【问题讨论】:
-
请将代码、错误和数据添加为文本 (using code formatting),而不是图像。图片:A)不允许我们复制粘贴代码/错误/数据进行测试; B) 不允许根据代码/错误/数据内容进行搜索;和many more reasons。一般来说,文本格式的代码/错误/数据>>>>作为图像的代码/错误/数据>>没有。只有在除了代码格式的文本之外,如果图像添加了仅由文本代码/错误/数据无法传达的重要内容,则应使用图像。
-
你解决了吗?
标签: android gradle dart flutter