Version : Android Studio 0.2.8
Situation : 2 More Projects and 2 More Librarys (Jar file and Java lib Project)

Problem : Eclipse에서 gradle 파일을 생성 후 Android Studio 에서 Import. (정상 과정) 하지만 컴파일 시 java.lang.NoClassDefFoundError 에러 발생.

Why the problem happened?
문제는 Java SDK 기본으로 1.7 Version이 선택됨. (1.6 Version으로 변환 후 정상 작동)


How to change JDK Version to 1.6?



SDK 재설정


가끔 씩 SDK Android 4.2.2 Platform' is invalid. android studio 에러가 발생한다 이 에러가 발생하면 프로젝트를 아래와 같이 재구성해야 한다.

Try this:

Close IDE
Remove .idea folder and all .iml files in the project.
Restart the IDE and re-import the project.

Original post:

Next Problem
프로젝트 안에 so 파일 즉 NDK를 사용하였는데 옴기고 난 후 문제가 발생하였다.

Couldn't load lib-file: findLibrary returned null


I'm not particularly familiar with IntelliJ or Gradle but I have figured it out. I used ZBarAndroidSDK-0.2.
Copy the contents of the ZBar SDK libs/ folder into your project's libs/ folder.
Modify your build.gradle (see below) to make sure the jar and native libs are included in your APK.
To make IntelliJ aware of ZBar, add zbar.jar in your project structure. To do this, go to File > Project Structure > Libraries > + Sign > Java and find zbar.jar with the file picker. Add it to your project.
Add the following to your build.gradle (making sure to keep whatever other dependencies you've got):

dependencies {
compile files('libs/android-support-v4.jar')
compile files('libs/zbar.jar')
task copyNativeLibs(type: Copy) {
from(new File('libs')) { include '**' }
into new File(buildDir, 'native-libs')
tasks.withType(Compile) { compileTask -> compileTask.dependsOn copyNativeLibs }

clean.dependsOn 'cleanCopyNativeLibs'

tasks.withType( { pkgTask ->
pkgTask.jniDir new File(buildDir, 'native-libs')
My build.gradle is based on this gist:

그리고 마지막으로
3 ways to resolve NoClassDefFoundError in Java