android sample code 실행이 안될 때

앞 전 포스팅 처럼 src를 down 받을 경우.

 

이전에 받은 소스 코드들은 잘 됐는데 오늘따라 다운 받은 소스들이 작동하질 않는다.

 

 

 

슬슬 빡쳐 갈 때 쯤…

 

 

 

android studio 왜이렇게 적응이 안될까.. android studio 사용법 부터 차근히 살펴볼까 하다가 그렇게 하면 낭비될 시간이 아까우니 계속 고고..

 

 

도대체 error message 어디서 보는건지 검색하기

view -> tool windows -> message 클릭하면 된다.

 

 

 

message를 보니

Error running build: Module ‘android-SwipeRefreshListFragment’ is not backed by gradle

 

backed by gradle

 

 

이전 프로젝트들의 gradle 도 열어 봤지만 잘 모르겠고.. 일단 구글 검색하니..

나의 친구 stackoverflow

 

http://stackoverflow.com/questions/16977739/how-to-add-gradle-backing-to-existing-project

 

  1. Close the project in Android Studio (so it doesn’t open the project automatically in later steps) and then close Android Studio
  2. Clean the project (delete the “.idea” and “build” folders, .iml files, etc.) so you only have the source files remaining
  3. Set up gradle by adding the appropriate settings.gradle and build.gradle files (test your setup using the command line)
  4. Open Android Studio and choose “Import project” and choose to use Gradle as the external model
  5. Pick your settings.gradle file as the Gradle project
  6. [Optional] Set your “Gradle home” folder (so the text turns black instead of gray). Earlier versions of Android Studio caused problems for me if I didn’t do this. Make sure you use Gradle 0.1.10 or newer (earlier versions do not work with the current Gradle build tools).

 

2번까지 하니까.. build 되더라….