Harsh Agrawal
Harsh Agrawal

Reputation: 172

Runtime Exception while launching android app

I was trying to launch my android application from eclipse, but whenever I launch the application, it gets stuck and I receive the following error in the LogCat

12-15 22:04:03.179: E/AndroidRuntime(1731): java.lang.RuntimeException: Unable to        instantiate application com.iiitd.muc.mobishare.c: java.lang.ClassNotFoundException: com.iiitd.muc.mobishare.c in loader dalvik.system.PathClassLoader[/data/app/com.iiitd.muc.mobishare-2.apk]
12-15 22:04:03.179: E/AndroidRuntime(1731):     at   android.app.LoadedApk.makeApplication(LoadedApk.java:466)
12-15 22:04:03.179: E/AndroidRuntime(1731):     at android.app.ActivityThread.handleBindApplication(ActivityThread.java:3264)
12-15 22:04:03.179: E/AndroidRuntime(1731):     at android.app.ActivityThread.access$2200(ActivityThread.java:117)
12-15 22:04:03.179: E/AndroidRuntime(1731):     at android.app.ActivityThread$H.handleMessage(ActivityThread.java:973)
12-15 22:04:03.179: E/AndroidRuntime(1731):     at android.os.Handler.dispatchMessage(Handler.java:99)
12-15 22:04:03.179: E/AndroidRuntime(1731):     at android.os.Looper.loop(Looper.java:130)
12-15 22:04:03.179: E/AndroidRuntime(1731):     at android.app.ActivityThread.main(ActivityThread.java:3687)
12-15 22:04:03.179: E/AndroidRuntime(1731):     at java.lang.reflect.Method.invokeNative(Native Method)
12-15 22:04:03.179: E/AndroidRuntime(1731):     at java.lang.reflect.Method.invoke(Method.java:507)
12-15 22:04:03.179: E/AndroidRuntime(1731):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:842)
12-15 22:04:03.179: E/AndroidRuntime(1731):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:600)
12-15 22:04:03.179: E/AndroidRuntime(1731):     at dalvik.system.NativeStart.main(Native Method)
12-15 22:04:03.179: E/AndroidRuntime(1731): Caused by: java.lang.ClassNotFoundException: com.iiitd.muc.mobishare.c in loader dalvik.system.PathClassLoader[/data/app/com.iiitd.muc.mobishare-2.apk]
12-15 22:04:03.179: E/AndroidRuntime(1731):     at dalvik.system.PathClassLoader.findClass(PathClassLoader.java:240)
12-15 22:04:03.179: E/AndroidRuntime(1731):     at java.lang.ClassLoader.loadClass(ClassLoader.java:551)
12-15 22:04:03.179: E/AndroidRuntime(1731):     at java.lang.ClassLoader.loadClass(ClassLoader.java:511)
12-15 22:04:03.179: E/AndroidRuntime(1731):     at android.app.Instrumentation.newApplication(Instrumentation.java:942)
12-15 22:04:03.179: E/AndroidRuntime(1731):     at android.app.LoadedApk.makeApplication(LoadedApk.java:461)

Some more background: I am basically trying to add this library in my application. http://code.google.com/p/little-fluffy-location-library/

as mentioned in the instructions, I have added this line of code in the onCreate method of my application.

LocationLibrary.initialiseLibrary(getBaseContext(), 60 * 1000, 2 * 60 * 1000, "mobi.littlefluffytoys.littlefluffytestclient");

which is causing an error. If I remove this line of code, the app runs fine.

Can someone help me resolving this error? Thanks in advance.

Upvotes: 1

Views: 488

Answers (3)

Vishnuprasad R
Vishnuprasad R

Reputation: 1730

For anyone who still face this issue , as on 1-Dec-2015,

little-fluffy-location-library does not work with newer versions of Google Play Services. The application will crash with ClassNotFoundException if used with newer versions of Google Play Location Services.

Google Play Services version 6.1 works fine for me. If you are using Gradle to build your project, add this to your build.gradle file

compile 'com.google.android.gms:play-services:6.1.+'

Upvotes: 1

iagreen
iagreen

Reputation: 31996

I suspect this is the step you are missing from the library docs --

To use the library, add littlefluffylocationlibrary.jar as an external JAR into your Android project. In Eclipse, this is easiest done by creating a folder in your project called libs, copying the file into it, refresh the project, right-click the .jar file, and then select Add to build path.

Verify that you copied the jar file to your libs directory and that it is in your build path (this is done automatically on later versions of the ADT)

Upvotes: 2

Himanshu
Himanshu

Reputation: 117

Main cause is "Class Not Found" So ,At first You Shoul Check current path of source code.

and also check property off project that your are running correct project or not.

Upvotes: 0

Related Questions