3月一次偶然也是必然的机会,促使自己有想法学习flutter,下面就遇到的一些问题进行记录。
一、安装flutter遇到的问题:
1、Mac终端输入命令总是出现command not found!
解决:https://blog.csdn.net/fuyundage/article/details/79516286
2、Mac安装Python3报错:
Permission denied @ dir_s_mkdir - /usr/local/Frameworks
Warning: python 3.7.2_1 is already installed, it's just not linked.
You can use brew link python
to link this version.
解决:https://www.jianshu.com/p/965fd0be3f0c
二、运行flutter项目报错:
Launching lib/main.dart on Android SDK built for x86 in debug mode...
Initializing gradle...
Resolving dependencies...
- Error running Gradle:
ProcessException: Process "/Users/rabbit/develop/android/flutter_app/android/gradlew" exited abnormally:
Project evaluation failed including an error in afterEvaluate {}. Run with --stacktrace for details of the afterEvaluate {} error.
FAILURE: Build failed with an exception.
-
Where:
Build file '/Users/rabbit/develop/android/flutter_app/android/app/build.gradle' line: 25 -
What went wrong:
A problem occurred evaluating project ':app'.
Could not resolve all files for configuration 'classpath'.
Could not find lint-gradle-api.jar (com.android.tools.lint:lint-gradle-api:26.1.2).
Searched in the following locations:
https://jcenter.bintray.com/com/android/tools/lint/lint-gradle-api/26.1.2/lint-gradle-api-26.1.2.jar
-
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: /Users/rabbit/develop/android/flutter_app/android/gradlew app:properties
Finished with error: Please review your Gradle project setup in the android/ folder.
参考解决方案:
- 修改源
- 翻墙--下载了PeerVPN
- 修改项目的/android/app/build.gradle文件中的sdk版本号为28 (运行成功后,我改回27正常运行,估计更多的是墙原因吧,版本号不碍事)
三、Android Studio找不到iPhone真机
iPhone模拟器:
终端输入:flutter doctor命令
可以发现,设备选择中能找到iPhone模拟器
真机:发现没有可选的真机可用
参考解决:https://www.jianshu.com/p/69e1efc2fc55
网友评论