Question

Recently I have installed Ubuntu 12.04 in place of my Win7. I use Eclipse Juno / Java7. But when I am trying to Run my application I get the following line of errors although everything is in its place. My Manifest have the right class name. My activity filename is also correct as that of in my manifest. But strange part of it is that this error is only caused on the projects in which I am using ActionBarSherloock. Strange isn't it?

Now the line of errors from my logcat:

08-20 19:31:59.545: E/AndroidRuntime(764): FATAL EXCEPTION: main
08-20 19:31:59.545: E/AndroidRuntime(764): java.lang.RuntimeException: Unable to instantiate activity ComponentInfo{com.app.android/com.app.android.SplashActivity}: java.lang.ClassNotFoundException: com.app.android.SplashActivity
08-20 19:31:59.545: E/AndroidRuntime(764):  at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1880)
08-20 19:31:59.545: E/AndroidRuntime(764):  at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:1981)
08-20 19:31:59.545: E/AndroidRuntime(764):  at android.app.ActivityThread.access$600(ActivityThread.java:123)
08-20 19:31:59.545: E/AndroidRuntime(764):  at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1147)
08-20 19:31:59.545: E/AndroidRuntime(764):  at android.os.Handler.dispatchMessage(Handler.java:99)
08-20 19:31:59.545: E/AndroidRuntime(764):  at android.os.Looper.loop(Looper.java:137)
08-20 19:31:59.545: E/AndroidRuntime(764):  at android.app.ActivityThread.main(ActivityThread.java:4424)
08-20 19:31:59.545: E/AndroidRuntime(764):  at java.lang.reflect.Method.invokeNative(Native Method)
08-20 19:31:59.545: E/AndroidRuntime(764):  at java.lang.reflect.Method.invoke(Method.java:511)
08-20 19:31:59.545: E/AndroidRuntime(764):  at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:784)
08-20 19:31:59.545: E/AndroidRuntime(764):  at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:551)
08-20 19:31:59.545: E/AndroidRuntime(764):  at dalvik.system.NativeStart.main(Native Method)
08-20 19:31:59.545: E/AndroidRuntime(764): Caused by: java.lang.ClassNotFoundException: com.app.android.SplashActivity
08-20 19:31:59.545: E/AndroidRuntime(764):  at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:61)
08-20 19:31:59.545: E/AndroidRuntime(764):  at java.lang.ClassLoader.loadClass(ClassLoader.java:501)
08-20 19:31:59.545: E/AndroidRuntime(764):  at java.lang.ClassLoader.loadClass(ClassLoader.java:461)
08-20 19:31:59.545: E/AndroidRuntime(764):  at android.app.Instrumentation.newActivity(Instrumentation.java:1023)
08-20 19:31:59.545: E/AndroidRuntime(764):  at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1871)
08-20 19:31:59.545: E/AndroidRuntime(764):  ... 11 more

Also note that my ABS library is fine. No jar dependecy error and or similar kind of errors. In one line, I do not see problem in pre compilation processes. Only RuntimeException is thrown.

Can anyone say what might be a problem?

Was it helpful?

Solution

You mention that this app uses ActionBarSherlock. Does your Activity extend SherlockActivity?

Okay, SherlockActivity not the problem. Hmm... Is the version of Support Library linked by your application the exact same one that is used by ActionBarSherlock? (The best way to ensure this is to link the same one that ABS was compiled with.)

OTHER TIPS

Ur catlog says:

java.lang.ClassNotFoundException: com.app.android.SplashActivity

Add Splash Activity to your Android Manifest!

It also could be a problem with the settings of the files coming from windows - windows uses a weird/different end of lineand end of file - I had problems with this coming from Windows to Mac.


As the above questions state, from the specific errors it has to be a problem with the linking of your SplashActivity. If it is in a sub folder there may be a problem with the / (linux) vs \ windows - it may be worth your time to go into the Manifest.

Go into the activity tab and click on your SplashActivity - from here you should click on the class name and let the auto-detect re-enter the value for you. (I don't have eclipse on this computer so I can't give you exact instructions, maybe someone else can?)

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top