flutter 配置问题
程序员文章站
2022-07-11 12:00:12
...
按官网配置好环境后,运行例子,会出现
Launching lib\main.dart on Android SDK built for x86 64 in debug mode...
Initializing gradle...
timeout waiting for the application to start
原因,google(),jcenter()连接不上,改为阿里镜像
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()
//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' }
}
}
\flutter\packages\flutter_tools\gradle\flutter.gradle 同样替换
可正常运行
出现
Error waiting for a debug connection: ProcessException: adb did not report forwarded port
Command: D:/Android/sdk\platform-tools\adb -s emulator-5556 forward tcp:0 tcp:42536
Error launching application on Android SDK built for x86 64.
需要下载或者升级项目匹配Android SDK,在Setting,Android SDK 中可找到
进入sdk目录下的 tools 文件夹
执行android update sdk -t platform-tool --no-ui
问题解决
Launching lib\main.dart on Android SDK built for x86 64 in debug mode...
Initializing gradle...
timeout waiting for the application to start
原因,google(),jcenter()连接不上,改为阿里镜像
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()
//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' }
}
}
\flutter\packages\flutter_tools\gradle\flutter.gradle 同样替换
可正常运行
出现
Error waiting for a debug connection: ProcessException: adb did not report forwarded port
Command: D:/Android/sdk\platform-tools\adb -s emulator-5556 forward tcp:0 tcp:42536
Error launching application on Android SDK built for x86 64.
需要下载或者升级项目匹配Android SDK,在Setting,Android SDK 中可找到
进入sdk目录下的 tools 文件夹
执行android update sdk -t platform-tool --no-ui
问题解决
上一篇: 设计模式之工厂
下一篇: node 阻塞和非阻塞 同步和异步 讲解
推荐阅读
-
关于case when语句的报错问题详解
-
win10下mysql 8.0.18 安装配置方法图文教程(windows版)
-
JS中‘hello’与new String(‘hello’)引出的问题详解
-
mysql 8.0.13 安装配置图文教程
-
俗话说入乡随俗 清朝是怎么解决西洋人见皇帝不下跪的问题的
-
mysql 8.0.18 安装配置方法图文教程(linux)
-
怎么解决MySQL密码问题
-
解决linux系统中运行node进程却无法杀死进程的问题
-
使用nginx代理gogs遇到推送代码错误的问题(RPC failed; HTTP 413 curl 22 The requested URL returned error: 413)
-
spring cloud Eureka 配置信息