gpt4 book ai didi

android - 在 list 文件中找不到 MainActivity,但我声明了它

转载 作者:行者123 更新时间:2023-11-29 23:30:37 25 4
gpt4 key购买 nike

我正在使用 Android Studio 3.2。我无法通过显示错误来运行 android 项目:

MainActivity not found in the Manifest file

但我也声明了,然后我也不能创建新项目。因此,我将卸载并重新安装 android studio 并清理 android studio 设置。但它不起作用。

当我还创建一个新项目时显示以下错误:

> MyApplication\app\src\main\res\values\colors.xml:1:1: Error: Content is not allowed in prolog.

当我运行现有项目时显示此消息:

MainActivity not found in Manifest file

enter image description here

list :

<?xml version="1.0" encoding="utf-8"?>
<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>

最佳答案

<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
package="com.yourpackage.applicationname">

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

关于android - 在 list 文件中找不到 MainActivity,但我声明了它,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/52754304/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com