我可以在我的应用上找到任何错误,但它只是工作和崩溃
03-11 13:55:40.193: E/AndroidRuntime(1192): FATAL EXCEPTION: main
03-11 13:55:40.193: E/AndroidRuntime(1192): java.lang.RuntimeException: Unable to instantiate application com.example.handshake: java.lang.ClassNotFoundException: Didn't find class "com.example.handshake" on path: DexPathList[[zip file "/data/app/com.example.handshake-1.apk"],nativeLibraryDirectories=[/data/app-lib/com.example.handshake-1, /system/lib]]
03-11 13:55:40.193: E/AndroidRuntime(1192): at android.app.LoadedApk.makeApplication(LoadedApk.java:509)
03-11 13:55:40.193: E/AndroidRuntime(1192): at android.app.ActivityThread.handleBindApplication(ActivityThread.java:4417)
03-11 13:55:40.193: E/AndroidRuntime(1192): at android.app.ActivityThread.access$1300(ActivityThread.java:141)
03-11 13:55:40.193: E/AndroidRuntime(1192): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1316)
03-11 13:55:40.193: E/AndroidRuntime(1192): at android.os.Handler.dispatchMessage(Handler.java:99)
03-11 13:55:40.193: E/AndroidRuntime(1192): at android.os.Looper.loop(Looper.java:137)
03-11 13:55:40.193: E/AndroidRuntime(1192): at android.app.ActivityThread.main(ActivityThread.java:5103)
03-11 13:55:40.193: E/AndroidRuntime(1192): at java.lang.reflect.Method.invokeNative(Native Method)
03-11 13:55:40.193: E/AndroidRuntime(1192): at java.lang.reflect.Method.invoke(Method.java:525)
03-11 13:55:40.193: E/AndroidRuntime(1192): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:737)
03-11 13:55:40.193: E/AndroidRuntime(1192): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:553)
03-11 13:55:40.193: E/AndroidRuntime(1192): at dalvik.system.NativeStart.main(Native Method)
03-11 13:55:40.193: E/AndroidRuntime(1192): Caused by: java.lang.ClassNotFoundException: Didn't find class "com.example.handshake" on path: DexPathList[[zip file "/data/app/com.example.handshake-1.apk"],nativeLibraryDirectories=[/data/app-lib/com.example.handshake-1, /system/lib]]
03-11 13:55:40.193: E/AndroidRuntime(1192): at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:53)
03-11 13:55:40.193: E/AndroidRuntime(1192): at java.lang.ClassLoader.loadClass(ClassLoader.java:501)
03-11 13:55:40.193: E/AndroidRuntime(1192): at java.lang.ClassLoader.loadClass(ClassLoader.java:461)
03-11 13:55:40.193: E/AndroidRuntime(1192): at android.app.Instrumentation.newApplication(Instrumentation.java:975)
03-11 13:55:40.193: E/AndroidRuntime(1192): at android.app.LoadedApk.makeApplication(LoadedApk.java:504)
我的应用程序有什么问题,下面是我的Android Manifest
,有人可以帮忙查看,有什么用
Unable to instantiate application com.example.handshake: java.lang.ClassNotFoundException: Didn't find class "com.example.handshake" on path: DexPathList[[zip file "/data/app/com.example.handshake-1.apk"],nativeLibraryDirectories=[/data/app-lib/com.example.handshake-1, /system/lib]]
装置?
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.handshake"
android:versionCode="1"
android:versionName="1.0" >
<uses-sdk
android:minSdkVersion="4"
android:targetSdkVersion="15" />
<uses-permission android:name="android.permission.INTERNET" />
<application
android:name="Handshake"
android:icon="@drawable/ic_launcher"
android:label="@string/app_name" >
<activity
android:name=".MainActivity"
android:label="@string/app_name" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity android:name=".LoginSignupActivity" >
</activity>
<activity android:name=".Welcome" >
</activity>
</application>
</manifest>
我的mainActivity.java
package com.example.handshake;
import com.parse.ParseAnonymousUtils;
import com.parse.ParseUser;
import android.os.Bundle;
import android.app.Activity;
import android.content.Intent;
public class MainActivity extends Activity {
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
// Determine whether the current user is an anonymous user
if (ParseAnonymousUtils.isLinked(ParseUser.getCurrentUser())) {
// If user is anonymous, send the user to LoginSignupActivity.class
Intent intent = new Intent(MainActivity.this,
LoginSignupActivity.class);
startActivity(intent);
finish();
} else {
// If current user is NOT anonymous user
// Get current user data from Parse.com
ParseUser currentUser = ParseUser.getCurrentUser();
if (currentUser != null) {
// Send logged in users to Welcome.class
Intent intent = new Intent(MainActivity.this, Welcome.class);
startActivity(intent);
finish();
} else {
// Send user to LoginSignupActivity.class
Intent intent = new Intent(MainActivity.this,
LoginSignupActivity.class);
startActivity(intent);
finish();
}
}
}
}
mY PARSE APPLICATION.JAVA
package com.example.handshake;
import com.parse.Parse;
import com.parse.ParseACL;
import com.parse.ParseUser;
import android.app.Application;
public class ParseApplication extends Application {
@Override
public void onCreate() {
super.onCreate();
// Add your initialization code here
Parse.initialize(this, "Gy6cJBwa0XJz3n08Oan7QPIZBFeimZjbGuu8ZK5T", "SMFf1m3jBj2HBtVm0Q0OoEpMhQC4oYgVoDn4hfT8");
ParseUser.enableAutomaticUser();
ParseACL defaultACL = new ParseACL();
// If you would like all objects to be private by default, remove this
// line.
defaultACL.setPublicReadAccess(true);
ParseACL.setDefaultACL(defaultACL, true);
}
}
答案 0 :(得分:0)
我只是更改了我的android Manifest并且问题解决了,我将android名称的名称更改为&#34; ParseApplication&#34; ................... .................................................. .................................................. ..................
<application
android:name="ParseApplication"
android:icon="@drawable/ic_launcher"
android:label="@string/app_name" >
<activity
android:name=".MainActivity"
android:label="@string/app_name" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity android:name=".LoginSignupActivity" >
</activity>
<activity android:name=".Welcome" >
</activity>
</application>