Android Studio 0.5.2 Gradle Refresh Project failed

为君一笑 提交于 2019-11-28 23:38:56

Easy fix!

The defaultConfig part of your build.gradle file needs to go inside buildTypes, like this:

apply plugin: 'android'

android {
    compileSdkVersion 19
    buildToolsVersion "19.0.3"


    buildTypes {
        defaultConfig {
            minSdkVersion 8
            targetSdkVersion 19
            versionCode 1
            versionName "1.0"
        }

        release {
            runProguard false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.txt'
        }
    }
}

dependencies {
    compile 'com.android.support:appcompat-v7:+'
    compile fileTree(dir: 'libs', include: ['*.jar'])
}

See the guide for Migrating from 0.8 to 0.9.

Furthermore, make sure you're using the up-to-date Gradle distribution url (if you're using the Gradle wrapper).

In your gradle-wrapper.properties file should be the following line:

distributionUrl=http\://services.gradle.org/distributions/gradle-1.11-all.zip

Finally make sure you clean your project before building again (Build -> Clean Project).

In my case, I have tried these two solutions above, but neither could solve the problem, finally I shut down my AVAST safety software...then It worked! gradle sync is ok.. Although I don't know why, but shutting down AVAST did solve the problem.

I had exactly the same problem.

To solve that just create another project in Android Studio 0.5.2 and after that when new project completely Created and Built close it and open your old project (project 'ClujTourist' ). Now you can build ClueTourist successfully.

Please let me know if anything goes wrong.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!