AAPT:错误:<uses-feature>在调试清单中找到未知元素



我开始使用AAPT2,因为出于某种原因,我的应用程序一直在相机上崩溃,我可能发现了这个告诉我的错误:

androidappbuildintermediatesmanifestsfulldebugAndroidManifest.xml:43: AAPT: error: unknown element <uses-feature> found.
androidappbuildintermediatesmanifestsfulldebugAndroidManifest.xml:47: AAPT: error: unknown element <uses-permission> found.
androidappbuildintermediatesmanifestsfulldebugAndroidManifest.xml:48: AAPT: error: unknown element <uses-permission> found.

这是调试清单:

<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.myapp"
android:versionCode="1"
android:versionName="1.0" >
<uses-sdk
android:minSdkVersion="16"
android:targetSdkVersion="26" />
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.SYSTEM_ALERT_WINDOW" />
<uses-permission android:name="android.permission.CAMERA" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
<meta-data
android:name="android.support.VERSION"
android:value="25.3.1" />
<uses-permission android:name="android.permission.READ_PHONE_STATE" />
<application
android:name="com.myapp.MainApplication"
android:allowBackup="true"
android:debuggable="true"
android:icon="@mipmap/ic_launcher"
android:label="myapp"
android:theme="@style/AppTheme" >
<activity
android:name="com.myapp.MainActivity"
android:configChanges="keyboard|keyboardHidden|orientation|screenSize"
android:label="myapp"
android:windowSoftInputMode="adjustResize" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity android:name="com.facebook.react.devsupport.DevSettingsActivity" />
**<!-- Problem Occurs Here -->**
<uses-feature
android:name="android.hardware.camera"
android:required="true" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
<activity
android:name="cn.finalteam.rxgalleryfinal.ui.activity.MediaActivity"
android:exported="true"
android:screenOrientation="portrait"
android:theme="@style/Theme_Light.Default" />
<activity
android:name="com.yalantis.ucrop.UCropActivity"
android:screenOrientation="portrait"
android:theme="@style/Theme_Light.Default" />
<provider
android:name="com.imagepicker.FileProvider"
android:authorities="com.myapp.provider"
android:exported="false"
android:grantUriPermissions="true" >
<meta-data
android:name="android.support.FILE_PROVIDER_PATHS"
android:resource="@xml/provider_paths" />
</provider>
<meta-data
android:name="com.dylanvann.fastimage.OkHttpProgressGlideModule"
android:value="GlideModule" />
</application>
</manifest>

我研究了其他类似的问题,发现你必须删除所说的行或将其放在其他地方。但我不熟悉XML的位置,这可能会导致更多的问题。有人能帮我吗?非常感谢。

Src清单:

<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.myapp"
xmlns:tools="http://schemas.android.com/tools">
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.SYSTEM_ALERT_WINDOW"/>
<uses-permission android:name="android.permission.CAMERA" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
<application
android:name=".MainApplication"
android:label="myapp"
android:icon="@mipmap/ic_launcher"
android:allowBackup="true"
tools:replace="label"
android:theme="@style/AppTheme">
<activity
android:name=".MainActivity"
android:label="myapp"
android:configChanges="keyboard|keyboardHidden|orientation|screenSize"
android:windowSoftInputMode="adjustResize">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity android:name="com.facebook.react.devsupport.DevSettingsActivity" />
</application>

<uses-feature android:name="android.hardware.camera" android:required="true" />移出<application>标签,如下所示:

<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.myapp"
android:versionCode="1"
android:versionName="1.0" >
...
<uses-permission android:name="android.permission.READ_PHONE_STATE" />
<uses-feature
android:name="android.hardware.camera"
android:required="true" />
<application
android:name="com.myapp.MainApplication"
android:allowBackup="true"
android:debuggable="true"
android:icon="@mipmap/ic_launcher"
android:label="myapp"
android:theme="@style/AppTheme" >
...
</application>
</manifest>

相关内容

  • 没有找到相关文章

最新更新