不幸的是,AndroidFirst已经停止的是、不幸、AndroidFirst

2023-09-12 05:51:53 作者:人潮拥挤你不在ヾ

我在Android应用程序与功放的初学者;刚开始建设第一个HelloWorld的应用程序。我也跟着官方的教程和设计仿真器。但是,当我运行它,模拟器说:不幸的是,AndroidFirst已经停止。我看了看周围的左右,但不同的解决方案,并没有帮助。我是一个很初级的Andr​​ oid,因此无法找到错误或类似错误/错误的东西。

I am a beginner in android application & just started building first "HelloWorld" app. i followed official tutorial and designed emulator. But when i run it, the emulator says "Unfortunately, AndroidFirst has stopped". I looked around on SO but different solutions didn't help. I am a very beginner for Android, hence can't find the bug or something like wrong/error.

下面是logcat的:

following is logCat:

08-29 05:16:58.629: W/dalvikvm(1934): VFY: unable to resolve static field 1864 (ActionBarWindow) in Landroid/support/v7/appcompat/R$styleable;
08-29 05:16:58.629: D/dalvikvm(1934): VFY: replacing opcode 0x62 at 0x0004
08-29 05:16:58.649: D/AndroidRuntime(1934): Shutting down VM
08-29 05:16:58.649: W/dalvikvm(1934): threadid=1: thread exiting with uncaught exception (group=0xb1daece8)
08-29 05:16:58.669: E/AndroidRuntime(1934): FATAL EXCEPTION: main
08-29 05:16:58.669: E/AndroidRuntime(1934): Process: com.example.androidfirst, PID: 1934
08-29 05:16:58.669: E/AndroidRuntime(1934): java.lang.NoClassDefFoundError: android.support.v7.appcompat.R$styleable
08-29 05:16:58.669: E/AndroidRuntime(1934):     at android.support.v7.app.ActionBarActivityDelegate.onCreate(ActionBarActivityDelegate.java:106)
08-29 05:16:58.669: E/AndroidRuntime(1934):     at android.support.v7.app.ActionBarActivityDelegateICS.onCreate(ActionBarActivityDelegateICS.java:57)
08-29 05:16:58.669: E/AndroidRuntime(1934):     at android.support.v7.app.ActionBarActivity.onCreate(ActionBarActivity.java:99)
08-29 05:16:58.669: E/AndroidRuntime(1934):     at com.example.androidfirst.MainActivity.onCreate(MainActivity.java:13)
08-29 05:16:58.669: E/AndroidRuntime(1934):     at android.app.Activity.performCreate(Activity.java:5242)
08-29 05:16:58.669: E/AndroidRuntime(1934):     at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1087)
08-29 05:16:58.669: E/AndroidRuntime(1934):     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2161)
08-29 05:16:58.669: E/AndroidRuntime(1934):     at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2258)
08-29 05:16:58.669: E/AndroidRuntime(1934):     at android.app.ActivityThread.access$800(ActivityThread.java:138)
08-29 05:16:58.669: E/AndroidRuntime(1934):     at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1209)
08-29 05:16:58.669: E/AndroidRuntime(1934):     at android.os.Handler.dispatchMessage(Handler.java:102)
08-29 05:16:58.669: E/AndroidRuntime(1934):     at android.os.Looper.loop(Looper.java:136)
08-29 05:16:58.669: E/AndroidRuntime(1934):     at android.app.ActivityThread.main(ActivityThread.java:5026)
08-29 05:16:58.669: E/AndroidRuntime(1934):     at java.lang.reflect.Method.invokeNative(Native Method)
08-29 05:16:58.669: E/AndroidRuntime(1934):     at java.lang.reflect.Method.invoke(Method.java:515)
08-29 05:16:58.669: E/AndroidRuntime(1934):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:777)
08-29 05:16:58.669: E/AndroidRuntime(1934):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:602)
08-29 05:16:58.669: E/AndroidRuntime(1934):     at dalvik.system.NativeStart.main(Native Method)
08-29 05:21:58.843: I/Process(1934): Sending signal. PID: 1934 SIG: 9

MainActivity.java code:

MainActivity.java Code:

package com.example.androidfirst;

import android.support.v7.app.ActionBarActivity;
import android.os.Bundle;
import android.view.Menu;
import android.view.MenuItem;


public class MainActivity extends ActionBarActivity {

    @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;
    }

    @Override
    public boolean onOptionsItemSelected(MenuItem item) {
        // Handle action bar item clicks here. The action bar will
        // automatically handle clicks on the Home/Up button, so long
        // as you specify a parent activity in AndroidManifest.xml.
        int id = item.getItemId();
        if (id == R.id.action_settings) {
            return true;
        }
        return super.onOptionsItemSelected(item);
    }
}

AndroidManifest.xml中

AndroidManifest.xml

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

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

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

</manifest>

我会很感谢你的人!

I would be very thankful to you people!

推荐答案

当我下载API-19安培的问题解决;重新创建的AVD。在一个最初的尝试,AVD显示的Hello World关于模拟器的默认文本。

The problem resolve when i downloaded API-19 & re-created the AVD. On a very first attempt, the AVD shows "Hello World" the default text on emulator.