[英]"Could not identify launch activity: Default Activity not found" - Android Studio - no answers working
Whenever trying to run the app, getting the error:每当尝试运行应用程序时,都会出现错误:
"Could not identify launch activity: Default Activity not found". “无法识别启动活动:未找到默认活动”。
I have seen a few other threads on the same issue, but the below solutions have not worked for me:我在同一问题上看到了其他一些线程,但以下解决方案对我不起作用:
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.mywebname">
<uses-permission android:name="android.permission.INTERNET"/>
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/>
<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:screenOrientation="portrait"
android:label="@string/app_name">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity
android:name=".ListenScreen"
android:parentActivityName=".MainActivity"
android:screenOrientation="portrait">
</activity>
</application>
</manifest>
```
As you can see, I have clearly declared the activities (my app only has 2 so far), and I've put the intents around the ".MainActivity".
This answer worked for me after trying so many other tweaks, just adding the package name solved my problems在尝试了许多其他调整之后,这个答案对我有用,只需添加包名称就解决了我的问题
<manifest xmlns:android="http://schemas.android.com/apk/res/android" package="com.example.name">
https://stackoverflow.com/a/72300233/8720836 https://stackoverflow.com/a/72300233/8720836
您只需在清单标签中添加包名称即可在 app.gradle 文件中找到您的包名称,一切顺利
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.