Android Studio 清单文件错误
Android Studio Manifest file error
我的 AndroidManifest.xml 文件出了点问题。我再次启动测试时突然 Android Studio 崩溃,再次启动然后出现下一个错误(对不起,我没有足够的评级直接上传图片):
这里是 gradle 控制台:
我的strings.xml文件没问题:
<resources>
<string title="app_name">PaySpaceMagazine</string>
<string title="hello_world">Hello world!</string>
<string title="action_settings">Settings</string>
<string title="actual">Актуально</string>
<string title="last_news">Последние известия</string>
还有其他没有任何错误的清单文件:
<?xml version="1.0" encoding="utf-8"?>
<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: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:title
而不是 android:name
作为 Activity
。将其更改为
android:name=".MainActivity"
属性 是强制性的。你可以阅读更多here
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
尝试将您的清单文件更改为此
这是问题所在,它没有从应该显示应用程序名称的字符串中提取出来
android:label="@string/app_name"
最简单的解决方案是创建新的应用程序项目打开清单副本,该行让用户不要按下它,否则您将再次中断字符串如果您想要更改名称,请将行粘贴到中断的字符串上转到字符串 xml 更改那里的名字
我的 AndroidManifest.xml 文件出了点问题。我再次启动测试时突然 Android Studio 崩溃,再次启动然后出现下一个错误(对不起,我没有足够的评级直接上传图片):
这里是 gradle 控制台:
我的strings.xml文件没问题:
<resources>
<string title="app_name">PaySpaceMagazine</string>
<string title="hello_world">Hello world!</string>
<string title="action_settings">Settings</string>
<string title="actual">Актуально</string>
<string title="last_news">Последние известия</string>
还有其他没有任何错误的清单文件:
<?xml version="1.0" encoding="utf-8"?>
<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: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:title
而不是 android:name
作为 Activity
。将其更改为
android:name=".MainActivity"
属性 是强制性的。你可以阅读更多here
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
尝试将您的清单文件更改为此
这是问题所在,它没有从应该显示应用程序名称的字符串中提取出来
android:label="@string/app_name"
最简单的解决方案是创建新的应用程序项目打开清单副本,该行让用户不要按下它,否则您将再次中断字符串如果您想要更改名称,请将行粘贴到中断的字符串上转到字符串 xml 更改那里的名字