AndroidManifest.xml验证错误和应用程序无法识别用途:权限

时间:2015-10-12 09:53:26

标签: android xml validation

当我验证AndroidManifest.xml

时,我在Android studio中的所有项目都会导致以下错误
Error:(3, 43) cvc-elt.1: Cannot find the declaration of element 'manifest'.
Error:(1, 56) s4s-elt-schema-ns: The namespace of element 'x' must be from the schema namespace, 'http://www.w3.org/2001/XMLSchema'.
Error:(1, 56) s4s-elt-invalid: Element 'x' is not a valid element in a schema document.
Error:(1, 56) schema_reference.4: Failed to read schema document 'null', because 1) could not find the document; 2) the document could not be read; 3) the root element of the document is not <xsd:schema>.

该应用程序无法识别下所述的任何权限。我尝试了READ_CONTACTS和S END_SMS

我验证了AndroidManifest.xml,xml很好。

清单代码是:

<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    package="com.example.jyo.dedlymenu2" >
    <uses-sdk android:minSdkVersion="8" />
    <uses-permission android:name="android.permission.SEND_SMS" />
    <uses-permission android:name="android.permission.INTERNET" />
    <uses-permission android:name="android.permission.READ_CONTACTS" />
    <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>
        <activity
            android:name=".Love"
            android:label="@string/title_activity_love" >
        </activity>
        <activity
            android:name=".Friendship"
            android:label="@string/title_activity_friendship" >
        </activity>
        <activity
            android:name=".Inspire"
            android:label="@string/title_activity_inspire" >
        </activity>
        <activity
            android:name=".ThankYou"
            android:label="@string/title_activity_thank_you" >
        </activity>
        <activity
            android:name=".AddLyrics"
            android:label="@string/title_activity_add_lyrics" >
        </activity>
        <activity
            android:name=".LyricDetail"
            android:label="@string/title_activity_lyric_detail" >
        </activity>

        <activity
            android:name=".PrintDB"
            android:label="@string/title_activity_print_db" >
        </activity>
    </application>

</manifest>

请说明出错的地方。

1 个答案:

答案 0 :(得分:0)

清除项目文件夹中的.idea文件并尝试重建它......它可以正常工作