5

I'm having a class that extends SherlockFragmentActivity

When trying to run the program am getting ClassNotFoundException

I've tried this solution but to no avail.

I would also like to mention that I'm setting this class as my launcher activity in the manifest. Also when I change the SherlockFragmentAcivity to SherlockActivity I'm able to run the program but can't use fragments anymore as there's no getSupportFragmentManager() method in SherlockActivity class.

Community
  • 1
  • 1
d3m0li5h3r
  • 1,957
  • 17
  • 33
  • possible duplicate of [Libraries do not get added to APK anymore after upgrade to ADT 22](http://stackoverflow.com/questions/16596969/libraries-do-not-get-added-to-apk-anymore-after-upgrade-to-adt-22) – tc. May 20 '13 at 15:31

4 Answers4

3

I found the solution. Deleting the support library from libs folder did the trick for me.

d3m0li5h3r
  • 1,957
  • 17
  • 33
2

If you have the latest adt version (22) you need to check Android Private Libraries. In eclipse:

  • Rigth click on project and select properties
  • Click on Java Build Path
  • Click on order & export tab and tick on Android Private Libraries
Blackbelt
  • 156,034
  • 29
  • 297
  • 305
  • Yes I have the latest adt version. Also There is a directory named `Android Private Libraries` and it contains support library v13 jar file – d3m0li5h3r May 19 '13 at 12:09
  • then follow the steps I wrote above, clean and rebuild and it should work – Blackbelt May 19 '13 at 12:11
  • I already that that option selected (ticked).. clean built the project.. Still the same. throwing me the same exception. – d3m0li5h3r May 19 '13 at 12:16
0

I had the same problem. The wrong thing that I did is adding actionbarsherlock project to Project properties -> Java build path -> Projects. Instead I had to add actionbarsherlock to Project properties -> Android -> Library

I found solution here: https://stackoverflow.com/a/16736937/1820856

Community
  • 1
  • 1
Ruslan Mansurov
  • 1,281
  • 16
  • 23
-1

If you are SherlockActivity then the method to get the fragment manager is getFragmentManager().

d3m0li5h3r
  • 1,957
  • 17
  • 33
nikhil.thakkar
  • 1,093
  • 7
  • 12
  • `getFragmentManager()` method is available only if i set the min-sdk level to 11. But I want the application to support atleast api level 9. – d3m0li5h3r May 20 '13 at 05:00
  • Then you need to go ahead and use the support library provided by google. Which will work on all versions. – nikhil.thakkar May 20 '13 at 14:39