1

After importing the actionbarsherlock module, my app crashes on any activity that extends the SherlockActivity. I am not sure if I had imported it incorrectly or something needs to be adjusted but I have followed a guide that was previously posted here on stackoverflow. If i extend Activity and not sherlockActivity there will be no crash. Guide https://stackoverflow.com/a/16591272/1671933 Logcat

05-24 08:41:46.072    1241-1241/?                              E/AndroidRuntime: FATAL EXCEPTION: main
    java.lang.NoClassDefFoundError: com.example.sandbox.TestingCam
    at com.example.sandbox.LoginActivity$CheckLogin.onPostExecute(LoginActivity.java:204)
    at com.example.sandbox.LoginActivity$CheckLogin.onPostExecute(LoginActivity.java:155)
    at android.os.AsyncTask.finish(AsyncTask.java:417)
    at android.os.AsyncTask.access$300(AsyncTask.java:127)
    at android.os.AsyncTask$InternalHandler.handleMessage(AsyncTask.java:429)
    at android.os.Handler.dispatchMessage(Handler.java:99)
    at android.os.Looper.loop(Looper.java:123)
    at android.app.ActivityThread.main(ActivityThread.java:3683)
    at java.lang.reflect.Method.invokeNative(Native Method)
    at java.lang.reflect.Method.invoke(Method.java:507)
    at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:839)
    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:597)
    at dalvik.system.NativeStart.main(Native Method)
Community
  • 1
  • 1
kabuto178
  • 3,129
  • 3
  • 40
  • 61
  • Post the link to the `Guide` that you have followed . Did you build the entire project after importing the module and imparting it to your files ? – The Dark Knight May 24 '13 at 12:45
  • Did you directly copy the jar into `libs` folder and add it to the build path ? – The Dark Knight May 24 '13 at 12:49
  • No, I went through the importing module process, then setting actionbarsherlock as dependency in my project – kabuto178 May 24 '13 at 12:50
  • I think , instead of that you should just add it as a reference and have no physical existence in your project set up . Twirl it here in this link :http://stackoverflow.com/questions/11443262/actionbarsherlock-java-lang-noclassdeffounderror-com-actionbarsherlock-rstyle Look at all the answers, any one of them might be a solution for you – The Dark Knight May 24 '13 at 12:52
  • You can also try this link : http://stackoverflow.com/questions/9757400/setting-actionbarsherlock-theme-for-android-app – The Dark Knight May 24 '13 at 12:54

1 Answers1

1

You need to make sure that the dependency scope is set to "compile". In some cases it seem to be set to "provided" which will cause a NoClassDefFoundError.

WarrenFaith
  • 57,492
  • 25
  • 134
  • 150