i upload my bundle to google play and show me this permissions which contain
android.permission.REQUEST_INSTALL_PACKAGES
and this is my AndroidManifest file content:
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.flutter.application">
<!-- The INTERNET permission is required for development. Specifically,
flutter needs it to communicate with the running application
to allow setting breakpoints, to provide hot reload, etc.
-->
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.CAMERA" />
<uses-permission android:name="android.permission.INTERNET"/>
<!-- 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="flutter"
android:icon="#mipmap/ic_launcher">
<activity
android:name=".MainActivity"
android:launchMode="singleTop"
android:theme="#style/LaunchTheme"
android:configChanges="orientation|keyboardHidden|keyboard|screenSize|locale|layoutDirection|fontScale|screenLayout|density|uiMode"
android:hardwareAccelerated="true"
android:windowSoftInputMode="adjustResize">
<!-- This keeps the window background of the activity showing
until Flutter renders its first frame. It can be removed if
there is no splash screen (such as the default splash screen
defined in #style/LaunchTheme). -->
<meta-data
android:name="io.flutter.app.android.SplashScreenUntilFirstFrame"
android:value="true" />
<intent-filter>
<action android:name="android.intent.action.MAIN"/>
<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>
<activity
android:name="com.yalantis.ucrop.UCropActivity"
android:screenOrientation="portrait"
android:theme="#style/Theme.AppCompat.Light.NoActionBar"/>
</application>
what is this permission and how i can handle it or remove it from my package
and when i install my app on phone this permission not show?
ok i found why android.permission.REQUEST_INSTALL_PACKAGES permission added to package
this is because file_open package has this permission
and it added to project automatically
As like the answers above it could have been requested by many packages. It can be made to be removed from the final manifest.xml by add these in the Androidmanifest.xml
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools" //Add this line
package="com.example.app">
<uses-permission android:name="android.permission.REQUEST_INSTALL_PACKAGES" tools:node="remove"/> //Add this line
The tools:node='remove' will remove the permission from final manifest.xml
This technique can be used to remove other permissions also.
You could check the build/app/outputs/logs/manifest-merger-release-report.txt file. This is generated after you make a release build.
This file contains all information on how the final AndroidManifest.xml is created and where permissions might come from.
In my case, it came from open_file package.
I came across the same issue. In my case, it was because of the pakage open_file after going through many online threads about the same topic.
I used the open_file_safe package to resolve the issue.
open_file_safe is same as open_file, but .apk file type is not
supported. Thus, android.permission.REQUEST_INSTALL_PACKAGES
permission is removed.
Related
I was writing a Flutter Plugin that implements a ZygotePreload so under the plugin sources, I already declared this class
#TargetApi(Build.VERSION_CODES.Q)
public class AppZygote implements android.app.ZygotePreload {
#Override
public void doPreload(#NonNull ApplicationInfo appInfo) {
System.loadLibrary("myjnilibrary");
}
}
and on the plugin's AndroidManifest.xml under the android directory
<manifest
package="..."
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools" >
<application
android:allowBackup="false"
android:zygotePreloadName="my.plugin.package_id.AppZygote"
tools:ignore="AllowBackup"
tools:targetApi="q">
</application>
</manifest>
I had successfully integrated it on a normal Flutter project.
And then when I tried to integrate into an existing Flutter project that already uses it's own ZygotePreload implementation on it's Manifest where it looks like this
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
package="...">
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" android:maxSdkVersion="28" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" android:maxSdkVersion="28" />
<uses-permission android:name="android.permission.MANAGE_EXTERNAL_STORAGE" />
<uses-permission-sdk-23 android:name="android.permission.USE_FINGERPRINT"/>
<!-- 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. -->
<!-- Notice the existing android:zygotePreloadName -->
<application
android:label="..."
android:icon="#mipmap/ic_launcher"
android:allowBackup="false"
android:fullBackupContent="false"
android:requestLegacyExternalStorage="true"
android:supportsRtl="true"
android:zygotePreloadName=".AppZygotePreload"
tools:targetApi="q"
<activity
android:name=".MainActivity"
android:launchMode="singleTask"
android:theme="#style/LaunchTheme"
android:configChanges="orientation|keyboardHidden|keyboard|screenSize|locale|layoutDirection|fontScale|screenLayout|density|uiMode"
android:hardwareAccelerated="true"
android:exported="true"
android:windowSoftInputMode="adjustResize">
<!-- This keeps the window background of the activity showing
until Flutter renders its first frame. It can be removed if
there is no splash screen (such as the default splash screen
defined in #style/LaunchTheme). -->
<meta-data
android:name="io.flutter.app.android.SplashScreenUntilFirstFrame"
android:value="true" />
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<meta-data
android:name="flutterEmbedding"
android:value="2" />
<!-- This is the service I'm going to import from my plugin -->
<service
android:name="my.plugin.package_id.RemoteService"
android:isolatedProcess="true"
android:useAppZygote="true" />
<!-- This is the service declared on the app's project itself -->
<service
android:name=".IsolatedService"
android:exported="false"
android:isolatedProcess="true"
android:useAppZygote="true" />
</application>
</manifest>
Building the project caused this Gradle error.
> Manifest merger failed : Attribute application#zygotePreloadName value=(.AppZygotePreload) from AndroidManifest.xml:24:9-54
is also present at [:my_plugin] AndroidManifest.xml:13:9-73 value=(my.plugin.package.AppZygote).
Suggestion: add 'tools:replace="android:zygotePreloadName"' to <application> element at AndroidManifest.xml:17:5-76:19 to override.
It seems like if I do use tools:replace statement, that means I'll ignore the existing ZygotePreload provided by my plugin instead. Is that how it works?
So the question is, is it possible to use more than one android:zygotePreloadName on a single Android App Project, specifically the ones that use Flutter and it's plugins?
Or do I have to make a way around by implementing the codes on the plugin into the app's existing code base and mix it in somehow, or vice versa, by moving the app's implementation into my plugin instead?
Additional Info:
I was using Flutter v2.10.3 stable and NDK version of 25.0.8775105, targeting Android SDK level 32.
Hey I am working with Flutter, My AndroidManifest.xml looks like this. Not able to get merged manifest in android studio. Can you help me in finding out where am I missing exported=" true", Playstore is not allowing me to update the app?
I tried to update all the dependencies in pubspec.yaml but nothing helped. Checking each library for the manifest file is time-consuming. How can I detect which library manifest file needs to be changed?
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
package="org.grow90.whatsub">
<uses-permission android:name="android.permission.READ_SMS"/>
<uses-permission android:name="android.permission.RECEIVE_SMS"/>
<uses-permission android:name="android.permission.INTERNET"/>
<uses-permission android:name="android.permission.QUERY_ALL_PACKAGES" />
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
<uses-permission
android:name="android.permission.PACKAGE_USAGE_STATS"
tools:ignore="ProtectedPermissions" />
<application
android:label="SubSpace"
android:icon="#mipmap/ic_launcher">
<meta-data android:name="com.google.android.geo.API_KEY"
android:value=""/>
<activity
android:name=".MainActivity"
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"
/>
<!-- 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="com.google.firebase.messaging.default_notification_icon"
android:resource="#drawable/ic_stat_onesignal_default" />
<!-- -->
<!-- <meta-data-->
<!-- android:name="com.onesignal.messaging.default_notification_icon"-->
<!-- android:resource="#mipmap/ic_stat_onesignal_default" />-->
<!-- <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>
<uses-permission android:name="android.permission.READ_CONTACTS"></uses-permission>
<uses-permission android:name="android.settings.APPLICATION_DETAILS_SETTINGS"></uses-permission>
</manifest>
If you are targeting android 12 or 12+ you must specify "android:exported" property to specify whether or not components of other applications can invoke the service or interact with it — "true" if they can, and "false" if not. When the value is "false"
Default value for this attribute is set to false.
So, if you have any activity, alias, service or broadcast receiver with intent-filter registered in your android manifest file then you must specify the "android:exported" attribute to continue.
I updated exported="true" for <activity tag
But issue not resolved.
In my case I was using firebase_messaging & flutter_local_notifications package. I tried to upgrade it but still facing issue.
Temporarily I commented both package, clean/build app and uploaded to Play Store. It got accepted without any issue.
Planned notification and messaging in next version.
Look for packages what makes issue then act accordingly instead of random search.
Thanks!
Dee
In my app I just realized that on Android Sembast db is not deleted when I uninstall the app, on iOS it does get deleted.
Looking at other answers here I saw that in order to prevent Android backup there is the flag android:allowBackup="false" to be set in AndroidManifest.xml. So I did for the Manifest in android/main/app. Nothing changed. Upon app uninstall and reinstall db is still there.
As my phone uses Android 7.0 API 24 I guess this flag will have affect on next installs, but I'll have to remove db manually. this time.
Did I add this flag correctly?
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.vinny.fixit_cloud_biking">
<!-- 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.ACCESS_FINE_LOCATION" />
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
<uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED"/>
<uses-permission android:name="android.permission.VIBRATE" />
<uses-permission android:name="android.permission.WAKE_LOCK" />
<application
android:name="io.flutter.app.FlutterApplication"
android:label="fixit"
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:allowBackup="false">
<intent-filter>
<action android:name="android.intent.action.MAIN"/>
<category android:name="android.intent.category.LAUNCHER"/>
</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"/>
</intent-filter>
</receiver>
<!-- 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 tried to look for the db folder in the phone directory Android/data/com.vinny.fixit_cloud_biking/files but there is only a Pictures folder. Where do I get to delete the old db? this is the path declared in the singleton final dbPath = join(appDocumentDir.path, 'device.db');
Try to add android:allowBackup="false" at the <application> level not the <activity> level
<application
android:name="io.flutter.app.FlutterApplication"
android:allowBackup="false"
try this
add this on the manifest tag
xmlns:tools="http://schemas.android.com/tools"<br>
tools:replace="allowBackup"<br>
android:allowBackup="false"<br>
<?xml version='1.0' encoding='utf-8'?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
tools:replace="allowBackup"
android:allowBackup="false"/>
Also can add
android:allowBackup="false" (on application tag)
I am trying to upload apk on playstore from few days. but now days its showing list of core functionality in deceleration form like SMS and call log.
but in our apk there is no use of such permissions. I am using Internet and Fine Location permission, but its not listed there. there is compulsion that we require to select atleast one permission.therefore I am selecting Default SMS handler.
even I search through many tools there is no SMS and call log permission is used in whole source code.
As I found many answer on google that Make sure your SMS permission is given in manifest and give the pop up in user level.
but there is no permission in my manifest.
<?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.demmyname.com">
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
<!--<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />-->
<uses-permission android:name="android.permission.INTERNET" />
<application
android:name="com.demmyname.com.Classes.Application"
android:allowBackup="true"
tools:replace="android:allowBackup"
android:icon="#mipmap/icon"
android:label="#string/app_name"
android:roundIcon="#mipmap/icon"
android:supportsRtl="true"
android:theme="#style/AppTheme"
android:usesCleartextTraffic="true"
tools:ignore="GoogleAppIndexingWarning">
<activity android:name=".Activities.SplashActivity">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity
android:name=".MainActivity"
android:label="#string/title_activity_main"
android:theme="#style/AppTheme.NoActionBar"
android:windowSoftInputMode="adjustPan" />
<activity android:name=".Activities.Activity_Login" />
<activity android:name=".Activities.Activity_SignUp" />
<activity android:name=".Activities.Activity_Forgot_Pwd" />
<activity android:name=".Activities.Activity_Profile" />
<activity android:name=".Activities.Activity_Change_Password" />
<service
android:name=".Services.AppLocationService"
android:enabled="true" />
<activity android:name=".Activities.Activity_Chnage_Location" />
<activity android:name=".Activities.Activity_Order_Delivary" />
<activity android:name=".Activities.Activity_Order_PichUp" />
<activity android:name=".Activities.Activityz_Hotel_Categories" />
<activity android:name=".Activities.Activity_Category_Items" />
<activity android:name=".Activities.Activity_Cart_List" />
<activity android:name=".Activities.Activity_Place_Order" />
<activity android:name=".Activities.Activity_MyOrders" />
<activity android:name=".Activities.Activity_About_Us" />
<activity android:name=".Activities.Activity_View_Offer"></activity>
<!--
<meta-data
android:name="io.fabric.ApiKey"
android:value="7aa3cad21d26b0edcfccea540b57016907999433"
/>
-->
<!-- <meta-data android:name="firebase_crash_collection_enabled" android:value="false" /> -->
<activity android:name=".Activities.Activity_PayUMoney"></activity>
<uses-library
android:name="org.apache.http.legacy"
android:required="false" />
</application>
</manifest>
I am looking for solution how to skip declaration form or without selecting core functionality.
To make sure if any other libraries are using the violated permissions, do the following...
In your Android Studio, open the manifest file and observe that in the below of the page 2 (two) Tabs are there =>
Text
Merged Manifest
Click on the Merged Manifest tab. Then search for the
uses-permission
Check that if it contains any call log or sms permissions (or other violated permissions).
If you find any use of the violated permissions like that, add the following line in your manifest under the
manifest tag
<uses-permission android:name="android.permission.READ_SMS" tools:node="remove" />
And for each and every violated permission add another line like the above with the appropriate permission tag.
Then rebuild the project and check that your merged manifest does not contain any violated permissions. After the confirmation generate signed APK and update your application in the Google Play console. (For now, check the do not meet the Google privacy policies in the declaration form).
After a successful update and around after 24 hours, recheck that the form (in Play console) exist or not. There should not be any form after a successful APK update.
You may want to update your APK again after the form disappears for a clear update.
I am running an app in Android Studio and it gives 2 app icons in Androi Studio.
Also, I have moved from Eclipse to Android Studio and now I'm having trouble with how to make the color of logcat same as in Eclipse.
My question is that there are 2 app icons when I run the app, and when I uninstall it, 2 of them have been removed. Is that normal in Android Studio?
I have found that Android Studio can copy keys from Eclipse.
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.mytrack.ph"
android:versionCode="1"
android:versionName="1.0" >
<uses-sdk
android:minSdkVersion="14"
android:targetSdkVersion="19" />
<uses-feature
android:glEsVersion="0x00020000"
android:required="true"/>
<uses-permission android:name="android.permission.READ_PHONE_STATE" />
<uses-permission android:name="android.permission.INTERNET"/>
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/>
<uses-permission android:name="android.permission.VIBRATE"/>
<uses-permission android:name="android.permission.WAKE_LOCK"/>
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>
<!-- Google Map v.2 permissions -->
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION"/>
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION"/>
<!-- GCM permissions -->
<uses-permission android:name="android.permission.GET_ACCOUNTS" />
<uses-permission android:name="com.google.android.c2dm.permission.RECEIVE" />
<permission android:name="com.example.gcm.permission.C2D_MESSAGE"
android:protectionLevel="signature" />
<uses-permission android:name="com.example.gcm.permission.C2D_MESSAGE" />
<!-- Writing Persmission -->
<uses-permission android:name="android.permission.WRITE_USER_DICTIONARY" />
<uses-permission android:name="android.permission.WRITE_PROFILE" />
<uses-permission android:name="android.permission.READ_CONTACTS"/>
<uses-permission android:name="android.permission.READ_PROFILE"/>
<uses-permission android:name="android.permission.READ_CONTACT"/>
<application
android:allowBackup="true"
android:icon="#drawable/ic_launcher"
android:label="#string/app_name" >
<activity android:name="com.mytrack.ph.SplashActivity"
android:label="#string/app_name"
android:noHistory="true"
android:screenOrientation="portrait"
android:theme="#style/splashScreenTheme" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity
android:name="com.mytrack.ph.LoginActivity"
android:label="#string/app_name"
android:screenOrientation="portrait"
>
</activity>
<meta-data
android:name="com.google.android.gms.version"
android:value="#integer/google_play_services_version" />
<meta-data
android:name="com.google.android.maps.v2.API_KEY"
android:value="#string/google_map_api_key"/>
<activity android:name="com.facebook.LoginActivity"
android:theme="#android:style/Theme.Translucent.NoTitleBar"
android:label="#string/app_name" />
<meta-data android:name="com.facebook.sdk.ApplicationId" android:value="#string/app_id"/>
<service android:name="com.my.track.service.MyTrackService"></service>
<receiver
android:name="com.my.track.service.MyTrackGcmBroadcastReceiver"
android:permission="com.google.android.c2dm.permission.SEND" >
<intent-filter>
<action android:name="com.google.android.c2dm.intent.RECEIVE" />
<category android:name="com.my.track.service" />
</intent-filter>
</receiver>
<service android:name="com.my.track.service.MyTrackGcmIntentService" />
<activity android:name="NavigationMenuActivity"
android:configChanges="orientation|keyboardHidden"
android:screenOrientation="portrait"
android:launchMode="singleTop"
android:permission="com.google.android.c2dm.permission.SEND" >
></activity>
<receiver android:name="com.my.track.results.ConnectionChangeReceiver" >
<intent-filter>
<action android:name="android.net.conn.CONNECTIVITY_CHANGE"/>
</intent-filter>
</receiver>
</application>
</manifest>
I though this is normal in android studio. Running an app gives 2 launcher icons.
PS:
my AndroidManifest.xml is inside main folder and I used eclipse to export to gradle build.
Im using Android Studio 0.8.6
thanks.
I got it! yes at last , i have to study gradles and stuff.
Actually I have 2 android projects inside the Project, one is a library and the other one is the main app.
I found out that when i imported those projects Android Studio (I exported the lib to gradle build from eclipse) doesn't care if that is a lib project or a main project. (Correct me if im wrong ).
so the only thing to make it work is to remove the intent-filter of that lib-android-project.
EDIT:
#all
solved it ! thanks to everyone, I never knew there was another AndroidManifest.xml , i thought eclipse removed it. and i thought Exporting it to gradle will remove it because it is checked as a library.
thanks for all your help.
The <intent-filter> that affects creating multiple launcher icon is the following one:
<intent-filter>
<action android:name="android.intent.action.MAIN"/>
<category android:name="android.intent.category.LAUNCHER"/>
</intent-filter>
Android Studio's manifest merger will always combine <intent-filter>s in library projects into main project's manifest. You may end up having multiple LAUNCHER intents in your synthesized manifest, thus having multiple launcher icons. To avoid this, simply remove the LAUNCHER intents from the library projects' manifest.
You declare two intent filter, used only one Intent filter in the activity, on AndroidManifest.
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
If you used two or more intent filter in AndroidManifest, then you will have two app icon, So remove it & set one intent filter.
I hove this is usedful to you.
i agree, since i made 2 activity(one for splash, one for main). In manifest i forgot to delete
<intent-filter>
<action android:name="android.intent.action.MAIN"/>
<category android:name="android.intent.category.LAUNCHER"/>
</intent-filter>
so in the end when i install app, i will have 2 app.
There is most likely an imported Library project that has this intent filter.
1. Open your app manifest
2. At the bottom left click on "Merged Manifest"
3. Search and find which library project has the attribute
<intent-filter>
<action android:name="android.intent.action.MAIN"/>
<category android:name="android.intent.category.LAUNCHER"/>
</intent-filter>
4. Remove it and ensure that now the filter is only on your App's <Application >class activity.
In my case, it was just because, in the manifest file, two activities were declared as launcher. Actually, I clicked on the launcher checkbox while making new activity, thinking it will transfer the launcher tag from the previous activity to this, but it created both activities as launchers.
When running android and doing debug, there is an another AndroidManifest.xml under src/debug. Make sure this manifest file matches the main one under src/main.
<category android:name="android.intent.category.LAUNCHER"/>
</intent-filter>
</activity>
<activity android:name=".MainActivity">
<!You need to delete launcher intent filter from every other activity ->
</activity>
The "android.intent.category.LAUNCHER" intent filter decides which activity will launch when you tap on the application icon. If there are more than 1 entries, OS will create more than one app icon after installation. You need to make sure that there is a single entry of above intent filter in the Manifest file.