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)
1
  • why dont you use android studio? Commented May 5, 2015 at 7:13

2 Answers 2

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

Sign up to request clarification or add additional context in comments.

Comments

0

Check if you have included that class in manifest.

Also check the following answer,

NoClassDefFoundError for code in an Java library on Android

4 Comments

Do I need to add all activities of referenced project to my current project's manifest ?
Not current project's manifest but the library project's manifest
I have added all activities of library project in its manifest file
Please check this answer as well. stackoverflow.com/questions/7994715/…

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.