今天在编译Android工程文件,由于是将其他工程代码移到该工程下编译的,所以编译出了点问题,报Error running app: Default Activity not found错误。
网上搜了下,一种方法是将 Edit Configurations中选择General目录下的Launch Options,选中Nothing,但是编译后模拟器中app并不能运行 。所以继续查找方法,最终在stackoverflow上找到了。问题定位在AndroidManifest.xml文件中,注意查看自己的该文件。本人自己的如下:

<?xml version="1.0" encoding="utf-8"?><manifest xmlns:android="http://schemas.android.com/apk/res/android"          package="com.example.zhuzhixiong.uibestpractice">    <application        android:allowBackup="true"        android:icon="@mipmap/ic_launcher"        android:label="@string/app_name"        android:roundIcon="@mipmap/ic_launcher_round"        android:supportsRtl="true"        android:theme="@style/AppTheme">    application>manifest>

修改后如下:

<?xml version="1.0" encoding="utf-8"?><manifest xmlns:android="http://schemas.android.com/apk/res/android"          package="com.example.zhuzhixiong.uibestpractice">    <application        android:allowBackup="true"        android:icon="@mipmap/ic_launcher"        android:label="@string/app_name"        android:roundIcon="@mipmap/ic_launcher_round"        android:supportsRtl="true"        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>

增加了activity后可编译成功运行。

更多相关文章

  1. Android(安卓)Activity启动(二) App内部activity跳转过程及原理
  2. LinearLayout和RelativeLayout绘制过程的对比
  3. Android(安卓)ListView的背景和黑色边缘化的问题
  4. 利用ActivityInstrumentationTestCase2测试Activity
  5. Ogre3d 之使用 Android(安卓)NativeActivity
  6. android开发之Parcelable使用详解
  7. 第一个Android工程HelloAndroid
  8. android sample之Notepad(带下划线的TestView)
  9. Android设置中“强行停止”详解

随机推荐

  1. Android Hook 机制之实战模拟
  2. Android贝壳单词客户端应用源码
  3. 2013 年第四届 Android 应用开发中国大学
  4. android开发AVD配置target为unknown(设备
  5. android widget简单开发三之实时刷新widg
  6. Android Framework(一) 系统架构及源码
  7. Android群英传笔记——第七章:Android动画
  8. android之文件上传
  9. android消息机制总结
  10. android EditText设置密码明文/密文显示(