0

I am a newbie to android ... my project is a notification project using parse.com... there is no error but my project stopped working ...

the logcat is

09-27 17:44:48.422: E/AndroidRuntime(947): FATAL EXCEPTION: main
09-27 17:44:48.422: E/AndroidRuntime(947): java.lang.RuntimeException: Unable to instantiate application com.parse.mech.ParseApplication: java.lang.ClassNotFoundException: Didn't find class "com.parse.mech.ParseApplication" on path: /data/app/com.parse.mech-2.apk
09-27 17:44:48.422: E/AndroidRuntime(947):  at android.app.LoadedApk.makeApplication(LoadedApk.java:504)
09-27 17:44:48.422: E/AndroidRuntime(947):  at android.app.ActivityThread.handleBindApplication(ActivityThread.java:4364)
09-27 17:44:48.422: E/AndroidRuntime(947):  at android.app.ActivityThread.access$1300(ActivityThread.java:141)
09-27 17:44:48.422: E/AndroidRuntime(947):  at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1294)
09-27 17:44:48.422: E/AndroidRuntime(947):  at android.os.Handler.dispatchMessage(Handler.java:99)
09-27 17:44:48.422: E/AndroidRuntime(947):  at android.os.Looper.loop(Looper.java:137)
09-27 17:44:48.422: E/AndroidRuntime(947):  at android.app.ActivityThread.main(ActivityThread.java:5039)
09-27 17:44:48.422: E/AndroidRuntime(947):  at java.lang.reflect.Method.invokeNative(Native Method)
09-27 17:44:48.422: E/AndroidRuntime(947):  at java.lang.reflect.Method.invoke(Method.java:511)
09-27 17:44:48.422: E/AndroidRuntime(947):  at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:793)
09-27 17:44:48.422: E/AndroidRuntime(947):  at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:560)
09-27 17:44:48.422: E/AndroidRuntime(947):  at dalvik.system.NativeStart.main(Native Method)
09-27 17:44:48.422: E/AndroidRuntime(947): Caused by: java.lang.ClassNotFoundException: Didn't find class "com.parse.mech.ParseApplication" on path: /data/app/com.parse.mech-2.apk
09-27 17:44:48.422: E/AndroidRuntime(947):  at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:65)
09-27 17:44:48.422: E/AndroidRuntime(947):  at java.lang.ClassLoader.loadClass(ClassLoader.java:501)
09-27 17:44:48.422: E/AndroidRuntime(947):  at java.lang.ClassLoader.loadClass(ClassLoader.java:461)
09-27 17:44:48.422: E/AndroidRuntime(947):  at       android.app.Instrumentation.newApplication(Instrumentation.java:968)
  09-27 17:44:48.422: E/AndroidRuntime(947):    at android.app.LoadedApk.makeApplication(LoadedApk.java:499)
 09-27 17:44:48.422: E/AndroidRuntime(947):     ... 11 more

this is my manifest.xml

<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.parse.mech"
android:versionCode="1"
android:versionName="1.0" >

<uses-sdk
    android:minSdkVersion="4"
    android:targetSdkVersion="15" />

<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED" />
<uses-permission android:name="android.permission.VIBRATE" />

<application
    android:name="Mech"
    android:icon="@drawable/ic_launcher"
    android:label="@string/app_name" >
    <activity
        android:name=".ParseStarterProjectActivity"
        android:label="@string/app_name" >
        <intent-filter>
            <action android:name="android.intent.action.MAIN" />

            <category android:name="android.intent.category.LAUNCHER" />
        </intent-filter>
    </activity>

    <service android:name="com.parse.PushService" />

    <receiver android:name="com.parse.ParseBroadcastReceiver" >
        <intent-filter>
            <action android:name="android.intent.action.BOOT_COMPLETED" />
            <action android:name="android.intent.action.USER_PRESENT" />
        </intent-filter>
    </receiver>
</application>

wat are the changes i have to do in this .....thanks in advance

Parthi
  • 135
  • 4
  • 14
  • First thing to understand. There is an error or you would not have a crash. Eclipse can only show you *compiler errors*, it cannot show you *runtime errors*. – Simon Oct 13 '13 at 14:15

4 Answers4

0

com.parse.mech.ParseApplication

Add this class to your manifest.

Caused by: java.lang.ClassNotFoundException: Didn't find class "com.parse.mech.ParseApplication" on path:    /data/app/com.parse.mech-2.apk
09-27 17:44:48.422: E/AndroidRuntime(947):  at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:65)

Add this to your manifest:

    <activity
        android:name=".ParseApplication"
        android:label="@string/app_name" >
    </activity>
Simon
  • 14,407
  • 8
  • 46
  • 61
  • http://stackoverflow.com/questions/3832619/add-a-new-activity-to-the-androidmanifest – Simon Oct 13 '13 at 14:48
  • I've edited my answer. This is really basic stuff. You should follow the tutorials at developer.android.com – Simon Oct 13 '13 at 16:27
0

I get this error when I run and load the application directly to my phone from Eclipse and in my phone the application is already running. So, if it's same for you then it's not a problem. If you want to avoid the error , you can try manually uninstalling the app from your phone/emulator and then try again running the project from Eclipse. Hope it helps.

ayon
  • 2,180
  • 2
  • 17
  • 32
0

: Didn't find class "com.parse.mech.ParseApplication" on path: /data/app/com.parse.mech-2.apk in your android manifest activity block if you precede your android name with a period the package path will be appended so if you have ".com.parse.mech2" it will look for "com.parse.com.parse.mech2 " so either remove the period or don't give full name. Also like Simon says you can have compile time errors,link time errors, runtime errors etc.logcat helps and learning to run the debugger also helps.

0

I think you forget to add . before your Class name of application

like name=.Mech

or you can add full path

name = com.parse.mech.Mech 

and thi too

com.parse.mech.ParseStarterProjectActivity

Your Manifest should be like this

<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.parse.mech"
android:versionCode="1"
android:versionName="1.0" >

<uses-sdk
    android:minSdkVersion="4"
    android:targetSdkVersion="15" />

<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED" />
<uses-permission android:name="android.permission.VIBRATE" />

<application
    android:name="com.parse.mech.Mech"
    android:icon="@drawable/ic_launcher"
    android:label="@string/app_name" >
    <activity
        android:name="com.parse.mech.ParseStarterProjectActivity"
        android:label="@string/app_name" >
        <intent-filter>
            <action android:name="android.intent.action.MAIN" />

            <category android:name="android.intent.category.LAUNCHER" />
        </intent-filter>
    </activity>

    <service android:name="com.parse.PushService" />

    <receiver android:name="com.parse.ParseBroadcastReceiver" >
        <intent-filter>
            <action android:name="android.intent.action.BOOT_COMPLETED" />
            <action android:name="android.intent.action.USER_PRESENT" />
        </intent-filter>
    </receiver>
</application>
Trikaldarshiii
  • 11,174
  • 16
  • 67
  • 95
  • i did everything....I ran the parse existing project downloaded from parse.com still i get the error – Parthi Oct 13 '13 at 16:48