android - Flutter在运行测试应用程序时出现错误
问题描述
如果有人可以帮助我,那就太好了。我正在努力学习它,而这些错误正在阻止我。
Error running Gradle:
ProcessException: Process "C:\Users\HP\AndroidStudioProjects\flutternew\android\gradlew.bat" exited abnormally:
Configure project :app
Checking the license for package Android SDK Platform 27 in C:\Users\HP\AppData\Local\Android\sdk\licenses
Warning: License for package Android SDK Platform 27 not accepted.
FAILURE: Build failed with an exception.
Where:
Build file 'C:\Users\HP\AndroidStudioProjects\flutternew\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\HP\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 7m 38s
Command: C:\Users\HP\AndroidStudioProjects\flutternew\android\gradlew.bat app:properties
Finished with error: Please review your Gradle project setup in the android/ folder.
解决方案
正如您在日志中看到的,这就是原因 -Warning: License for package Android SDK Platform 27 not accepted.
您可以flutter doctor
从终端运行,它会要求您运行flutter doctor --android-licenses
以接受它们。修复它可能指示的任何其他问题。在那之后,你应该很高兴。
推荐阅读
- powerbi - 计算中位数,同时保留 Power BI 中的其他列
- algorithm - 为受限范围划分问题设计优化算法
- c++ - 如何从数组中间开始循环?
- typescript - WebSocket:如何使用 weboscket 连接从已构建的服务器接收消息?
- c# - 如何从视图 .NET Core API 中的选定值中获取数据?
- python - 如何解决散列时python中的内存错误
- reactjs - React 的依赖项安装错误
- oracle - SELECT Oracle 中一组条件的查询数据
- javascript - 使用 jQuery 获取图像权重时更改度量单位
- javascript - 是否可以在星号钻石下方循环 2 个小金字塔?