Open Lenny-Hu opened 5 years ago
安卓9.0+(api 29)模拟器出现
Error connecting to the service protocol: HttpException: Connection closed before full header was received, uri = http://127.0.0.1:11692/a5X01SG2cuw=/ws
改用安卓9.0(api 28)模拟器
被墙引起的错误
- Error:Could not resolve all dependencies for configuration ':app:debugRuntimeClasspath'.
- Error running Gradle: ProcessException: Process "xxxxx" exited abnormally: Starting a Gradle Daemon (subsequent builds will be faster)
由于谷歌被墙,将以下文件中的代码注释,并替换成相应代码
// 项目目录/android/build.gradle
buildscript {
repositories {
// google()
// jcenter()
maven { url 'https://maven.aliyun.com/repository/google' }
maven { url 'https://maven.aliyun.com/repository/jcenter' }
maven { url 'http://maven.aliyun.com/nexus/content/groups/public' }
}
dependencies {
classpath 'com.android.tools.build:gradle:3.2.1'
}
}
allprojects { repositories { google() // 此处方法注释是因为我的机器不放开还会报上面的错误1 // jcenter() maven { url 'https://maven.aliyun.com/repository/google' } maven { url 'https://maven.aliyun.com/repository/jcenter' } maven { url 'http://maven.aliyun.com/nexus/content/groups/public' } } }
rootProject.buildDir = '../build' subprojects { project.buildDir = "${rootProject.buildDir}/${project.name}" } subprojects { project.evaluationDependsOn(':app') }
task clean(type: Delete) { delete rootProject.buildDir }
// /Users/huyue/apps/flutter/packages/flutter_tools/gradle/flutter.gradle // 以下为部分代码 buildscript { repositories { // google() // jcenter() maven { url 'https://maven.aliyun.com/repository/google' } maven { url 'https://maven.aliyun.com/repository/jcenter' } maven { url 'http://maven.aliyun.com/nexus/content/groups/public' } } dependencies { classpath 'com.android.tools.build:gradle:3.2.1' } }
[!] /usr/bin/git clone https://github.com/CocoaPods/Specs.git --progress -- master
Cloning into 'master'...
remote: Enumerating objects: 3708, done.
remote: Counting objects: 100% (3708/3708), done.
remote: Compressing objects: 100% (3570/3570), done.
error: RPC failed; curl 56 LibreSSL SSL_read: SSL_ERROR_SYSCALL, errno 54
fatal: the remote end hung up unexpectedly
fatal: early EOF
fatal: index-pack failed
git config --global http.postBuffer 524288000
下载慢,解决方法1, 可使用这个地址 https://gitclub.cn/CocoaPods/Specs 的代码
git clone https://github.com/CocoaPods/Specs.git ~/.cocoapods/repos/master
解决方法2
到 github.com/CocoaPods/S… 把文件clone下来,默认文件夹名字为Specs-master
前往文件夹 ~/.cocoapods/repos
终端cd到你的工程目录中执行pod setup,等待一会,等到开始下载的时候,会发现在 ~/.cocoapods/repos 下面多一个master文件,这时,需要复制master下面的.git 文件夹到Specs-master下面,同时停止pod setup
Specs-master文件夹名字修改为master,并替换~/.cocoapods/repos 下的master文件夹
也可参考这个https://www.jianshu.com/p/40fd4384447e
https://www.jianshu.com/p/22675c1632dc
搭建Flutter开发环境 https://book.flutterchina.club/chapter1/install_flutter.html