2016.11.29 AS gradle更新及相关问题解决

1.android studio更新后出现的Gradlesync failed: Unknown host等gradle问题解决办法

    首先打开androidstudio项目 找到项目目录gradle\wrapper\gradle-wrapper.properties这个文件

    内容如下

         distributionBase=GRADLE_USER_HOME
         distributionPath=wrapper/dists
         zipStoreBase=GRADLE_USER_HOME
         zipStorePath=wrapper/dists
         distributionUrl=http\://services.gradle.org/distributions/gradle-2.10.all.zip

    androidstudio会联网下载符合当前版本的gradle插件,而这个网址虽然可以访问但速度实在太慢,所以每次更新需要花很长时间或直接超时

修改gradle引用本地文件

        distributionUrl=file:///C:/Users/downloads/gradle-2.1-all.zip

    打开别人的androidstudio project,下载新的gradle版本太慢,可以修改build.gradle文件中

    classpath 'com.android.tools.build:gradle:2.2.2' ,变成自己有的版面

 

    如果有提示gradle版本不一致的问题,请先到http://services.gradle.org/distributions下载你所需要的Gradle版本并在android studio--> file -->setting -->Build ExecutionDeployment-->Build Tools-->Gradle使用”use local gradledistribution" 选择使用你下载的gradle版本,再尝试编译你的app

l  重点推荐gradle更新不了时直接删除gradleproperties中的代理项。


2.Unsupported method: AndroidProject.getPluginGeneration() while runningproject

It can occur because AS was checking availability of theInstant Run feature. The fixed is to disable Instant Run:

Windows & Linux:

File -> Settings -> Build, Execution, Deployment -> InstantRun.

Mac:

AndroidStudio -> Preferences -> Build, Execution, Deployment -> InstantRun.



评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值