0

I have converted an existing android project (say App1) into an android library project using eclipse by setting 'Is Library' as true in its android properties. Then in my other project (say App2) I have added this library project using eclipse by adding App1 in its library references. In App2 I have tried to launch an activity of App1. I have mentioned this activity in the manifest file of App2.

Intent intent = new Intent(TestActivity.this, ForYouActivity.class);
TestActivity.this.startActivityForResult(intent, 1);

But when I run the application, I get an error

E/AndroidRuntime(2489): java.lang.NoClassDefFoundError: com.test.activities.ForYouActivity

Please help me out with this. Thanks in advance

Thorben
  • 953
  • 13
  • 28
Zeba
  • 3,041
  • 1
  • 28
  • 39
  • may help you.. http://stackoverflow.com/questions/10005206/twitter4j-androidruntime446-java-lang-noclassdeffounderror-twitter4j-http/10007966#10007966 – MKJParekh Apr 11 '12 at 11:49
  • Thanks for replying @Frankenstein. I am using ADT 16. And i tried adding a folder named 'libs' to my project and i placed my library project jar in it,... but yet i got the same error. – Zeba Apr 11 '12 at 13:12

1 Answers1

0

Make sure your library projects .jar files are located in the 'Android Dependencies' folder. I've answered a similar question previously, it might help you: https://stackoverflow.com/a/9820881/518949

Community
  • 1
  • 1
Freddroid
  • 2,449
  • 22
  • 23
  • Thank you @Freddman for that post link... I tried out the steps mentioned in there. Created a folder named 'libs' in my project and placed external .jar in that folder. But the ADT did not place them under 'Android Dependencies'. those jars remained in the libs folder as is. And then I added back my library project. I got the same error again! – Zeba Apr 11 '12 at 13:15
  • That's strange, which ADT/SDK version are you running? – Freddroid Apr 11 '12 at 14:04
  • ADT version 16, Android SDK version 2.2 and Eclipse helios – Zeba Apr 12 '12 at 06:55
  • Okey, try updating your SDK/ADT to 18 and try again. My previous answer was to resolve issue in ADT 17+. If your running < ADT 17 the Library project should go into "Reference Libraries" – Freddroid Apr 12 '12 at 08:37
  • Yes... my library project would go into "Reference Libraries" folder. I have been able to solve the issue now. The library project activity which I was trying to launch from my project would extend to FragmentsActivity. When I changed my project's calling activity to extend to FragmentsActivity.. the issue got resolved!! – Zeba Apr 12 '12 at 10:40