'2017/04/13'에 해당되는 글 1건

  1. 2017.04.13 [Android Studio] github에서 Project Import 이후 오류 해결
반응형

github에서 android studio로 프로젝트를 import 하고 나서 다음의 오류가 발생한다.


Plugin with id 'com.android.application' not found


이 오류는 프로젝트 폴더의 build.gradle(Project:ㅇㅇㅇ) 의 내용이 app 폴더의 build.gradle(Module:app)에 포함되어 있지 않기 때문이다. (android studio에서 github로 push 할때 app쪽만 push되어 그런듯 하다.)


 프로젝트 폴더의 build.gradle에는 다음의 내용이 들어가 있다.

// Top-level build file where you can add configuration options common to all sub-projects/modules.

buildscript {

    repositories {

        jcenter()

    }

    dependencies {

        classpath 'com.android.tools.build:gradle:2.3.0'


        // NOTE: Do not place your application dependencies here; they belong

        // in the individual module build.gradle files

    }

}

allprojects {

    repositories {

        jcenter()

    }

}

task clean(type: Delete) {

    delete rootProject.buildDir


 이 내용을 app폴더의 build.gradle의 다음의 라인 위에 상기 내용을 넣어 주면 된다.


apply plugin: 'com.android.application'


이후  다음의 오류가 발생할 수 있는데


Cannot resolve symbol 'AppCompatActivity'


  http://stackoverflow.com/questions/36039815/how-to-use-the-latest-gradle-version-in-android-studio 에 나온 것처럼 cache를 invalidate 하고 Restart 하면 해결된다.


File > Invalidate Caches/Restart



반응형
Posted by alias
,