flutter 配置问题

szintu 2018-11-05

按官网配置好环境后,运行例子,会出现

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

问题解决

相关推荐

xingshen / 0评论 2018-01-16