flutter 配置问题
按官网配置好环境后,运行例子,会出现
Launchinglib\main.dartonAndroidSDKbuiltforx8664indebugmode...
Initializinggradle...
timeoutwaitingfortheapplicationtostart
原因,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同样替换
可正常运行
出现
Errorwaitingforadebugconnection:ProcessException:adbdidnotreportforwardedport
Command:D:/Android/sdk\platform-tools\adb-semulator-5556forwardtcp:0tcp:42536
ErrorlaunchingapplicationonAndroidSDKbuiltforx8664.
需要下载或者升级项目匹配AndroidSDK,在Setting,AndroidSDK中可找到
进入sdk目录下的tools文件夹
执行androidupdatesdk-tplatform-tool--no-ui
问题解决