选择run as  Android Application 才行 

解决方案 »

  1.   

    你到底是写Android程序还是写Android junit程序啊,哪有你这么写的啊,测试程序是独立的应用,你这都写在一起了,这是什么玩意啊。你这配置文件写的根本不对,能运行起来就怪了,你看看官方example中的测试程序。
      

  2.   

    大部分情况,第一个程序是从HelloWorld开始熟悉某一种语言的规定的。
      

  3.   

    明明是run as Android Junit test
      

  4.   

    你应该建立一个Android Junit  test应用!
      

  5.   

    <uses-library android:name="android.test.runner"/>
    位置明显放错了,应该在application里面!!
    如下:<?xml version="1.0" encoding="utf-8"?>
    <manifest xmlns:android="http://schemas.android.com/apk/res/android"
        package="netke.net"
        android:versionCode="1"
        android:versionName="1.0" >    <uses-sdk android:minSdkVersion="10" />      <application
            android:icon="@drawable/ic_launcher"
            android:label="@string/app_name" >
           <uses-library android:name="android.test.runner"/>
            <activity
                android:label="@string/app_name"
                android:name=".MainActivity" >
                <intent-filter >
                    <action android:name="android.intent.action.MAIN" />                <category android:name="android.intent.category.LAUNCHER" />
                </intent-filter>
            </activity>
        </application>
        <instrumentation
            android:name="android.test.InstrumentationTestRunner"
            android:targetPackage="netke.net" android:label="aaa" />
    </manifest>
      

  6.   

    楼上正解,<uses-library android:name="android.test.runner"/>应该在application里面!!
    另外一个容易出错的地方是<instrumentation
            android:name="android.test.InstrumentationTestRunner"
            android:targetPackage="netke.net" android:label="aaa" />
    应该放在    <application>外面,楼主这里没有写错。