gsy_github_app_flutter icon indicating copy to clipboard operation
gsy_github_app_flutter copied to clipboard

项目运行环境配置

Open CarGuo opened this issue 7 years ago • 72 comments

目前

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” 查看包的下载情况

CarGuo avatar Aug 07 '18 03:08 CarGuo

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环境是否配置

CarGuo avatar Aug 07 '18 04:08 CarGuo

@tonyhelloworld

/// Shrinks the tap target size to the minimum provided by the Material
/// specification.

5b7d1969e4b07b78518780e6

CarGuo avatar Aug 22 '18 08:08 CarGuo

https://github.com/flutter/flutter/issues/20809

CarGuo avatar Aug 24 '18 00:08 CarGuo

https://github.com/flutter/flutter/wiki/Using-Flutter-in-China

CarGuo avatar Aug 27 '18 09:08 CarGuo

接口Http status error [422]

chenxihub avatar Sep 07 '18 08:09 chenxihub

@joexchen 你需要配置正确你github 申请的应用id和sercet

CarGuo avatar Sep 07 '18 08:09 CarGuo

配置了的,我能正常登陆GitHub网页端,但是跑起来,就报422

chenxihub avatar Sep 08 '18 02:09 chenxihub

配置了的,我能正常登陆GitHub网页端,但是跑起来,就报422

我也遇到相同的问题,请问你是否已经解决这个问题??

james-bltg avatar Oct 04 '18 05:10 james-bltg

目前已知442问题是由于 page 请求超出了 数据的最大page 导致的

CarGuo avatar Oct 24 '18 08:10 CarGuo

配置了的,我能正常登陆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"按钮。如下图所示 11111111111 结案!楼主可以关闭该issue了O(∩_∩)O哈哈~

manburenshenglu avatar Dec 03 '18 03:12 manburenshenglu

I met a problem that api returned exception 422.

ufolux avatar Feb 01 '19 06:02 ufolux

大佬帮忙看下呗,什么原因

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.

q13945951476 avatar May 10 '19 06:05 q13945951476

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.
wenti1

回复:该问题删除 IOS 的 Podfile.lock 文件可解决,如果没能解决尝试升级 CocoaPods

q13945951476 avatar May 10 '19 06:05 q13945951476

@q13945951476 首先确定你flutter packages get 成功了,本地都已经有所有包了,然后再执行,如果还有问题升级下你本地的 pod 命令版本,我刚刚试了clone一个新的执行没有问题

CarGuo avatar May 10 '19 06:05 CarGuo

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

CarGuo avatar May 29 '19 14:05 CarGuo

https://github.com/CarGuo/GSYGithubAppFlutter/issues/63

ignoreconfigdart 找不到问题

CarGuo avatar May 29 '19 14:05 CarGuo

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 avatar Jun 24 '19 09:06 flutePeak

@flutePeak CocoaPods 1.6.1 版本

CarGuo avatar Jun 24 '19 09:06 CarGuo

@CarGuo 1.7.2版本太高了吗? 我目前版本是1.7.2

flutePeak avatar Jun 24 '19 10:06 flutePeak

@CarGuo 谢谢大大,我成功跑起来了,,我发现是我笔记本有缓存,之前老版本的一直影响着。。全删干净之后,1.7.2跑起来了

flutePeak avatar Jun 24 '19 10:06 flutePeak

@CarGuo 我跑起来项目了,运行看着也没问题,但是时不时就进debug,说是报错了,有的地方为空,或者什么的。但是放行后,看着一切正常。。是我跑失败了,还是代码有问题?或者是我编辑器的锅,编辑器是VScode

flutePeak avatar Jun 25 '19 01:06 flutePeak

项目运行起来了 界面展示如下:(启动展示的GSYGithubApp头像动画) 图片 如何进入应用呢!

algate avatar Jun 27 '19 11:06 algate

@algate 然后会进入登陆页,如果卡在这里说明没有运行成功,你下载打包好的apk就知道了

CarGuo avatar Jun 27 '19 12:06 CarGuo

请求异常: DioError [DioErrorType.CONNECT_TIMEOUT]: Connecting timeout[15000ms]

zzzZLP avatar Jul 05 '19 01:07 zzzZLP

@q815956089 Connecting timeout ,换个网络环境试试,15 秒超时

CarGuo avatar Jul 05 '19 01:07 CarGuo

感谢回复,还是不行,报错

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":"

zzzZLP avatar Jul 05 '19 01:07 zzzZLP

有人碰到这个问题吗,测试过其他项目可以获取到依赖包,这个项目获取报错了。。。 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 avatar Aug 08 '19 01:08 yin87

@yin87 log 上不是写着了么,没有找到 git 啊·····

CarGuo avatar Aug 08 '19 01:08 CarGuo

@yin87 log 上不是写着了么,没有找到 git 啊·····

但是,不知道为什么会找不到。。。因为其他项目可以找到。。。百度了下也没找到解决方案。。。

yin87 avatar Aug 08 '19 01:08 yin87

@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

yin87 avatar Aug 08 '19 01:08 yin87