Android-runtime: AAPT: error: unknown element <provider> found

Created on 26 Jun 2018  路  5Comments  路  Source: NativeScript/android-runtime

Did you verify this is a real problem by searching the NativeScript Forum and the other open issues in this repo?

Searched for it but didnt find anything.

Tell us about the problem

Im getting this error when building the app

\platforms\android\app\build\intermediates\manifests\full\debug\AndroidManifest.xml:24: AAPT: error: unknown element <provider> found.

Which is what im using in the AndroidManifest to be able to open files like pdfs

Please provide the following version numbers that your issue occurs with:

Did the error happen while the app was being constructed? (buildtime error) Yes

tnsrunandroidlogtrace.txt

Did the error happen while the app was executing? (runtime error)

Please tell us how to recreate the issue in as much detail as possible.

AndroidManifest.xml

<?xml version="1.0" encoding="utf-8"?>
<manifest
    xmlns:android="http://schemas.android.com/apk/res/android" package="__PACKAGE__" android:versionCode="10000" android:versionName="1.0">
    <supports-screens android:smallScreens="true" android:normalScreens="true" android:largeScreens="true" android:xlargeScreens="true" />
    <uses-sdk android:minSdkVersion="17" android:targetSdkVersion="__APILEVEL__" />
    <uses-permission android:name="android.permission.CALL_PHONE" />
    <uses-permission android:name="android.permission.CAMERA" />
    <uses-permission android:name="android.permission.INTERNET" />
    <uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
    <uses-permission android:name="android.permission.RECORD_AUDIO" />
    <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
    <application android:name="com.tns.NativeScriptApplication" android:allowBackup="true" android:icon="@drawable/icon" android:label="@string/app_name" android:theme="@style/AppTheme">
        <activity android:name="com.tns.NativeScriptActivity" android:label="@string/title_activity_kimera" android:configChanges="keyboardHidden|orientation|screenSize" android:theme="@style/LaunchScreenTheme">
            <meta-data android:name="SET_THEME_ON_LAUNCH" android:resource="@style/AppTheme" />
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />
                <category android:name="android.intent.category.LAUNCHER" />
            </intent-filter>
        </activity>
        <activity android:name="com.tns.ErrorReportActivity" />
    </application>
    <provider
        android:name="android.support.v4.content.FileProvider"
        android:authorities="org.nativescript.MedicationManagement.provider"
        android:exported="false"
        android:grantUriPermissions="true">
        <meta-data
            android:name="android.support.FILE_PROVIDER_PATHS"
            android:resource="@xml/provider_paths"/>
    </provider>
</manifest>

Most helpful comment

@joey0xx, according to the documentation the <provider> tag should be nested inside the <application> element:

image

All 5 comments

@joey0xx, according to the documentation the <provider> tag should be nested inside the <application> element:

image

You are right, thank you.

hello, can someone help me to sort out what's wrong.

After I have installed video-plus-plugin i'm getting the issue "unexpected element
found in "
I tried placing the provider in application tag manually but it's not working ,
I even tried removing android and add it again.........but nothing worked

I'm also facing the same problem
How to solve it.
I have just did :---
npm install cordova-plugin-video-capture-plus
npm install @ionic-native/video-capture-plus
ionic cap sync

Then tried building the application it is giving
android\capacitor-cordova-android-plugins\build\intermediates\library_manifest\debug\AndroidManifest.xml:16:5-24:16: AAPT: error: unexpected element found in .

If I edit file to keep tag inside tag, It is rebuilding and giving same error with outside tag.
Is there any way to fix it???????????

hello, can someone help me to sort out what's wrong.

After I have installed video-plus-plugin i'm getting the issue "unexpected element
found in "
I tried placing the provider in application tag manually but it's not working ,
I even tried removing android and add it again.........but nothing worked

You are right, thank you.

how u fixed it tell us

Was this page helpful?
0 / 5 - 0 ratings