简体   繁体   English

Android Studio 清单文件错误

[英]Android Studio Manifest file error

Something went wrong with my AndroidManifest.xml file.我的 AndroidManifest.xml 文件出了点​​问题。 I was launching tests one more time when suddenly Android Studio crashed, launched again and then next error occured (I'm sorry, I don't have enough rating to upload pictures directly):我再次启动测试时突然 Android Studio 崩溃,再次启动然后发生下一个错误(对不起,我没有足够的评级直接上传图片): 在此处输入图片说明

Here is the gradle console:这是gradle控制台: 在此处输入图片说明

My strings.xml file is ok:我的 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>

Also there is other manifest file without any errors:还有其他清单文件没有任何错误:

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

Did anyone have same problem?有没有人有同样的问题?

in the Manifest you posted in the screenshot you are using android:title instead of android:name for your Activity s.在您在屏幕截图中发布的清单中,您使用android:title而不是android:name作为您的Activity Change it with改变它

 android:name=".MainActivity"

the property is mandatory.该属性是强制性的。 You can read more here你可以在这里阅读更多

<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />

Try changing your manifest file to this尝试将您的清单文件更改为此

this is the problem its not pulling from the string it should be showing the app name这是问题,它没有从它应该显示应用程序名称的字符串中提取

android:label="@string/app_name" android:label="@string/app_name"

the easiest solution create new app proyect open manifest copy that line make user not to press it or you will break string again paste line over your broken string if you want change name go to the strings xml change name there最简单的解决方案创建新的应用程序项目打开清单复制该行让用户不要按下它,否则您将再次断开字符串将行粘贴到断开的字符串上,如果您想更改名称,请转到那里的字符串 xml 更改名称

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM