Flutter构建apk,抛出未找到SDK错误

时间:2020-09-16 07:57:29

标签: flutter

Androidflutter SDK的位置以正确的路径放置在local.properties文件中:

sdk.dir=F:\\software\\sdk
flutter.sdk=F:\\software\\flutter
flutter.buildMode=release
flutter.versionName=1.0.0
flutter.versionCode=1

当我尝试运行build apk命令时,出现此错误:

* Where:
Build file 'F:\software\flutter\.pub-cache\hosted\pub.dartlang.org\screen-0.0.5\android\build.gradle' line: 11

* What went wrong:
A problem occurred evaluating root project 'screen'.
> Flutter SDK not found. Define location with flutter.sdk in the local.properties file.

enter image description here

enter image description here

enter image description here

enter image description here

enter image description here

flutter doctor -v命令输出:

[√] Flutter (Channel master, 1.22.0-10.0.pre.153, on Microsoft Windows [Version 10.0.19041.508], locale en-US)
    • Flutter version 1.22.0-10.0.pre.153 at F:\software\flutter
    • Framework revision 2e643651a9 (4 days ago), 2020-09-11 23:07:03 -0400
    • Engine revision 16b900b63e
    • Dart version 2.10.0 (build 2.10.0-117.0.dev)


[√] Android toolchain - develop for Android devices (Android SDK version 30.0.2)
    • Android SDK at F:\software\sdk
    • Platform android-30, build-tools 30.0.2
    • ANDROID_HOME = F:\software\sdk
    • Java binary at: C:\Program Files\Android\Android Studio\jre\bin\java
    • Java version OpenJDK Runtime Environment (build 1.8.0_242-release-1644-b01)
    • All Android licenses accepted.

[√] Android Studio (version 4.0)
    • Android Studio at C:\Program Files\Android\Android Studio
    • Flutter plugin version 49.0.2
    • Dart plugin version 193.7547
    • Java version OpenJDK Runtime Environment (build 1.8.0_242-release-1644-b01)

[√] Connected device (1 available)
    • WAS LX1A (mobile) • 2XJDU17C14006203 • android-arm64 • Android 8.0.0 (API 26)

• No issues found!

1 个答案:

答案 0 :(得分:0)

已解决

我手动修复了screen库,然后构建apk命令正常工作