应用程序崩溃意外,我无法阅读原因

时间:2013-05-28 10:31:32

标签: android

我的应用程序崩溃了这条消息:

05-28 12:28:22.931: E/AndroidRuntime(22082): FATAL EXCEPTION: main
05-28 12:28:22.931: E/AndroidRuntime(22082): java.lang.VerifyError: com/text/foo/MainActivity
05-28 12:28:22.931: E/AndroidRuntime(22082):    at java.lang.Class.newInstanceImpl(Native Method)
05-28 12:28:22.931: E/AndroidRuntime(22082):    at java.lang.Class.newInstance(Class.java:1319)
05-28 12:28:22.931: E/AndroidRuntime(22082):    at android.app.Instrumentation.newActivity(Instrumentation.java:1054)
05-28 12:28:22.931: E/AndroidRuntime(22082):    at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2097)
05-28 12:28:22.931: E/AndroidRuntime(22082):    at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2230)
05-28 12:28:22.931: E/AndroidRuntime(22082):    at android.app.ActivityThread.access$600(ActivityThread.java:141)
05-28 12:28:22.931: E/AndroidRuntime(22082):    at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1234)
05-28 12:28:22.931: E/AndroidRuntime(22082):    at android.os.Handler.dispatchMessage(Handler.java:99)
05-28 12:28:22.931: E/AndroidRuntime(22082):    at android.os.Looper.loop(Looper.java:137)
05-28 12:28:22.931: E/AndroidRuntime(22082):    at android.app.ActivityThread.main(ActivityThread.java:5041)
05-28 12:28:22.931: E/AndroidRuntime(22082):    at java.lang.reflect.Method.invokeNative(Native Method)
05-28 12:28:22.931: E/AndroidRuntime(22082):    at java.lang.reflect.Method.invoke(Method.java:511)
05-28 12:28:22.931: E/AndroidRuntime(22082):    at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:793)
05-28 12:28:22.931: E/AndroidRuntime(22082):    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:560)
05-28 12:28:22.931: E/AndroidRuntime(22082):    at dalvik.system.NativeStart.main(Native Method)

这可能是什么原因?

我的活动:

package com.text.foo;

import java.util.LinkedList;
import java.util.List;

import android.os.Bundle;
import android.app.Activity;
import android.support.v4.widget.SimpleCursorAdapter;
import android.view.Menu;
import android.widget.ListView;

public class MainActivity extends Activity {

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);

    }

    @Override
    public boolean onCreateOptionsMenu(Menu menu) {
        // Inflate the menu; this adds items to the action bar if it is present.
        getMenuInflater().inflate(R.menu.main, menu);
        return true;
    }

}

我的清单:

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

    <uses-sdk
        android:minSdkVersion="14"
        android:targetSdkVersion="17" />

    <application
        android:allowBackup="true"
        android:icon="@drawable/ic_launcher"
        android:label="@string/app_name"
        android:theme="@style/AppTheme" >
        <activity
            android:name="com.text.foo.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>
    </application>

</manifest>

1 个答案:

答案 0 :(得分:1)

可能是您在android:minSdkVersion

下面的设备上运行应用程序