0

I have an android library project and I want to reference it from another project. The library project contains activities and xml layouts. I have added its reference as following MyProject properties-->Java Build Path--> projects like this enter image description here

and in order and exports its listed like this

enter image description here

but when I try to call an activity from referenced project, I get exception, and here is the stacktrace

05-05 15:01:20.246: E/AndroidRuntime(6669): FATAL EXCEPTION: main
05-05 15:01:20.246: E/AndroidRuntime(6669): java.lang.NoClassDefFoundError: jp.co.kom.android.ezimage.EZImageActivity
05-05 15:01:20.246: E/AndroidRuntime(6669):     at com.example.ezimgtest.MainActivity.openEZImage(MainActivity.java:56)
05-05 15:01:20.246: E/AndroidRuntime(6669):     at com.example.ezimgtest.MainActivity$1.onClick(MainActivity.java:29)
05-05 15:01:20.246: E/AndroidRuntime(6669):     at android.view.View.performClick(View.java:4234)
05-05 15:01:20.246: E/AndroidRuntime(6669):     at android.view.View$PerformClick.run(View.java:17363)
05-05 15:01:20.246: E/AndroidRuntime(6669):     at android.os.Handler.handleCallback(Handler.java:615)
05-05 15:01:20.246: E/AndroidRuntime(6669):     at android.os.Handler.dispatchMessage(Handler.java:92)
05-05 15:01:20.246: E/AndroidRuntime(6669):     at android.os.Looper.loop(Looper.java:137)
05-05 15:01:20.246: E/AndroidRuntime(6669):     at android.app.ActivityThread.main(ActivityThread.java:4970)
05-05 15:01:20.246: E/AndroidRuntime(6669):     at java.lang.reflect.Method.invokeNative(Native Method)
05-05 15:01:20.246: E/AndroidRuntime(6669):     at java.lang.reflect.Method.invoke(Method.java:511)
05-05 15:01:20.246: E/AndroidRuntime(6669):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1004)
05-05 15:01:20.246: E/AndroidRuntime(6669):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:771)
05-05 15:01:20.246: E/AndroidRuntime(6669):     at dalvik.system.NativeStart.main(Native Method)
Narendra Singh
  • 3,990
  • 5
  • 37
  • 78
AddyProg
  • 2,960
  • 13
  • 59
  • 110

2 Answers2

1

I think your activity EZImageActivity is declared in liberary manifest.Actual case androidManifest.xml merging is supported in version 20 of the ADT tools. Enable with the manifestmerger.enabled property.

more details

Santhosh
  • 1,867
  • 2
  • 16
  • 23
0

Check if you have included that class in manifest.

Also check the following answer,

NoClassDefFoundError for code in an Java library on Android

Community
  • 1
  • 1
aiRbornE
  • 139
  • 1
  • 11