flutter audio_service not working, errors in AndroidManifest.xml - flutter

I am attempting to recreate the audio_service tutorial on GitHub and it is not working, no sound is playing when you click the play button. I have observed an error in the AndroidManifest.xml which seems to be related - the documentation of course requires you add lines to the AndriodManifest.xml file.
However I am getting errors on the lines and which I suspect could be causing the problem. The errors are "Class referenced in the manifest, _______ , was not found in the project or the libraries / Unresolved package '___' " for both.
I did include these dependencies in my pubspec.yaml:
audio_service: ^0.15.1
just_audio: ^0.5.2
Note that I am having the same problem on both my Windows 10 development environment and on my MacBookPro running Catalina. Does anyone know how I can resolve this? What am I missing?
Here is my complete AndroidManifest.xml file:
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="tv.realhelp.new_audio_service_test">
<uses-permission android:name="android.permission.WAKE_LOCK"/>
<uses-permission android:name="android.permission.FOREGROUND_SERVICE"/>
<!-- io.flutter.app.FlutterApplication is an android.app.Application that
calls FlutterMain.startInitialization(this); in its onCreate method.
In most cases you can leave this as-is, but you if you want to provide
additional functionality it is fine to subclass or reimplement
FlutterApplication and put your custom class here. -->
<application
android:name="io.flutter.app.FlutterApplication"
android:label="new_audio_service_test"
android:icon="#mipmap/ic_launcher"
android:usesCleartextTraffic="true">
<activity
android:name=".MainActivity"
android:launchMode="singleTop"
android:theme="#style/LaunchTheme"
android:configChanges="orientation|keyboardHidden|keyboard|screenSize|smallestScreenSize|locale|layoutDirection|fontScale|screenLayout|density|uiMode"
android:hardwareAccelerated="true"
android:windowSoftInputMode="adjustResize">
<intent-filter>
<action android:name="android.intent.action.MAIN"/>
<category android:name="android.intent.category.LAUNCHER"/>
</intent-filter>
</activity>
<!-- Don't delete the meta-data below.
This is used by the Flutter tool to generate GeneratedPluginRegistrant.java -->
<meta-data
android:name="flutterEmbedding"
android:value="2" />
<service android:name="com.ryanheise.audioservice.AudioService">
<intent-filter>
<action android:name="android.media.browse.MediaBrowserService" />
</intent-filter>
</service>
<receiver android:name="com.ryanheise.audioservice.MediaButtonReceiver" >
<intent-filter>
<action android:name="android.intent.action.MEDIA_BUTTON" />
</intent-filter>
</receiver>
</application>
</manifest>

Related

Flutter AndroidManifest.xml "Manifest merger failed" error

I am trying to add dependencies for Paypal inside my Android Manifest file but i got this weird error:
Error
Execution failed for task ':app:processDebugMainManifest'.
> Manifest merger failed : Attribute application#label value=(welpie) from AndroidManifest.xml:6:9-31
is also present at [org.jfrog.cardinalcommerce.gradle:cardinalmobilesdk:2.2.4-1] AndroidManifest.xml:15:9-41 value=(#string/app_name).
Suggestion: add 'tools:replace="android:label"' to <application> element at AndroidManifest.xml:5:5-52:19 to override.
Here is my android manifest file
AndroidManifest.xml
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.welpie">
<uses-permission android:name="android.permission.INTERNET"/>
<uses-permission android:name="android.permission.CAMERA" />
<application
android:label="welpie"
android:icon="#mipmap/ic_launcher">
<activity
android:name=".MainActivity"
android:launchMode="singleTop"
android:exported="true"
android:theme="#style/LaunchTheme"
android:configChanges="orientation|keyboardHidden|keyboard|screenSize|smallestScreenSize|locale|layoutDirection|fontScale|screenLayout|density|uiMode"
android:hardwareAccelerated="true"
android:windowSoftInputMode="adjustResize">
<!-- Specifies an Android theme to apply to this Activity as soon as
the Android process has started. This theme is visible to the user
while the Flutter UI initializes. After that, this theme continues
to determine the Window background behind the Flutter UI. -->
<meta-data
android:name="io.flutter.embedding.android.NormalTheme"
android:resource="#style/NormalTheme"
/>
<!-- Displays an Android View that continues showing the launch screen
Drawable until Flutter paints its first frame, then this splash
screen fades out. A splash screen is useful to avoid any visual
gap between the end of Android's launch screen and the painting of
Flutter's first frame. -->
<meta-data
android:name="io.flutter.embedding.android.SplashScreenDrawable"
android:resource="#drawable/launch_background"
/>
<intent-filter>
<action android:name="android.intent.action.MAIN"/>
<category android:name="android.intent.category.LAUNCHER"/>
</intent-filter>
</activity>
<activity android:name="com.braintreepayments.api.BraintreeBrowserSwitchActivity"
android:launchMode="singleTask">
<intent-filter>
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE" />
<data android:scheme="${applicationId}.braintree" />
</intent-filter>
</activity>
<!-- Don't delete the meta-data below.
This is used by the Flutter tool to generate GeneratedPluginRegistrant.java -->
<meta-data
android:name="flutterEmbedding"
android:value="2" />
</application>
</manifest>
I checked the codes in file but I don't understand why there is an error.
How can I solve it?
It seems one of your dependency (cardinalmobilesdk) includes android app name designation. It may be not what you want.
Just follow the instruction like the following (though I can't try)
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
package="com.example.welpie">
...
<application
tools:replace="android:label"
android:label="welpie"
android:icon="#mipmap/ic_launcher">

Uploaded an APK which has an activity, activity alias, service or broadcast receiver with intentfilter, but without 'android : exported' property set

I'm having an issue when I'm uploading an app bundle to the play console that:
You uploaded an APK or Android App Bundle which has an activity, activity alias, service or broadcast receiver with intent filter, but without 'android:exported' property set. This file can't be installed on Android 12 or higher.
But my manifest file includes the property.
Manifest file
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="**********">
<!-- io.flutter.app.FlutterApplication is an android.app.Application that
calls FlutterMain.startInitialization(this); in its onCreate method.
In most cases you can leave this as-is, but you if you want to provide
additional functionality it is fine to subclass or reimplement
FlutterApplication and put your custom class here. -->
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.CAMERA" />
<uses-feature android:name="android.hardware.camera" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
<uses-permission android:name="android.permission.ACCESS_BACKGROUND_LOCATION" />
<uses-permission android:name="android.permission.WAKE_LOCK"/>
<uses-permission android:name="android.permission.FOREGROUND_SERVICE"/>
<uses-permission android:name="android.permission.VIBRATE" />
<uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED"/>
<uses-permission android:name="android.permission.WAKE_LOCK" />
<uses-permission android:name="android.permission.ACTIVITY_RECOGNITION" />
<uses-permission android:name="com.google.android.gms.permission.ACTIVITY_RECOGNITION" />
<application
android:name="io.flutter.app.FlutterApplication"
android:label="*****"
android:requestLegacyExternalStorage="true"
android:usesCleartextTraffic="true"
android:icon="#mipmap/ic_launcher">
<meta-data
android:name="com.google.firebase.messaging.default_notification_icon"
android:resource="#drawable/ic_stat_artboard_1" />
<meta-data android:name="com.google.android.geo.API_KEY"
android:value="Z*********"/>
<provider
android:name="vn.hunghd.flutterdownloader.DownloadedFileProvider"
android:authorities="im.mingguang.mingguang_app.flutter_downloader.provider"
android:grantUriPermissions="true"
android:requestLegacyExternalStorage="true">
<meta-data
android:name="android.support.FILE_PROVIDER_PATHS"
android:resource="#xml/provider_paths"/>
</provider>
<provider
android:name="androidx.core.content.FileProvider"
android:authorities="${applicationId}.provider"
android:grantUriPermissions="true">
<meta-data
android:name="android.support.FILE_PROVIDER_PATHS"
android:resource="#xml/provider_paths"/>
</provider>
<activity
android:name=".MainActivity"
android:launchMode="singleTop"
android:theme="#style/LaunchTheme"
android:configChanges="orientation|keyboardHidden|keyboard|screenSize|smallestScreenSize|locale|layoutDirection|fontScale|screenLayout|density|uiMode"
android:hardwareAccelerated="true"
android:exported="true"
android:windowSoftInputMode="adjustResize">
<intent-filter>
<action android:name="android.intent.action.MAIN"/>
<category android:name="android.intent.category.DEFAULT"/>
<category android:name="android.intent.category.LAUNCHER"/>
</intent-filter>
<intent-filter>
<action android:name="FLUTTER_NOTIFICATION_CLICK" />
<category android:name="android.intent.category.DEFAULT"/>
</intent-filter>
</activity>
<!-- Don't delete the meta-data below.
This is used by the Flutter tool to generate GeneratedPluginRegistrant.java -->
<meta-data
android:name="flutterEmbedding"
android:value="2" />
</application>
</manifest>
Play Console Error
I solved it by writing
android:exported="true"
in activity below the android:name=".MainActivity".
On about the 11th of January 2022, the Play Store introduced a lint check when uploading APKs to verify exported attributes are set correctly in the manifest.
Tools like DexGuard that obfuscate attribute names will cause the Play Store linter to fail, since it will be unable to check for exported attributes.
To fix this, configure obfuscation tools to keep attribute names in the manifest.
Here is the rule we used for DexGuard:
-keepresourcexmlattributenames manifest/**
I added android:exported="true" to my main activity, but that didn't fix the issue for me.
However, I suspected this is a change that some packages have only recently implemented. I checked my pub outdated, and had a few older versions of key packages (in my case I was a major version behind on Firebase storage). Once I had updated to the latest possible versions in file pubspec.yaml the compiled file was accepted on upload to the Google Play.
In your manifest file, check all the activities, services, and receivers that uses intent-filter without the android:exported tag.
In your main manifest file, you can simply add the android:exported property to the activity tag, so add android:exported="" and set a Boolean value inside these quotation marks.
You might ask: When do I need to add android:exported="true" or android:exported="false" to the activities, services, or broadcast receivers that use intent filters? If the app component includes the LAUNCHER category, set android:exported to true. In most other cases, set android:exported to false.
Note: also check individual third-party library manifest files if there is any activity, service or receiver using them. You have to override the same activity, service or receiver in your main manifest file with the android:exported property.
For more explanation, you can refer to my answer on same problem.
If your app targets Android 12 or higher and contains activities, services, or broadcast receivers that use intent filters, you must explicitly declare the android:exported attribute for these app components.
If the app component includes the LAUNCHER category, set android:exported to true. In most other cases, set android:exported to false.
The following code snippet shows an example of a service that contains an intent filter whose android:exported attribute is set to false:
<service android:name="com.example.app.backgroundService"
android:exported="false">
<intent-filter>
<action android:name="com.example.app.START_BACKGROUND" />
</intent-filter>
</service>
<receiver android:name="com.example.app.serives.SilentPushReceiver"
android:exported="false">
<intent-filter>
<!-- Receive silent push notifications. -->
<action
android:name="uz.usoft.kidya.action.ymp.SILENT_PUSH_RECEIVE"/>
</intent-filter>
</receiver>
<activity android:name="com.example.app.SplashScreenActivity"
android:exported="true">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity
android:name="com.example.app.MainActivity"
android:exported="false"/>
About information: Safer component exporting
its_broke_again's answer works perfectly for me. I'm describing the steps to make things a little easier.
Enter the following commands in the terminal
flutter pub upgrade --major-versions
flutter clean
flutter build appbundle
Add android:exported="true" in file AndroidManifest.xml
<activity
android:name=".MainActivity"
android:exported="true"
<!-- ... -->
</activity>
I downgraded to targetSdkVersion 30 and compileSdkVersion 30 in file build.gradle.
It should work fine.
In my case geocoding was the package which caused the problem
So it wouldn't build with the 30 SdkVersion, so I had to deleted the exception which refers to Android S "API 31".
For Flutter:
If you changed AndroidManifest and you still face the same error, the problem is caused by a package. To identify the package, search for '<intent-filter' in the "build" folder, and then find if '<intent-filter' has a parent without android:exported="true/false".
Then you should upgrade the package.
If you are using the latest version, then you need to contact the package developer, or clone it and use your GitHub version.
For me, adding android:exported="true" to MainActivity was not enough.
But I also had to remove the Huawei agcp and hms for push notification to let it work.
It seems that it uses an activity, activity alias, service or broadcast without android:exported.
An Android manifest file highlights the error. Generally, wherever we have used intent filter, it requires us to set the attribute android:exported="true".
The default activity should be set as "true". The rest can be set either to "true" or "false", depending on whether we want other apps to fire our activity/service.
If your app targets Android 12 or higher and contains activities, services, or broadcast receivers that use intent filters, you must explicitly declare the android:exported attribute for these app components.
Warning: If an activity, service, or broadcast receiver uses intent filters and doesn't have an explicitly-declared value for android:exported, your app can't be installed on a device that runs Android 12 or higher.
If the app component includes the LAUNCHER category, set android:exported to true. In most other cases, set android:exported to false.
The following code snippet shows an example of a service that contains an intent filter whose android:exported attribute is set to false:
<service android:name="com.example.app.backgroundService"
android:exported="false">
<intent-filter>
<action android:name="com.example.app.START_BACKGROUND" />
</intent-filter>
</service>
I had the same error and for two days I was trying to fix it.
Firstly, android:exported="true" did not work for me, because I added to only one activity.
I updated the Unity version (it did not work at that time, and maybe had an effect)
I added android:exported="true" in every activity field, and then voilĂ , it worked.
My Unity game now looks like:
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" package="com.unity3d.player" android:installLocation="preferExternal" tools:ignore="MissingLeanbackSupport">
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.ACCESS_WIFI_STATE" />
<uses-permission android:name="com.google.android.finsky.permission.BIND_GET_INSTALL_REFERRER_SERVICE" />
<uses-feature android:glEsVersion="0x00020000" />
<application android:name="androidx.multidex.MultiDexApplication" android:fullBackupContent="false" android:allowBackup="false" android:theme="#android:style/Theme.NoTitleBar" tools:ignore="GoogleAppIndexingWarning,MissingTvBanner" tools:replace="fullBackupContent,allowBackup">
<!-- UNITY -->
<activity android:name="com.unity3d.player.UnityPlayerActivity" android:label="#string/app_name" android:screenOrientation="fullSensor" android:launchMode="singleTask" android:configChanges="mcc|mnc|locale|touchscreen|keyboard|keyboardHidden|navigation|orientation|screenLayout|uiMode|screenSize|smallestScreenSize|fontScale|layoutDirection|density" android:resizeableActivity="false" android:hardwareAccelerated="false" android:exported="true">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
<category android:name="android.intent.category.LEANBACK_LAUNCHER" />
</intent-filter>
<meta-data android:name="unityplayer.UnityActivity" android:value="true" />
<meta-data android:name="unityplayer.ForwardNativeEventsToDalvik" android:value="false" />
<meta-data android:name="com.google.android.gms.version" android:value="#integer/google_play_services_version" />
<meta-data android:name="android.notch_support" android:value="true" />
</activity>
<!-- FULLSCREEN FIX -->
<meta-data android:name="android.max_aspect" android:value="2.16" />
<!-- 3rdParty MANIFEST -->
<activity android:name="com.facebook.unity.FBUnityLoginActivity" android:exported="true" android:configChanges="fontScale|keyboard|keyboardHidden|locale|mnc|mcc|navigation|orientation|screenLayout|screenSize|smallestScreenSize|uiMode|touchscreen" android:theme="#android:style/Theme.Translucent.NoTitleBar.Fullscreen" />
<activity android:name="com.facebook.unity.FBUnityDialogsActivity" android:exported="true" android:configChanges="fontScale|keyboard|keyboardHidden|locale|mnc|mcc|navigation|orientation|screenLayout|screenSize|smallestScreenSize|uiMode|touchscreen" android:theme="#android:style/Theme.Translucent.NoTitleBar.Fullscreen" />
<activity android:name="com.facebook.unity.FBUnityGamingServicesFriendFinderActivity" android:exported="true" android:configChanges="fontScale|keyboard|keyboardHidden|locale|mnc|mcc|navigation|orientation|screenLayout|screenSize|smallestScreenSize|uiMode|touchscreen" android:theme="#android:style/Theme.Translucent.NoTitleBar.Fullscreen" />
<activity android:name="com.facebook.unity.FBUnityAppLinkActivity" android:exported="true" />
<activity android:name="com.facebook.unity.FBUnityDeepLinkingActivity" android:exported="true" />
<activity android:name="com.facebook.unity.FBUnityGameRequestActivity" android:exported="true"/>
<activity android:name="com.facebook.unity.FBUnityCreateGameGroupActivity" android:exported="true"/>
<activity android:name="com.facebook.unity.FBUnityJoinGameGroupActivity" android:exported="true"/>
<meta-data android:name="com.facebook.sdk.ApplicationId" android:value="fb901505887229125" />
<meta-data android:name="com.facebook.sdk.AutoLogAppEventsEnabled" android:value="true" />
<meta-data android:name="com.facebook.sdk.AdvertiserIDCollectionEnabled" android:value="true" />
<provider android:name="com.facebook.FacebookContentProvider" android:authorities="com.facebook.app.FacebookContentProvider901505887229125" android:exported="true" />
<meta-data android:name="unity.splash-mode" android:value="0" />
<meta-data android:name="unity.splash-enable" android:value="True" />
<meta-data android:name="unity.allow-resizable-window" android:value="False" />
<meta-data android:name="notch.config" android:value="portrait|landscape" />
<meta-data android:name="unity.build-id" android:value="31d4e179-c52c-49d7-a4f5-da548e453521" />
<receiver android:name="com.unity.androidnotifications.UnityNotificationManager" android:exported="true" />
<receiver android:name="com.unity.androidnotifications.UnityNotificationRestartOnBootReceiver" android:exported="true" android:enabled="false">
<intent-filter>
<action android:name="android.intent.action.BOOT_COMPLETED" />
</intent-filter>
</receiver>
</application>
<uses-feature android:name="android.hardware.vulkan.version" android:required="false" />
<uses-feature android:name="android.hardware.touchscreen" android:required="false" />
<uses-feature android:name="android.hardware.touchscreen.multitouch" android:required="false" />
<uses-feature android:name="android.hardware.touchscreen.multitouch.distinct" android:required="false" />
</manifest>
You can see android:exported="true" added in every activity and receiver.
Reading the document Safer component exporting, it looks like if your app targets Android 12 or higher and contains activities, services, or broadcast receivers that use intent filters, you must explicitly declare the android:exported property for these app components.
If your app is small, you might just need to add the android:exported property in the AndroidManifest.xml for every node using intent-filter.
But if you're using many external dependencies, modifying only the main manifest file might not be enough.
You might need to do it for every third-party library that you have in your project that contains an intent-filter node without the android:exported property.
You can find the list of all the activity, activity alias, service or broadcast into the merged manifest.
If you cannot find it using Android Studio:
Downgrade targetSdkVersion: 30 and compileSdkVersion: 30 in the build.gradle to be able to build.
Build the project on an android device
Then you can check the merged manifest into /project_name/build/app/intermediates/merged_manifests/debug/out/AndroidManifest.xml.
Now you can check every individual third-party library where the android:exported is missing. And declare them explicitly in the main manifest file.
Then you can change back to targetSdkVersion: 31 and compileSdkVersion: 31 and check if it is working.
In my Flutter app, I just had to change 1 line in <activity> in file android/app/src/main/AndroidMainfest.xml.
<activity
android:name=".MainActivity"
android:launchMode="singleTop"
android:theme="#style/LaunchTheme"
android:configChanges="orientation|keyboardHidden|keyboard|screenSize|smallestScreenSize|locale|layoutDirection|fontScale|screenLayout|density|uiMode"
android:hardwareAccelerated="true"
android:windowSoftInputMode="adjustResize"
android:exported="true"> <!-- I added this line -->
<meta-data
android:name="io.flutter.embedding.android.NormalTheme"
android:resource="#style/NormalTheme"/>
<meta-data
android:name="io.flutter.embedding.android.SplashScreenDrawable"
android:resource="#drawable/launch_background"
/>
<intent-filter>
<action android:name="android.intent.action.MAIN"/>
<category android:name="android.intent.category.LAUNCHER"/>
</intent-filter>
</activity>
Also, I am using compileSdkversion 31 and targetSdkVersion 31.
After unit testing, we found the problem was from the package epub_viewer: ^0.2.5. The AndroidManifest.xml file of this package was empty:
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.jideguru.epub_viewer">
</manifest>
And also doesn't have any activity or service, but this solution works for me, by adding these lines of code to my AndroidManifest.xml file:
<activity
android:name="com.folioreader.ui.activity.SearchActivity"
android:exported="true"
tools:node="merge" />
Google Play accepted my AppBundle.
You need to change all the used libraries in file pubspec.yaml to an updated version whether they are using the 'exported' thingy in the manifest file.

flutter local notification manifest plugins

i am using flutter local notification, but in the repository example does not implemented any code for scheduling or notification at all.
should i put them or not?
the manifest XML file is:
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.dexterous.flutter_local_notifications_example">
<application
android:label="flutter_local_notifications_example"
android:icon="#mipmap/ic_launcher">
<activity
android:name=".MainActivity"
android:launchMode="singleTop"
android:theme="#style/LaunchTheme"
android:configChanges="orientation|keyboardHidden|keyboard|screenSize|smallestScreenSize|locale|layoutDirection|fontScale|screenLayout|density|uiMode"
android:hardwareAccelerated="true"
android:windowSoftInputMode="adjustResize"
android:showWhenLocked="true"
android:turnScreenOn="true">
<!-- Specifies an Android theme to apply to this Activity as soon as
the Android process has started. This theme is visible to the user
while the Flutter UI initializes. After that, this theme continues
to determine the Window background behind the Flutter UI. -->
<meta-data
android:name="io.flutter.embedding.android.NormalTheme"
android:resource="#style/NormalTheme"
/>
<!-- Displays an Android View that continues showing the launch screen
Drawable until Flutter paints its first frame, then this splash
screen fades out. A splash screen is useful to avoid any visual
gap between the end of Android's launch screen and the painting of
Flutter's first frame. -->
<meta-data
android:name="io.flutter.embedding.android.SplashScreenDrawable"
android:resource="#drawable/launch_background"
/>
<intent-filter>
<action android:name="android.intent.action.MAIN"/>
<category android:name="android.intent.category.LAUNCHER"/>
</intent-filter>
</activity>
<!-- Don't delete the meta-data below.
This is used by the Flutter tool to generate GeneratedPluginRegistrant.java -->
<meta-data
android:name="flutterEmbedding"
android:value="2" />
</application>
</manifest>
Yes, you need to. And also you need to put the following in AndroidManifest.xml in order to have a proper notification behaviour setup. They are all self-explanatory. If you have any other confusion leave a comment.
<application ...>
<activity ...>
...
<intent-filter>
<action android:name="FLUTTER_NOTIFICATION_CLICK" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
</activity>
<receiver android:name="com.dexterous.flutterlocalnotifications.ScheduledNotificationReceiver" />
<receiver android:name="com.dexterous.flutterlocalnotifications.ScheduledNotificationBootReceiver">
<intent-filter>
<action android:name="android.intent.action.BOOT_COMPLETED"/>
<action android:name="android.intent.action.MY_PACKAGE_REPLACED"/>
<action android:name="android.intent.action.QUICKBOOT_POWERON" />
<action android:name="com.htc.intent.action.QUICKBOOT_POWERON"/>
</intent-filter>
</receiver>
...
</application>

Error parsing LocalFile: 'E:\android\app\src\main\AndroidManifest.xml' Please ensure that the android manifest is a valid XML document and try again

my application worsks perfectly fine. but when i add some uses-permission for internet and map and api key for google map it gives me error. i tried flutter clean, flutter run but still getting the same error. I dont understand what i am doing wrong in manifest file. please someone help me.
Here is my manifest file code:
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.food_order">
<uses-permission android:name="android.permission.INTERNET"/>
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION"/>
<application
android:label="food_order"
android:icon="#mipmap/ic_launcher"
<activity
android:name=".MainActivity"
android:launchMode="singleTop"
android:theme="#style/LaunchTheme"
android:configChanges="orientation|keyboardHidden|keyboard|screenSize|smallestScreenSize|locale|layoutDirection|fontScale|screenLayout|density|uiMode"
android:hardwareAccelerated="true"
android:windowSoftInputMode="adjustResize">
<meta-data
android:name="io.flutter.embedding.android.NormalTheme"
android:resource="#style/NormalTheme"
/>
<meta-data
android:name="io.flutter.embedding.android.SplashScreenDrawable"
android:resource="#drawable/launch_background"
/>
<intent-filter>
<action android:name="android.intent.action.MAIN"/>
<category android:name="android.intent.category.LAUNCHER"/>
</intent-filter>
</activity>
<meta-data android:name="com.google.android.geo.API_KEY"
android:value="AIzaSyCn************ratM"/>
<meta-data
android:name="flutterEmbedding"
android:value="2" />
</application>
</manifest>
You are missing > after the android:icon="#mipmap/ic_launcher", so it should be like this:
<application
android:label="food_order"
android:icon="#mipmap/ic_launcher">
<activity...
Your IDE should have given you hints about this, like so
If you aren't using an IDE I strongly suggest you start using one :).
This sometimes is usually because you commented some part of code snippet in the AndroidManifest.xml out; not knowing some other parts of the entire code is also commented out.
So I recommend you checking well to know what's actually wrong before deciding to move on with other alternative ways of fixing such.
remove all spaces between <manifest> node and <application>
Like this :
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.companyname.myappname">
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.CAMERA" />
<uses-permission android:name="android.permission.READ_PHONE_STATE"/>
<uses-permission android:name="android.permission.USE_BIOMETRIC"/>
<application
android:label="My App"
android:name="${applicationName}"
android:icon="#mipmap/launcher_icon">

API not working/http error SocketException: Failed host lookup in Release Build(working in debug mode) For Flutter

Getting Some Of Notes Regarding path_provider-1.5.1 and API not working which I integrated through http/dio in Release Build(working in debug mode) For Flutter.
Note:
/home/webelightpc/Documents/flutter/.pub-cache/hosted/pub.dartlang.org/path_provider-1.5.1/android/src/main/java/io/flutter/plugins/pathprovider/PathProviderPlugin.java
uses or overrides a deprecated API. Note: Recompile with
-Xlint:deprecation for details. Note: Some input files use or override a deprecated API. Note:
Recompile with -Xlint:deprecation for details.
According to https://github.com/flutter/flutter/issues/27883
It's strange that without adding permission in AndroidManifest.xml it'll work in debug but in release modeany API request will not work, solutions is as simple as below...
just add permission like this
<uses-permission android:name="android.permission.INTERNET" />
in your app's android/app/src/main/AndroidManifest.xml
For those people who are new in flutter,here is the full demo. you have to add permission above "Application" tag
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.reprecinct.app.reprecinct">
<uses-permission android:name="android.permission.INTERNET" />
<application
android:label="your app label"
android:name="${applicationName}"
android:icon="#mipmap/ic_launcher">
<activity
android:name=".MainActivity"
android:exported="true"
android:launchMode="singleTop"
android:theme="#style/LaunchTheme"
android:configChanges="orientation|keyboardHidden|keyboard|screenSize|smallestScreenSize|locale|layoutDirection|fontScale|screenLayout|density|uiMode"
android:hardwareAccelerated="true"
android:windowSoftInputMode="adjustResize">
<!-- Specifies an Android theme to apply to this Activity as soon as
the Android process has started. This theme is visible to the user
while the Flutter UI initializes. After that, this theme continues
to determine the Window background behind the Flutter UI. -->
<meta-data
android:name="io.flutter.embedding.android.NormalTheme"
android:resource="#style/NormalTheme"
/>
<intent-filter>
<action android:name="android.intent.action.MAIN"/>
<category android:name="android.intent.category.LAUNCHER"/>
</intent-filter>
</activity>
<!-- Don't delete the meta-data below.
This is used by the Flutter tool to generate GeneratedPluginRegistrant.java -->
<meta-data
android:name="flutterEmbedding"
android:value="2" />
</application>
</manifest>