android上的phonegap应用程序在运行时崩溃

时间:2014-05-29 12:06:11

标签: android cordova

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

    <uses-sdk
        android:minSdkVersion="8"
        android:targetSdkVersion="19" />

    <supports-screens
        android:largeScreens="true"
        android:normalScreens="true"
        android:smallScreens="true"
        android:xlargeScreens="true"
        android:resizeable="true"
        android:anyDensity="true"
        />

    <uses-permission android:name="android.permission.CAMERA" />
    <uses-permission android:name="android.permission.VIBRATE" />
    <uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
    <uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
    <uses-permission android:name="android.permission.ACCESS_LOCATION_EXTRA_COMMANDS" />
    <uses-permission android:name="android.permission.INTERNET" />
    <uses-permission android:name="android.permission.RECEIVE_SMS" />
    <uses-permission android:name="android.permission.RECORD_AUDIO" />
    <uses-permission android:name="android.permission.RECORD_VIDEO"/>
    <uses-permission android:name="android.permission.MODIFY_AUDIO_SETTINGS" />
    <uses-permission android:name="android.permission.READ_CONTACTS" />
    <uses-permission android:name="android.permission.WRITE_CONTACTS" />   
    <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />   
    <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
    <uses-permission android:name="android.permission.GET_ACCOUNTS" />
    <uses-permission android:name="android.permission.BROADCAST_STICKY" />

    <application
        android:allowBackup="true"
        android:icon="@drawable/ic_launcher"
        android:label="@string/app_name"
        android:theme="@style/AppTheme" >
        <activity
            android:name="com.example.testproj.MainActivity"
            android:configChanges="orientation|keyboardHidden"
            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="com.facebook.LoginActivity"
                  android:theme="@android:style/Theme.Translucent.NoTitleBar"
                  android:label="@string/app_name" />
    </application>

</manifest>

这是我的Logcat输出:

E/AndroidRuntime(1028): FATAL EXCEPTION: main
E/AndroidRuntime(1028): java.lang.RuntimeException: Unable to instantiate activity ComponentInfo{com.example.testproj/com.example.testproj.MainActivity}: java.lang.ClassNotFoundException: com.example.testproj.MainActivity in loader dalvik.system.PathClassLoader[/data/app/com.example.testproj-2.apk]
E/AndroidRuntime(1028):     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1569)
E/AndroidRuntime(1028):     at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:1663)
E/AndroidRuntime(1028):     at android.app.ActivityThread.access$1500(ActivityThread.java:117)
E/AndroidRuntime(1028):     at android.app.ActivityThread$H.handleMessage(ActivityThread.java:931)
E/AndroidRuntime(1028):     at android.os.Handler.dispatchMessage(Handler.java:99)
E/AndroidRuntime(1028):     at android.os.Looper.loop(Looper.java:123)
E/AndroidRuntime(1028):     at android.app.ActivityThread.main(ActivityThread.java:3683)
E/AndroidRuntime(1028):     at java.lang.reflect.Method.invokeNative(Native Method)
E/AndroidRuntime(1028):     at java.lang.reflect.Method.invoke(Method.java:507)
E/AndroidRuntime(1028):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:839)
E/AndroidRuntime(1028):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:597)
E/AndroidRuntime(1028):     at dalvik.system.NativeStart.main(Native Method)
E/AndroidRuntime(1028): Caused by: java.lang.ClassNotFoundException: com.example.testproj.MainActivity in loader dalvik.system.PathClassLoader[/data/app/com.example.testproj-2.apk]
E/AndroidRuntime(1028):     at dalvik.system.PathClassLoader.findClass(PathClassLoader.java:240)
E/AndroidRuntime(1028):     at java.lang.ClassLoader.loadClass(ClassLoader.java:551)
E/AndroidRuntime(1028):     at java.lang.ClassLoader.loadClass(ClassLoader.java:511)
E/AndroidRuntime(1028):     at android.app.Instrumentation.newActivity(Instrumentation.java:1021)
E/AndroidRuntime(1028):     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1561)
E/AndroidRuntime(1028):     ... 11 more

0 个答案:

没有答案