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

Home Page:https://juejin.im/user/582aca2ba22b9d006b59ae68/posts

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

项目运行环境配置

CarGuo opened this issue · comments

目前

export PUB_HOSTED_URL=https://pub.flutter-io.cn
export FLUTTER_STORAGE_BASE_URL=https://storage.flutter-io.cn

存在问题,详见: flutter/flutter#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.

5b7d1969e4b07b78518780e6

接口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"按钮。如下图所示
11111111111
结案!楼主可以关闭该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.

wenti1

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

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

#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 秒超时

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

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

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

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

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

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

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

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

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

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

@houko 兼容的

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

@CarGuo

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

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

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

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

@CarGuo

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

@CarGuo 你删我评论干啥啊 🐖

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

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

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

1.17 之后,1.20 开始 CocoaPods 需要 1.8.0 以上,如果旧版本项目可能还需要更新或者重新生成 Podfile 文件

已兼容 1.22.1 版本运行

ReadMe里面的文章打开一片空白。

@veryitman 已经更新,原有地址可能因为掘金升级过期了

@veryitman 已经更新,原有地址可能因为掘金升级过期了

好的,感谢。

项目配置成功后 vsCode运行失败 错误信息如下图
截屏2021-05-15 19 42 00
截屏2021-05-15 19 42 13

commented

Authorization callback URL 一栏必须填入 gsygithubapp://authed ,回调地址没有用,报超时错误 net::ERR_CONNECTION_TIMED_OUT

image

请问下这是什么原因?

@liuchao0739 如图,连接失败,给你的 android gradle 配置代理
image

跑不起来,请大佬看一下这是因为什么
CEBB0F01-AEF9-454F-9280-CA63B3B19EB6

@kiss718867 看 readme

@CarGuo 大佬再看看,按照 readme 操作,gsy_github_app_flutter 跑起来了,gsy_flutter_demo 还是报这个错。。
2FD2D139-74C2-4DFB-A142-837855B98CAB

@kiss718867 你看看本地 flutter 的 sdk 版本是不是 3.10

@kiss718867 你看看本地 flutter 的 sdk 版本是不是 3.10

之前 3.12,切到 3.10 可以了,感谢