CarGuo / gsy_github_app_flutter

Flutter 超完整的开源项目,功能丰富,适合学习和日常使用。GSYGithubApp系列的优势:我们目前已经拥有Flutter、Weex、ReactNative、kotlin 四个版本。 功能齐全,项目框架内技术涉及面广,完成度高,持续维护,配套文章,适合全面学习,对比参考。跨平台的开源Github客户端App,更好的体验,更丰富的功能,旨在更好的日常管理和维护个人Github,提供更好更方便的驾车体验Σ( ̄。 ̄ノ)ノ。同款Weex版本 : https://github.com/CarGuo/GSYGithubAppWeex 、同款React Native版本 : https://github.com/CarGuo/GSYGithubApp 、原生 kotlin 版本 https://github.com/CarGuo/GSYGithubAppKotlin
https://juejin.im/user/582aca2ba22b9d006b59ae68/posts
Apache License 2.0
14.82k stars 2.55k forks source link

项目运行环境配置 #13

Open CarGuo opened 6 years ago

CarGuo commented 6 years ago

目前

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 commented 6 years ago

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 commented 6 years ago

@tonyhelloworld

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

5b7d1969e4b07b78518780e6

CarGuo commented 6 years ago

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

CarGuo commented 6 years ago

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

chenxihub commented 6 years ago

接口Http status error [422]

CarGuo commented 6 years ago

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

chenxihub commented 6 years ago

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

james-bltg commented 5 years ago

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

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

CarGuo commented 5 years ago

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

manburenshenglu commented 5 years ago

配置了的,我能正常登陆GitHub网页端,但是跑起来,就报422 此处的CLIENT_ID和CLIENTSECRET不是GitHub的账号和密码,而是你注册的application的Client ID和Client Secret。在github上申请OAuth App的步骤:进入个人的Github首页,Settings->Applications->Developer applications->Register a new application,然后在下图中输入信息,信息输入完毕后点击"Register application"按钮。如下图所示 11111111111 结案!楼主可以关闭该issue了O(∩∩)O哈哈~

ufolux commented 5 years ago

I met a problem that api returned exception 422.

q13945951476 commented 5 years ago

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

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 commented 5 years ago

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

CarGuo commented 5 years ago

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

CarGuo commented 5 years ago

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 commented 5 years ago

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

ignoreconfigdart 找不到问题

flutePeak commented 5 years ago

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

按照这个报错,执行了命令,还是报这个

CarGuo commented 5 years ago

@flutePeak CocoaPods 1.6.1 版本

flutePeak commented 5 years ago

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

flutePeak commented 5 years ago

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

flutePeak commented 5 years ago

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

algate commented 5 years ago

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

CarGuo commented 5 years ago

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

zzzZLP commented 5 years ago

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

CarGuo commented 5 years ago

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

zzzZLP commented 5 years ago

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

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

yin87 commented 5 years ago

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

CarGuo commented 5 years ago

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

yin87 commented 5 years ago

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

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

yin87 commented 5 years ago

@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

CarGuo commented 5 years ago

其他项目不一定 pubspec.yaml 使用 git 依赖,而 GSY 使用了 git 依赖 @yin87 ,你可能 git 没有配置到环境变量中,直接在终端执行 git 命令看是不是没有配置

yin87 commented 5 years ago

多谢耐心的回答,git有配置, C:\Users\10471>git --version git version 2.21.0.windows.1 下图显示出了版本号

1
yin87 commented 5 years ago

@yin87 那就很诡异了,没遇到过这种情况

把下面代码注释了,packages get成功了

1
CarGuo commented 5 years ago

@yin87 https://github.com/CarGuo/GSYGithubAppFlutter/issues/13#issuecomment-496960086

tongyangsheng commented 5 years ago

image import 'package:gsy_github_app_flutter/common/config/ignoreConfig.dart'; 这一行报错 是因为没有获取到这个包吗?可是 flutter packages get没有报错啊

CarGuo commented 5 years ago

https://github.com/CarGuo/GSYGithubAppFlutter/issues/63 @tongyangsheng 看readme

tongyangsheng commented 5 years ago

@CarGuo 看到了!谢谢!博主在线频率好评 哈哈哈哈哈哈

chindeng commented 5 years ago

DioError [DioErrorType.RESPONSE]: Http status error [401] {"message":"Requires authentication","documentation_url":"https://developer.github.com/v3"} 出现这个问题是什么原因? 已经按照@manburenshenglu注册了应用程序,输入了正确的ID和密码,但还是不行。

longdw commented 4 years ago

{"message":"Bad credentials","documentation_url":"https://developer.github.com/v3"} 同样的错误

houko commented 4 years ago

flutter 都1.9了,不考虑升级下吗

CarGuo commented 4 years ago

@houko 兼容的

chindeng commented 4 years ago

DioError [DioErrorType.RESPONSE]:Http状态错误[401] {“消息”:“需要身份验证”,“ documentation_url”:“ https://developer.github.com/v3”} 出现这个问题是什么原因? 已经按照@manburenshenglu注册了应用程序,输入了正确的ID和密码,但还是不行。

@CarGuo

CarGuo commented 4 years ago

@chenxihub 如果是自己编译的,确定你申请的 github api 的 appId 是 sercet 是否正确。 然后确定使用 github 用户名 和 密码登陆,网络正常,暂时不支持开启了两次认证的账号。

houko commented 4 years ago

@CarGuo 支持IOS吗?我试了一下ios编译出错

CarGuo commented 4 years ago

@houko 报错?我这边没报错呢,你的错误是什么,我的 pod 版本是 1.6.1

chindeng commented 4 years ago

DioError [DioErrorType.RESPONSE]:Http状态错误[401] {“消息”:“需要身份验证”,“ documentation_url”:“ https://developer.github.com/v3”} 出现这个问题是什么原因? 已经按照@manburenshenglu注册了应用程序,输入了正确的ID和密码,但还是不行。

@CarGuo

@CarGuo 问题已经解决,原因有两个,一个是没有安装GitHub应用程序,另一个就是在flutter程序运行后出现的登录界面输入了错误的信息,正确的应该是在上面输入GitHub账户和密码

houko commented 4 years ago

@CarGuo 你删我评论干啥啊 🐖

CarGuo commented 4 years ago

@houko 这个 pin issue 主要保留一些关键的回复,而且这是运行环境配置的issue

CarGuo commented 4 years ago

Flutter SDK 1.12.xx 版本目前请切换 dev_next 分支

CarGuo commented 4 years ago

flutter 环境配置,目前 兼容至 1.20

1、 sdk

git clone -b stable https://github.com/flutter/flutter.git

2、配置环境代理

win配置到环境变量

mac配置到 .bash_profile 文件(用户名目录下的隐藏文件,可以通过命令行 open .bash_profile 打包),新版的系统需要配置到 zsh 。

3、检查环境

重新打开命令行并执行

flutter doctor

4、同步项目的包

flutter packages get

5、androd和ios环境是否配置