Android 报错Could not identify launch activity
程序员文章站
2022-04-25 08:24:13
...
第一次编译Android Studio难免会发生一些问题,比如AS报错提示如下:
Could not identify launch activity: Default Activity not found Error while Launching activity
这是因为AndroidManifest.xml里面没有设置运行初始的activity
<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"
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>
一般都是漏了这句android:label="@string/app_name",补上重新运行就好了。
下一篇: 齐国的两位齐庄公有何作为?他们结局如何?
推荐阅读
-
Android Studio运行报错:You need to use a Theme.AppCompat theme (or descendant) with this activity. 的解决办法
-
Viewpager+Fragment 跳转Activity报错android.os.TransactionTooLargeException: data parcel size xxxxx bytes
-
AndroidStudio 报错:Could not find com.android.tools.build:gradle
-
Android Studio Build报错:Could not download support-v4.aar (com.android.support:support-v4:28.0.0)
-
Android 加了自定义Application后报错 Unable to instantiate activity ComponentInfo ClassNotFoundException
-
关于Studio编译时Gradle报错不能下载的问题android studio Could not resolve all files for configuration ‘:classpath‘
-
打开activity,报错java.lang.SecurityException: Permission Denial: starting Intent { act=android.intent.ac
-
Android Studio运行报错:You need to use a Theme.AppCompat theme (or descendant) with this activity. 的解决办法
-
Viewpager+Fragment 跳转Activity报错android.os.TransactionTooLargeException: data parcel size xxxxx bytes
-
AndroidStudio 报错:Could not find com.android.tools.build:gradle