【求教】【首次测试一堆报错T_T】

还不允许重名逗我呢 发布于 2014/11/30 17:13
阅读 105
收藏 0

首次用eclipse测试android程序,一堆报错如下:


11-30 13:41:17.102: D/dalvikvm(619):         
           Not late-enabling CheckJNI (already on)
11-30 13:41:18.152: E/Trace(619): 
           error opening trace file: No such file or directory (2)
11-30 13:41:18.422: D/AndroidRuntime(619):
           Shutting down VM
11-30 13:41:18.452: W/dalvikvm(619): 
           threadid=1: thread exiting with uncaught exception (group=0x40a13300)
11-30 13:41:18.502: E/AndroidRuntime(619): 
            FATAL EXCEPTION: main
11-30 13:41:18.502: E/AndroidRuntime(619): 
             java.lang.RuntimeException: Unable to instantiate activity 
             ComponentInfo{com.wuyang.test2/com.wuyang.test2.MainActivity}: 
             java.lang.ClassNotFoundException: com.wuyang.test2.MainActivity
11-30 13:41:18.502: E/AndroidRuntime(619): 
            at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1983)
11-30 13:41:18.502: E/AndroidRuntime(619): 
           at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2084)
11-30 13:41:18.502: E/AndroidRuntime(619): 
           at android.app.ActivityThread.access$600(ActivityThread.java:130)
11-30 13:41:18.502: E/AndroidRuntime(619): 
           at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1195)
11-30 13:41:18.502: E/AndroidRuntime(619): 
           at android.os.Handler.dispatchMessage(Handler.java:99)
11-30 13:41:18.502: E/AndroidRuntime(619):
           at android.os.Looper.loop(Looper.java:137)
11-30 13:41:18.502: E/AndroidRuntime(619): 
           at android.app.ActivityThread.main(ActivityThread.java:4745)
11-30 13:41:18.502: E/AndroidRuntime(619):
           at java.lang.reflect.Method.invokeNative(Native Method)
11-30 13:41:18.502: E/AndroidRuntime(619): 
           at java.lang.reflect.Method.invoke(Method.java:511)
11-30 13:41:18.502: E/AndroidRuntime(619):
           at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:786)
11-30 13:41:18.502: E/AndroidRuntime(619):
           at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:553)
11-30 13:41:18.502: E/AndroidRuntime(619):
           at dalvik.system.NativeStart.main(Native Method)
11-30 13:41:18.502: E/AndroidRuntime(619): 
           Caused by: java.lang.ClassNotFoundException: com.wuyang.test2.MainActivity
11-30 13:41:18.502: E/AndroidRuntime(619): 
           at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:61)
11-30 13:41:18.502: E/AndroidRuntime(619): 
           at java.lang.ClassLoader.loadClass(ClassLoader.java:501)
11-30 13:41:18.502: E/AndroidRuntime(619):
           at java.lang.ClassLoader.loadClass(ClassLoader.java:461)
11-30 13:41:18.502: E/AndroidRuntime(619): 
           at android.app.Instrumentation.newActivity(Instrumentation.java:1053)
11-30 13:41:18.502: E/AndroidRuntime(619):
           at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1974)
11-30 13:41:18.502: E/AndroidRuntime(619): 
           ... 11 more

因为是第一次对我打击很大T_T,所以请大神们帮我看看困扰好久了谢谢

----------------------------------------------------------------------------------------------------

package com.wuyang;

import android.app.Activity;
import android.os.Bundle;
import com.wuyang.test2.R;

public class MainActivity extends Activity {
  @Override
  protected void onCreate(Bundle savedInstanceState) {
  // TODO Auto-generated method stub
    super.onCreate(savedInstanceState);
    setContentView(R.layout.main_activity);
  }
}
----------------------------------------------------------------------------------------------------

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:orientation="vertical"
    >
       <TextView  
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:id="@+id/UserName"
            android:textSize="20sp"
            android:text="@string/user_name"
            />
</LinearLayout>

----------------------------------------------------------------------------------------------------


<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    package="com.wuyang.test2"
    android:versionCode="1"
    android:versionName="1.0" >

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

    <application
        android:allowBackup="true"
        android:icon="@drawable/ic_launcher"
        android:label="@string/app_name"
        android:theme="@style/AppTheme" 
        >
        <activity android:name="MainActivity">
            <intent-filter >
                <action android:name="android.intent.action.MAIN"/>
                <category android:name="android.intent.category.LAUNCHER"/>
            </intent-filter>
        </activity>
    </application>
</manifest>


加载中
返回顶部
顶部