简体   繁体   English

如何修复Android Manifest文件中的错误“Unsupported type'use-permission'”

[英]How to fix the error “Unsupported type 'uses-permission'” in the Android Manifest file

I'm following an Android MySQL tutorial ( https://www.simplifiedcoding.net/android-mysql-tutorial-to-perform-basic-crud-operation/#Creating-Helper-Classes ) and the aim is to build an Android app connected to a MySQL database on an Apache server (XAMPP package). 我正在关注Android MySQL教程( https://www.simplifiedcoding.net/android-mysql-tutorial-to-perform-b​​asic-crud-operation/#Creating-Helper-Classes ),目的是构建一个Android应用程序连接到Apache服务器(XAMPP包)上的MySQL数据库。 I use Android Studio (3.0.1) in order to develop the Android part. 我使用Android Studio(3.0.1)来开发Android部分。

I get an issue when I try to run the code, in my Android Manifest file (which allows the app to access the internet). 当我尝试在我的Android Manifest文件(允许应用程序访问互联网)中运行代码时出现问题。 The error is "Unsupported type 'uses-permission'" as said in the title. 错误是“不支持的类型'使用 - 权限'”,如标题中所述。 I've tried to look for common mistakes such as misspellings or if the permission I was asking for in my code indeed existed, but I couldn't find anything useful to fix it. 我试图寻找像拼写错误这样的常见错误,或者如果我在代码中要求的权限确实存在,但我找不到任何有用的解决方法。 And I didn't ask on the website of the tutorial because it looks pretty unlikely that I would get an answer (the last comment on the tutorial was on October 28th 2015), I've also looked at the comments and nobody seems to have got a similar issue. 我没有在教程的网站上询问,因为我看起来不太可能得到答案(教程的最后评论是在2015年10月28日),我也看了评论,没有人似乎有得到了类似的问题。

Here is the code : 这是代码:

<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    package="ch.jemili.yasmina.myheroapp">

    <!-- this is the internet permission -->
    <uses-permission android:name="android.permission.INTERNET" />

    <application
        android:allowBackup="true"
        android:icon="@mipmap/ic_launcher"
        android:label="@string/app_name"
        android:roundIcon="@mipmap/ic_launcher_round"
        android:supportsRtl="true"
        android:theme="@style/AppTheme">
        <activity android:name=".MainActivity">
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />

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

</manifest>

For some reason, you have a manifest file in app/src/main/res/values/AndroidManifest.xml in your project. 出于某种原因,您的项目中的app/src/main/res/values/AndroidManifest.xml中有一个清单文件。 That is not where the manifest goes. 这不是清单所在的地方。 The manifest goes in app/src/main/AndroidManifest.xml . 清单位于app/src/main/AndroidManifest.xml

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

相关问题 如何在 Android Studio 中解决(错误:不支持的类型“使用权限”)? - How to resolve (Error: Unsupported type 'uses-permission') in Android Studio? Android 23不生成用户权限元素的清单文件 - Android 23 Not Generating Manifest file for uses-permission elements 的角色 <uses-permission> 清单文件中标记? - Role of <uses-permission> tag in manifest file? 包含 <uses-permission android:name=“android.permission.INTERNET” /> 在清单中导致错误 - including <uses-permission android:name=“android.permission.INTERNET” /> in manifest causes error <uses-permission> 与 <permission> 在Android 6.0中的Manifest.xml - <uses-permission> vs <permission> in Android 6.0 Manifest.xml 在manifest.xml文件中使用权限与android权限的权限 - uses-permission vs permission for android permissions in the manifest.xml file 使用许可 android - uses-permission android 解析Android Manifest File以使用python查找uses-permission标记 - Parsing Android Manifest File to look for the uses-permission tag using python 错误:(15)标签 <uses-permission> 属性名称包含无效字符&#39;&#39;.Android清单 - Error:(15) Tag <uses-permission> attribute name has invalid character ' '.Android Manifest Android Studio 忽略清单使用权限条目 - Android Studio ignoring Manifest uses-permission entries
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM