【问题标题】:Android Studio : AndroidManifest.xml安卓工作室:AndroidManifest.xml
【发布时间】:2021-09-01 14:43:14
【问题描述】:

这是我的AndroidManifest.xml 文件,我收到了<uses-permission><application> 的两个多重根错误,我似乎不知道为什么。谁能帮忙解决这个问题?

<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
package="com.codepath.rkpandey.flixster" />

<uses-permission
xmlns:tools="http://schemas.android.com/tools"
android:name="android.permission.INTERNET"
tools:ignore="WrongManifestParent" />


<application
android:allowBackup="true"
android:fullBackupContent="@xml/backup_descriptor"
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
android:roundIcon="@mipmap/ic_launcher_round"
android:supportsRtl="true"
android:theme="@style/Theme.Flixster">

<intent-filter>
        <action android:name="android.intent.action.MAIN" />

    <category android:name="android.intent.category.LAUNCHER" />
    </intent-filter>
 </application>

【问题讨论】:

  • 错字。从此行中删除 /package="com.codepath.rkpandey.flixster" /&gt;。确保你在文件的最后也有一个结束 &lt;/manifest&gt; 标记。

标签: android android-manifest


【解决方案1】:

使用以下语法获取 Internet 权限:

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

您在导致问题的权限标签中添加了此“xmlns:tools="http://schemas.android.com/tools"。

【讨论】:

    【解决方案2】:

    您正在关闭顶部的清单标记。你应该在底部关闭它。

    <?xml version="1.0" encoding="utf-8"?>
    <manifest xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools"
    package="com.codepath.rkpandey.flixster" >
    
    <uses-permission
    xmlns:tools="http://schemas.android.com/tools"
    android:name="android.permission.INTERNET"
    tools:ignore="WrongManifestParent" />
    
    
    <application
    android:allowBackup="true"
    android:fullBackupContent="@xml/backup_descriptor"
    android:icon="@mipmap/ic_launcher"
    android:label="@string/app_name"
    android:roundIcon="@mipmap/ic_launcher_round"
    android:supportsRtl="true"
    android:theme="@style/Theme.Flixster">
    
    <intent-filter>
            <action android:name="android.intent.action.MAIN" />
    
        <category android:name="android.intent.category.LAUNCHER" />
        </intent-filter>
     </application>
    </manifest>
    

    (注意最后一行以及第一个清单标记的末尾现在如何没有 /)

    【讨论】:

      猜你喜欢
      • 2013-07-08
      • 2017-04-17
      • 2014-04-30
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多