flutter doctor全部必要的都安装了,但是用app跑不起来,报安卓sdk licences错误?

docutor这样

Doctor summary (to see all details, run flutter doctor -v):
[√] Flutter (Channel stable, v1.0.0, on Microsoft Windows [Version 6.1.7601], locale zh-CN)
[√] Android toolchain - develop for Android devices (Android SDK 28.0.3)
[√] Android Studio (version 3.3)
    X Flutter plugin not installed; this adds Flutter specific functionality.
    X Dart plugin not installed; this adds Dart specific functionality.
[√] VS Code (version 1.30.2)
[√] VS Code, 64-bit edition
[√] Connected device (1 available)

• No issues found!

但是当flutter run 的时候,就报错了,如下

Using hardware rendering with device Android SDK built for x86. If you get graphics artifacts, consider enabling software rendering with "--enable-software-rendering".
Launching lib/main.dart on Android SDK built for x86 in debug mode...
Initializing gradle...                                           0.7s
Resolving dependencies...
* Error running Gradle:
ProcessException: Process "E:\FlutterProject\myapp\android\gradlew.bat" exited abnormally:

> Configure project :app
Checking the license for package Android SDK Platform 27 in C:\Users\Administrator\AppData\Local\Android\sdk\licenses
Warning: License for package Android SDK Platform 27 not accepted.


FAILURE: Build failed with an exception.

* Where:
Build file 'E:\FlutterProject\myapp\android\build.gradle' line: 24

* What went wrong:
A problem occurred evaluating root project 'android'.
> A problem occurred configuring project ':app'.
   > Failed to install the following Android SDK packages as some licences have not been accepted.
        platforms;android-27 Android SDK Platform 27
     To build this project, accept the SDK license agreements and install the missing components using the Android Studio SDK Manager.
     Alternatively, to transfer the license agreements from one workstation to another, see http://d.android.com/r/studio-ui/export-licenses.html

     Using Android SDK: C:\Users\Administrator\AppData\Local\Android\sdk

* 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 0s
  Command: E:\FlutterProject\myapp\android\gradlew.bat app:properties

Please review your Gradle project setup in the android/ folder.

我检查了android studio的sdk tool,也没有问题,就是跑不起来,家里的电脑就可以。

电脑配置:
win7 开了虚拟化
vscode作为代码编辑器
android作为sdk支持以及avd支持。

阅读 7.5k
撰写回答
你尚未登录,登录后可以
  • 和开发者交流问题的细节
  • 关注并接收问题和回答的更新提醒
  • 参与内容的编辑和改进,让解决方法与时俱进
推荐问题