how to manually update add android:exported in the flutter package - flutter

the application cannot be uploaded to the playstore with the reason that it must define android:exported, even though I have defined it in the flutterProject/android/app/src/main/AndroidManifest.xml, but the error remains the same, I suspect because the package I am using is old school,
I want to update it manually but the manifest is just like below
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.onesignal.flutter">
</manifest>
how to solve it?

Simply do like this:
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="">
<uses-permission android:name="android.permission.INTERNET"/>
<uses-permission android:name="com.google.android.gms.permission.AD_ID"/>
<application
android:label="App"
android:name="${applicationName}"
android:icon="#mipmap/launcher_icon">
<meta-data android:name="com.facebook.sdk.ApplicationId" android:value="#string/facebook_app_id"/>
<meta-data android:name="com.facebook.sdk.ClientToken" android:value="#string/facebook_client_token"/>
<activity
android:name=".MainActivity"
android:exported="true" //here ------
you need to add this in Activity Tag
(Must Add Launcher Activity : android:exported="true")

Related

Dart/flutter: firebase issue when I hot reload

I am running into a weird error on the terminal, but the app works fine...
If I completely sign-out of the app, then login, everything works fine.
Once I login and I do a hot reload, that's when I run into the following issue::
D/EGL_emulation(12080): app_time_stats: avg=357.28ms min=13.08ms max=12953.00ms count=39
W/DynamiteModule(12080): Local module descriptor class for com.google.android.gms.providerinstaller.dynamite not found.
I/DynamiteModule(12080): Considering local module com.google.android.gms.providerinstaller.dynamite:0 and remote module com.google.android.gms.providerinstaller.dynamite:0
W/ProviderInstaller(12080): Failed to load providerinstaller module: No acceptable module com.google.android.gms.providerinstaller.dynamite found. Local version is 0 and remote version is 0.
D/TrafficStats(12080): tagSocket(120) with statsTag=0xffffffff, statsUid=-1
I added the following line to 'AndroidManifest.xml':
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
here is the whole 'AndroidManifest.xml' file::
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="na.mynotes">
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<application
android:label="mynotes"
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>
Any ideas what I am doing wrong?
I should I delete the line i added?
`````

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.

error after updating minsdkversion in flutter 2.8

I am a beginner in flutter. I have update minSdkVersion from 19 to 21 and getting the following error. Please Please help. any kind of help is much appreciated. Thank you in advance.
Manifest merger failed : Attribute application#label value=(Car_Wash_App) from AndroidManifest.xml:11:9-37
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:9:5-48:19 to override.
here is the manifest file
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.Car_Wash_App">
<!-- 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="Car_Wash_App"
android:icon="#mipmap/ic_launcher"
tools:replace="android:label">
<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">
<!-- 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>
Buddy you just need to migrate your project to androidX
open android directory of your project in android studio
wait for gradle to finish its task
then go to tools -> migrate to androidX
click migrate
click do refactor
or you can simply follow steps from following answer https://stackoverflow.com/a/54857699/16793736
You have to change your android manifest file like below
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example">
<application
android:allowBackup="true"
android:label="#string/app_name"
android:supportsRtl="true">
</application>
</manifest>
To
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.name"
xmlns:tools="http://schemas.android.com/tools">
<application
android:allowBackup="true"
android:label="App Name"
android:supportsRtl="true"
tools:replace="android:label">
</application>
</manifest>
And now the android:label is replaced by the label from the parent 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">

Overwrite manifest (themes)

I have a project that has 3 themes (support,crm,sales), when I compile a version, I have to change the tiapp.xml:
id (com.website.[support/crm/sales])
name (Website [Support/CRM/Sales])
android manifest
My question is: there are any way to replace or merge the android manifest or some parts of tiapp.xml file:
uses-permission android:name="com.website[support/crm/sales].permission.MAPS_RECEIVE"
permission android:name="com.website.[support/crm/sales].permission.MAPS_RECEIVE"
activity android:name=".Website[Support/CRM/Sales]Activity"
This is my manifest:
<android xmlns:android="http://schemas.android.com/apk/res/android">
<tool-api-level>14</tool-api-level>
<manifest>
<uses-sdk android:maxSdkVersion="23"
android:minSdkVersion="14" android:targetSdkVersion="23"/>
<uses-permission android:name="android.permission.INTERNET"/>
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION"/>
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION"/>
<uses-permission android:name="com.android.launcher.permission.INSTALL_SHORTCUT"/>
<uses-permission android:name="com.google.android.providers.gsf.permission.READ_GSERVICES"/>
<uses-feature android:glEsVersion="0x00020000" android:required="true"/>
<uses-permission android:name="com.website.[support/crm/sales].permission.MAPS_RECEIVE"/>
<permission
android:name="com.website.[support/crm/sales].permission.MAPS_RECEIVE" android:protectionLevel="signature"/>
<application android:debuggable="true"
android:largeHeap="true" android:theme="#style/Theme.MyTheme">
<meta-data
android:name="com.google.android.maps.v2.API_KEY" android:value="AIzaSyDcN-CWFqg4-Ai4Es10E0sSDmJ7seo4XAg"/>
<activity
android:configChanges="keyboardHidden|orientation|screenSize"
android:label="#string/app_name"
android:name=".Website[Support/CRM/Sales]Activity" android:screenOrientation="landscape"/>
</application>
<supports-screens android:anyDensity="true"/>
</manifest>
</android>
The main/default icons, I've to replace them manually, while this feature isn't added: https://jira.appcelerator.org/browse/ALOY-1318
Unfortunately tiapp.xml is amongst the few things you cannot theme through Alloy yet:
https://jira.appcelerator.org/browse/ALOY-1118
This because a chicken-egg problem. tiapp.xml is the main config file of your app which is loaded before anything else.
I'd suggest using grunt or gulp to modify the file before you hand it over to Titanium to build.