项目运行环境配置
目前
export PUB_HOSTED_URL=https://pub.flutter-io.cn
export FLUTTER_STORAGE_BASE_URL=https://storage.flutter-io.cn
存在问题,详见: https://github.com/flutter/flutter/issues/20809
经测试,目前镜像已经可用(2018-10-18),但是Andoird在编译时需要一些Kotlin的包和第三方包,这里可能存在需要“梯子”的情况,可在项目的android目录下执行 “./gradlew build” 查看包的下载情况
flutter 环境配置
1、 sdk
git clone -b beta https://github.com/flutter/flutter.git
git checkout v0.7.0 //切换到.0.7.0版本
2、配置环境代理
win配置到环境变量
mac配置到 .bash_profile 文件(用户名目录下的隐藏文件,可以通过命令行 open .bash_profile 打包)
注意,目前代理下会出现问题,科学上网吧。
3、检查环境
重新打开命令行并执行
flutter doctor
4、同步项目的包
flutter packages get
5、androd和ios环境是否配置
@tonyhelloworld
/// Shrinks the tap target size to the minimum provided by the Material
/// specification.

https://github.com/flutter/flutter/issues/20809
https://github.com/flutter/flutter/wiki/Using-Flutter-in-China
接口Http status error [422]
@joexchen 你需要配置正确你github 申请的应用id和sercet
配置了的,我能正常登陆GitHub网页端,但是跑起来,就报422
配置了的,我能正常登陆GitHub网页端,但是跑起来,就报422
我也遇到相同的问题,请问你是否已经解决这个问题??
目前已知442问题是由于 page 请求超出了 数据的最大page 导致的
配置了的,我能正常登陆GitHub网页端,但是跑起来,就报422 此处的CLIENT_ID和CLIENT_SECRET不是GitHub的账号和密码,而是你注册的application的Client ID和Client Secret。在github上申请OAuth App的步骤:进入个人的Github首页,Settings->Applications->Developer applications->Register a new application,然后在下图中输入信息,信息输入完毕后点击"Register application"按钮。如下图所示
结案!楼主可以关闭该issue了O(∩_∩)O哈哈~
I met a problem that api returned exception 422.
大佬帮忙看下呗,什么原因
Error output from CocoaPods: ↳ [!] The version of CocoaPods used to generate the lockfile (1.5.3) is higher than the version of the current executable (1.5.0). Incompatibility issues may arise.
[!] Automatically assigning platform `ios` with version `8.0` on target `Runner` because no platform was specified. Please specify a platform for this target in your Podfile. See `https://guides.cocoapods.org/syntax/podfile.html#platform`.
Error running pod install Error launching application on iPhone XR.
Resolving dependencies of Podfile
[!] CocoaPods could not find compatible versions for pod "lottie-ios":
In snapshot (Podfile.lock):
lottie-ios (= 2.5.2)
In Podfile:
flutter_lottie (from `.symlinks/plugins/flutter_lottie/ios`) was resolved to 0.0.1, which depends on
lottie-ios
It seems like you've changed the constraints of dependency `lottie-ios` inside your development pod `flutter_lottie`.
You should run `pod update lottie-ios` to apply changes you've made.
回复:该问题删除 IOS 的 Podfile.lock 文件可解决,如果没能解决尝试升级 CocoaPods
@q13945951476 首先确定你flutter packages get 成功了,本地都已经有所有包了,然后再执行,如果还有问题升级下你本地的 pod 命令版本,我刚刚试了clone一个新的执行没有问题
https://github.com/CarGuo/GSYGithubAppFlutter/issues/419
flutter packages get 提示 git 失败原因: 比如
win 是在 C:\Users\xxxxx\AppData\Roaming\Pub\Cache 路径下有 git 目录,如果存在某次 package get 失败之后,git 下目录会存在,然后出现这个异常。 可以删除 git 目录有重新 flutter packages get
mac 目录在 ~/.pub-cache
一般我们都是用 pub 上下第三方插件,但是有时候我们为了安全和私密,会选择使用 git 引用,而不引用官方pub上的包。 引用的时候可能会指定 ref 是 commit 的 hash 值或者分支如master,这时候如果在拉包的过程中出现问题,下次再拉包的时候,在 .pub_cache 内的 git 目录下会检测到已经存在目录,但是可能是空目录等等,导致 packages get 的时候异常。
所以你需要清除掉 .pub_cache 内的 git 的异常目录,然后最好清除掉项目目录下的 pubspec.lock ,之后重新 flutter packages get
Error: CocoaPods's specs repository is too out-of-date to satisfy dependencies. To update the CocoaPods specs, run: pod repo update
Error running pod install Error launching application on iPhone Xʀ.
按照这个报错,执行了命令,还是报这个
@flutePeak CocoaPods 1.6.1 版本
@CarGuo 1.7.2版本太高了吗? 我目前版本是1.7.2
@CarGuo 谢谢大大,我成功跑起来了,,我发现是我笔记本有缓存,之前老版本的一直影响着。。全删干净之后,1.7.2跑起来了
@CarGuo 我跑起来项目了,运行看着也没问题,但是时不时就进debug,说是报错了,有的地方为空,或者什么的。但是放行后,看着一切正常。。是我跑失败了,还是代码有问题?或者是我编辑器的锅,编辑器是VScode
项目运行起来了
界面展示如下:(启动展示的GSYGithubApp头像动画)
如何进入应用呢!
@algate 然后会进入登陆页,如果卡在这里说明没有运行成功,你下载打包好的apk就知道了
请求异常: DioError [DioErrorType.CONNECT_TIMEOUT]: Connecting timeout[15000ms]
@q815956089 Connecting timeout ,换个网络环境试试,15 秒超时
感谢回复,还是不行,报错
I/flutter (23539): base64Str login ODE1OTU2MDg5QHFxLmNvbTpzaWxlbmNlOTgyNjY0 I/flutter (23539): 请求url:https://api.github.com/authorizations I/flutter (23539): 请求头: {Authorization: Basic ODE1OTU2MDg5QHFxLmNvbTpzaWxlbmNlOTgyNjY0} I/flutter (23539): 请求参数: {"scopes":["user","repo","gist","notifications"],"note":"admin_script","client_id":"","client_secret":"
有人碰到这个问题吗,测试过其他项目可以获取到依赖包,这个项目获取报错了。。。 Working dir: E:\flutter_app\GSYGithubAppFlutter D:\app\flutter\bin\cache\dart-sdk\bin\pub.bat get 活动代码页: 936 Resolving dependencies... Cannot find a Git executable. Please ensure Git is correctly installed. Process finished with exit code 1
@yin87 log 上不是写着了么,没有找到 git 啊·····
@yin87 log 上不是写着了么,没有找到 git 啊·····
但是,不知道为什么会找不到。。。因为其他项目可以找到。。。百度了下也没找到解决方案。。。
@yin87 log 上不是写着了么,没有找到 git 啊·····
这是另外一个项目,正常。。。 Working dir: E:\flutter_app\flutter_trip-master D:\app\flutter\bin\cache\dart-sdk\bin\pub.bat get 活动代码页: 936 Resolving dependencies... Got dependencies! Process finished with exit code 0
结案!楼主可以关闭该issue了O(∩_∩)O哈哈~