eclipse FAQ 与解决办法

本文介绍了如何解决Android应用开发中常见的三个问题:NoLauncheractivityfound错误、应用意外停止及单元测试配置错误。针对这些问题提供了具体的解决方案,包括配置启动Activity、调整ActionBar设置以及正确配置测试Runner。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

1、No Launcher activity found错误:

发现问题出在整个项目的那个主配置xml中,一般名字都是叫AndroidManifest.xml

里面没有配置启动项(原因多种多样),在<application></application>中少了这段代码

<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>


其中.MainActivity就是你的项目的主Activity

 

2、has unexpectly stopped

 

请注销// getActionBar().setDisplayHomeAsUpEnabled(true); 这段代码

 

3、retemp does not specify a android.test.InstrumentationTestRunner instrumentation or does not declare uses-library android.test.runner in its AndroidManifest.xml

 

 

 manifest.xml代码

    </application>
     <instrumentation
  
    android:name="android.test.InstrumentationTestRunner"
     android:targetPackage="com.example.com.example.retemp"
    android:label="Junit Test for RETEAMP " />

</manifest>

并将runas 下的run congfiguritions  instruments runner选中

 

 Unable to find instrumentation target package: com.example.com.example.retemp

   <application
        android:icon="@drawable/ic_launcher"
        android:label="@string/app_name"
        android:theme="@style/AppTheme" >
        <uses-library android:name="android.test.runner" /> 
        <activity

 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值