此处不允许使用 Android 清单属性 [英] Android manifest attribute not allowed here

查看:70
本文介绍了此处不允许使用 Android 清单属性的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有几个关于某些属性的明显错误.我没有对应用程序自动生成的清单进行任何更改,但出现了几个错误.*(我使用的是 Android Studio 1.2.2)

I have several manifest errors regarding some attributes . I have not made any changes to the manifest the application generated automatically yet i get several errors. *( I'm using Android Studio 1.2.2)

<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    package="com.example.iustinian.girlfriendsolver"
    android:versionCode="1"
    android:versionName="1.0" >

    <uses-sdk
        android:minSdkVersion="14"
        android:targetSdkVersion="22" />

    <application
        android:allowBackup="true"
        android:icon="@mipmap/ic_launcher"
        android:label="@string/app_name"
        android:theme="@style/AppTheme" >
        <activity
            android:name="com.example.iustinian.girlfriendsolver.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>

</manifest>

-对于 xmlns:android 属性,我得到URL 未注册"- 对于 android versionCode 、 versionName 、 allowBackup 、 label 和 theme 我得到这里不允许的属性"

-For the xmlns:android attribute i get "URL not registered " -For android versionCode , versionName , allowBackup , label and theme I get "attribute not allowed here "

我查看了清单文档,但找不到答案.例如,allowBackup 属性的放置与文档指定的完全相同.

I took a look at the manifest documentation and couldn't find an answer . For example the allowBackup attribute is placed exactly like the documentation specifies .

环顾四周后,我发现在 android:theme "@style/AppTheme" 我得到一个 no resource matching the given name .这是 Gradle Build 中唯一显示的内容.我已经多次清理和重建项目.

after looking around some more I found that at android:theme "@style/AppTheme" I get a no resource matches the given name . This is the only thing that shows up in the Gradle Build . I have cleaned and rebuilt the project several times .

推荐答案

只需关闭清单文件并重新打开即可.它对我有用.

Just Close your manifest file and reopen it. It worked for me.

这篇关于此处不允许使用 Android 清单属性的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆