Call activity located in an external android library (jar)

I am trying to call an activity which is located in an external android library.

I have two projects in my eclipse :
-SuperApp (contains MainActivity which has a “Start Calculator Activity” button)
-AdditionLibrary (contains a CalculatorActivity which has a “This is the calculator activity” TextView)

Here are the source code for the activities :

If I reference the application from the SuperApp using the project properties->Android->Library
The app works fine.

If I export the jar of AdditionLibrary ( to add it in the libs folder of SuperApp, and then add the jar in the Java Build Path (, when I launch the app I have the following issue :


I have looked everywhere but I do not find the root cause of the issue.


If you are adding jar file into your project, then you need to all the resources used in the library project.

Including menu, drawable, layout etc..

For Example :

This is used in your file :

getMenuInflater().inflate(, menu);

so, you need to add menu file called activity_calculator.xml to your SuperApp Application.

Leave a Reply

Your email address will not be published. Required fields are marked *