I'm going to use flutter_downloader to download the file. For that, AndroidManifest.xml added the following code as instructed.
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com......">
<!-- flutter_downloader -->
<provider
android:name="vn.hunghd.flutterdownloader.DownloadedFileProvider"
android:authorities="${applicationId}.flutter_downloader.provider"
android:exported="false"
android:grantUriPermissions="true">
<meta-data
android:name="android.support.FILE_PROVIDER_PATHS"
android:resource="@xml/provider_paths"/>
</provider>
</application>
.
.
.
.
</application>
</manifest>
https://pub.dev/packages/flutter_downloader This official site tells you to insert the following code into AndroidManifest.xml for Android use: provider ... /provider However, after doing this, the following error is printed when building.
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':app:processDebugResources'.
> A failure occurred while executing com.android.build.gradle.internal.tasks.Workers$ActionFacade
> Android resource linking failed
/Users/home_1/Desktop/Projects/code/app/matching_project_rev2/build/app/intermediates/packaged_manifests/debug/AndroidManifest.xml:16: AAPT: error: unexpected element <provider> found in <manifest>.
Is there a wrong location to add the code?
<provider>s have to go in between the<application>tags.