Android Studio 1.3.2 error when refreshing gradle

前端 未结 2 712
清歌不尽
清歌不尽 2021-01-16 15:53

I generated build.gradle file from eclipse and import it to android studio.

However, it returns error after \"refreshing gradle\" :

2条回答
  •  死守一世寂寞
    2021-01-16 16:48

    I recommend you to use gradle 2.4, you can download it here. Then, extract the downloaded file into C:\Program Files\Android\Android Studio\gradle. After that, open File > Settings from Android Studio. On the searchbox, type gradle and search.

    Open build.gradle from the main project and type classpath 'com.android.tools.build:gradle:1.3.0' under dependencies:

    buildscript {
        repositories {
            jcenter()
        }
        dependencies {
            classpath 'com.android.tools.build:gradle:1.3.0'
    
            // NOTE: Do not place your application dependencies here; they belong
            // in the individual module build.gradle files
        }
    }
    

    Finally, rebuild your project in Build > Rebuild project.

提交回复
热议问题