android-async-http 라이브러리 jar 파일을 추가해서 컴파일을 하려고하는데 File - Structure - Library들어가서 추가하고 컴파일 해도 계속 import 에러가 나더라..


그래서 구글링 해본결과 이런 답변을 찾음

http://stackoverflow.com/questions/16608135/android-studio-add-jar-as-library


1. /libs 폴더에 jar를 복사하고 

2. 해당 라이브러리를 사용하고자 하는 Module 밑의 build.gradle 파일을 열어서

dependencies {

    compile files('libs/android-support-v4.jar')

    compile files('libs/android-async-http-1.4.3.jar')

}


3. 그 후 Terminal 에서 프로젝트 루트 디렉토리로 간 후 

gradlew clean

명령을 실행해서 다시 빌드하면 깔끔하게 동작한다.

Posted by 모과이IT
,