[英]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-basic-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.