【问题标题】:AndroidManifest.xml validation errors and app not recognizing uses:permission'sAndroidManifest.xml 验证错误和应用无法识别用途:权限
【发布时间】:2016-01-09 18:13:43
【问题描述】:

当我验证 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和SEND_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>

请指出哪里出错了。

【问题讨论】:

    标签: android xml validation


    【解决方案1】:

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

    【讨论】:

    • 问题在于我的 Android 工作室工作空间中的所有项目。所以我猜这个问题与工作室安装中缺少一些软件包有关
    猜你喜欢
    • 2012-03-22
    • 1970-01-01
    • 2012-09-19
    • 1970-01-01
    • 1970-01-01
    • 2022-11-10
    • 2015-09-04
    • 1970-01-01
    • 2018-12-16
    相关资源
    最近更新 更多