Android Manifest: no default activity? - android

From an open source project I got this manifest file
<?xml version="1.0" encoding="utf-8"?>
<uses-sdk
android:minSdkVersion="14"
android:targetSdkVersion="20" />
<uses-permission android:name="android.permission.AUTHENTICATE_ACCOUNTS" />
<uses-permission android:name="android.permission.READ_CALENDAR" />
<uses-permission android:name="android.permission.WRITE_CALENDAR" />
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.GET_ACCOUNTS" />
<uses-permission android:name="android.permission.WRITE_SYNC_SETTINGS" />
<application
android:allowBackup="true"
android:icon="#drawable/icon"
android:label="#string/app_name"
android:theme="#style/AppTheme">
<service
android:name="org.gege.caldavsyncadapter.syncadapter.SyncService"
android:exported="true">
<intent-filter>
<action android:name="android.content.SyncAdapter" />
</intent-filter>
<meta-data
android:name="android.content.SyncAdapter"
android:resource="#xml/syncadapter" />
</service>
<service
android:name="org.gege.caldavsyncadapter.authenticator.AuthenticationService"
android:exported="true">
<intent-filter>
<action android:name="android.accounts.AccountAuthenticator" />
</intent-filter>
<meta-data
android:name="android.accounts.AccountAuthenticator"
android:resource="#xml/authenticator" />
</service>
<activity
android:name="org.gege.caldavsyncadapter.authenticator.AuthenticatorActivity"
android:label="#string/title_activity_authenticator"
android:windowSoftInputMode="adjustResize|stateVisible"/>
</application>
I am a bit puzzled about that manifest. It has two services and one activity. The activity is not marked as default activity. When I run the project on my phone it doesn't show any icon to start the app neither does the app start automatically.
Does a manifest like this make sense? What does the Android OS based on such a manifest?

Does a manifest like this make sense?
Yes, since it declares a sync adapter an an authenticator.
Generally, such manifests would also make sense in a library project. The app project that uses the library then provides the main launcher activity. The build process merges manifest files together so you get one manifest per APK.
What does the Android OS based on such a manifest?
As such, it has the entry points such as an activity and two services declared. Generally you invoke these entry points via an Intent. The services are declared as a sync adapter and an authenticator, so they can be invoked by the framework. The activity is probably invoked by the authenticator service for UI purposes.
Because there's no main launcher activity, no menu icon is visible.

Related

App database is not deleted on app uninstall Flutter

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)

Android Wear: Watch face companion configuration activity issue when changing package name

I'm developing an Android Wear watch face along with its mobile companion configuration activity.
As a start I followed the documentation (https://developer.android.com/training/wearables/watch-faces/configuration.html#CompanionActivity) and used the available examples from Google (https://developer.android.com/samples/WatchFace/index.html), specifically the FitDistanceService.
If I use the actual code from the example it all works. The small gear icon - used to open the companion (phone) configuration activity - shows up in the Android Wear app on the phone and I can open the companion phone config activity by tapping on it.
But if I rename the package name from the default "com.example.android.wearable.watchface" to anything else (even to com.example.android.wearable.mycompany) the gear icon disappears from the Android Wear app on the phone and it becomes impossible to open the configuration activity.
I tried changing the package name in any possible way. I've tried using the Move, Copy, Rename functionalities in Android Studio (v. 2.2.3). I've tried to manually change the package name and all its occurrencies in all of the project files using Sublime Text, also renaming the related folders and changing any occurrence of the package name in the manifest.xml of wear and mobile apps.
After the renaming (moving, copying etc.) it all works perfectly. Not a warning, nothing. The watch face behaves as expected, but the gear icon simply disappears.
This is the MOBILE manifest.xml:
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.android.wearable.watchface" >
<uses-sdk android:minSdkVersion="18"
android:targetSdkVersion="23" />
<!-- Permissions required by the wearable app -->
<uses-permission android:name="android.permission.WAKE_LOCK" />
<!-- Location permission used by FitDistanceWatchFaceService -->
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
<!-- All intent-filters for config actions must include the categories
com.google.android.wearable.watchface.category.COMPANION_CONFIGURATION and
android.intent.category.DEFAULT. -->
<application
android:allowBackup="true"
android:icon="#drawable/ic_launcher"
android:label="#string/app_name"
android:theme="#style/AppTheme" >
<!-- This activity is needed to allow the user to authorize Google Fit for the Fit Distance
WatchFace (required to view distance). -->
<activity
android:name=".ConfigActivity"
android:label="#string/app_name">
<intent-filter>
<action android:name="com.example.android.wearable.watchface.CONFIG_FIT_DISTANCE" />
<category android:name="com.google.android.wearable.watchface.category.COMPANION_CONFIGURATION" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
</activity>
<meta-data
android:name="com.google.android.gms.version"
android:value="#integer/google_play_services_version" />
</application>
</manifest>
And this is the WEARABLE one:
<?xml version="1.0" encoding="utf-8"?>
<manifest package="com.example.android.wearable.watchface"
xmlns:android="http://schemas.android.com/apk/res/android">
<uses-sdk
android:minSdkVersion="21"
android:targetSdkVersion="23"/>
<uses-feature android:name="android.hardware.type.watch"/>
<!-- Required to act as a custom watch face. -->
<uses-permission android:name="android.permission.WAKE_LOCK"/>
<!-- Required for complications to receive complication data and open the provider chooser. -->
<uses-permission android:name="com.google.android.wearable.permission.RECEIVE_COMPLICATION_DATA"/>
<!-- Location permission used by FitDistanceWatchFaceService -->
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION"/>
<uses-permission android:name="android.permission.BODY_SENSORS"/>
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>
<uses-permission android:name="android.permission.READ_PHONE_STATE"/>
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE"/>
<application
android:allowBackup="true"
android:icon="#drawable/ic_launcher"
android:label="#string/app_name">
<meta-data
android:name="com.google.android.gms.version"
android:value="#integer/google_play_services_version"/>
<uses-library
android:name="com.google.android.wearable"
android:required="false"/>
<activity android:name="android.support.wearable.complications.ComplicationHelperActivity"/>
<!--
All intent-filters for config actions must include the categories
com.google.android.wearable.watchface.category.WEARABLE_CONFIGURATION
and android.intent.category.DEFAULT.
-->
<service
android:name=".FitDistanceWatchFaceService"
android:label="#string/fit_distance_name"
android:permission="android.permission.BIND_WALLPAPER">
<meta-data
android:name="android.service.wallpaper"
android:resource="#xml/watch_face"/>
<meta-data
android:name="com.google.android.wearable.watchface.preview"
android:resource="#drawable/preview_distance"/>
<meta-data
android:name="com.google.android.wearable.watchface.preview_circular"
android:resource="#drawable/preview_distance_circular"/>
<meta-data
android:name="com.google.android.wearable.watchface.companionConfigurationAction"
android:value="com.example.android.wearable.watchface.CONFIG_FIT_DISTANCE"/>
<intent-filter>
<action android:name="android.service.wallpaper.WallpaperService"/>
<category android:name="com.google.android.wearable.watchface.category.WATCH_FACE"/>
</intent-filter>
</service>
<activity
android:name=".FitDistanceWatchFacePermissionActivity"
android:label="#string/title_activity_fitdistance_watch_face_permission">
</activity>
<activity
android:name=".BodysensorsWatchFacePermissionActivity"
android:label="#string/title_activity_bodysensors_watch_face_permission">
</activity>
</application>
</manifest>
They both work perfectly, if you don't try to rename the package from "com.example.android.wearable.watchface" to something else.
Any clues? Of course I could go on with the "com.example.android.wearable.watchface" package name, but it seems implausible that it's not possible to change the package name.
Thank you!

Parse Unity SDK does not work in an Android build

I use Parse Unity SDK as a solution for cloud storing of all the relevant gameplay statistics. The SDK works perfectly well in the Unity editor. However, when the project is built for Android and deployed on a device, not a single piece of functionality seems to be working - a user can't sign up, log in or place any kind of data into the Parse cloud.
I have tested this from within a simple project, to avoid possible 3rd party plugin conflicts, but the result was the same.
The AndroidManifest.xml file looks like this:
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.toybox.parsetest"
android:versionCode="1"
android:versionName="1.0">
<uses-sdk android:minSdkVersion="10" />
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.WAKE_LOCK" />
<uses-permission android:name="android.permission.VIBRATE" />
<uses-permission android:name="android.permission.GET_ACCOUNTS" />
<uses-permission android:name="com.google.android.c2dm.permission.RECEIVE" />
<permission android:protectionLevel="signature" android:name="com.toybox.parsetest.permission.C2D_MESSAGE" />
<uses-permission android:name="com.toybox.parsetest.permission.C2D_MESSAGE" />
<application android:label="ParseTest" android:icon="#drawable/app_icon">
<activity android:name=".UnityPlayerActivity">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<receiver android:name="com.parse.ParsePushBroadcastReceiver" android:permission="com.google.android.c2dm.permission.SEND">
<intent-filter>
<action android:name="com.google.android.c2dm.intent.RECEIVE" />
<action android:name="com.google.android.c2dm.intent.REGISTRATION" />
<category android:name="com.toybox.parsetest" />
</intent-filter>
</receiver>
<service android:name="com.parse.ParsePushService" />
</application>
</manifest>
You might want to follow this official bug thread for the issue...
https://developers.facebook.com/bugs/1623483557935932/
EDIT : At the bottom of the thread the developer has posted a package, which seems to have some other files and a manifest in the Plugins/Android folder. It seems you need to make sure you keep these files, and it will work.
You can download the package from
https://www.dropbox.com/s/oc0orevllrf1ylm/Fixed-Parse-Unity-Android-Bug-1.5.2.zip?dl=0

ServiceNotDeclaredException: The BeaconService is not properly declared in AndroidManifest.xml

I get the following error when i run a Unit Test in my Android project (I don't get the error while building the app and running it on a device):
The BeaconService is not properly declared in AndroidManifest.xml. If using Eclipse, please verify that your project.properties has manifestmerger.enabled=true
org.altbeacon.beacon.BeaconManager$ServiceNotDeclaredException: The BeaconService is not properly declared in AndroidManifest.xml. If using Eclipse, please verify that your project.properties has manifestmerger.enabled=true
Android Studio automatically merges the AndroidManifest.xml from the Android Beacon Library into my own AndroidManifest.xml, which makes it unnecessary to declare the Beacon Services in my AndroidManifest.xml.
This is my current AndroidManifest.xml (located in my /src/main/ folder, I don't have one in my /src/test/ folder):
<manifest xmlns:android="http://schemas.android.com/apk/res/android" package="com.xxx.xxx">
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.BLUETOOTH" />
<uses-permission android:name="android.permission.BLUETOOTH_ADMIN" />
<permission
android:name="com.xxx.xxx.permission.C2D_MESSAGE"
android:protectionLevel="signature" />
<uses-permission android:name="com.google.android.c2dm.permission.RECEIVE" />
<uses-permission android:name="com.xxx.xxx.permission.C2D_MESSAGE" />
<application
android:name=".xxxApplication"
android:allowBackup="true"
android:icon="#mipmap/ic_launcher"
android:label="#string/app_name"
android:theme="#style/AppTheme">
<activity
android:name=".MainActivity"
android:label="#string/app_name"
android:screenOrientation="portrait">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity
android:name=".LoginActivity"
android:label="#string/title_activity_login" />
<receiver
android:name="org.jboss.aerogear.android.unifiedpush.gcm.AeroGearGCMMessageReceiver"
android:permission="com.google.android.c2dm.permission.SEND">
<intent-filter>
<action android:name="com.google.android.c2dm.intent.RECEIVE" />
<action android:name="com.google.android.c2dm.intent.REGISTRATION" />
<category android:name="com.xxx.xxx.android.test.xxxApp" />
</intent-filter>
<meta-data
android:name="DEFAULT_MESSAGE_HANDLER_KEY"
android:value="com.xxx.xxx.push.AGMessageListener" />
</receiver>
</application>
</manifest>
I already looked in my manifest-merger-release-report.txt inside my build folder (app/build/outputs/apk/manifest-merger-release-report.txt), but couldn't find any problems.
This is the part which contains the Android Beacon Library:
uses-permission#android.permission.BLUETOOTH
ADDED from org.altbeacon:android-beacon-library:2.1.3:11:5
android:name
ADDED from org.altbeacon:android-beacon-library:2.1.3:11:22
uses-permission#android.permission.BLUETOOTH_ADMIN
ADDED from org.altbeacon:android-beacon-library:2.1.3:12:5
android:name
ADDED from org.altbeacon:android-beacon-library:2.1.3:12:22
uses-permission#android.permission.RECEIVE_BOOT_COMPLETED
ADDED from org.altbeacon:android-beacon-library:2.1.3:13:5
android:name
ADDED from org.altbeacon:android-beacon-library:2.1.3:13:22
receiver#org.altbeacon.beacon.startup.StartupBroadcastReceiver
ADDED from org.altbeacon:android-beacon-library:2.1.3:16:9
android:name
ADDED from org.altbeacon:android-beacon-library:2.1.3:16:19
intent-filter#android.intent.action.ACTION_POWER_CONNECTED+android.intent.action.ACTION_POWER_DISCONNECTED+android.intent.action.BOOT_COMPLETED
ADDED from org.altbeacon:android-beacon-library:2.1.3:17:13
action#android.intent.action.BOOT_COMPLETED
ADDED from org.altbeacon:android-beacon-library:2.1.3:18:17
android:name
ADDED from org.altbeacon:android-beacon-library:2.1.3:18:25
action#android.intent.action.ACTION_POWER_CONNECTED
ADDED from org.altbeacon:android-beacon-library:2.1.3:19:17
android:name
ADDED from org.altbeacon:android-beacon-library:2.1.3:19:25
action#android.intent.action.ACTION_POWER_DISCONNECTED
ADDED from org.altbeacon:android-beacon-library:2.1.3:20:17
android:name
ADDED from org.altbeacon:android-beacon-library:2.1.3:20:25
service#org.altbeacon.beacon.service.BeaconService
ADDED from org.altbeacon:android-beacon-library:2.1.3:24:9
android:enabled
ADDED from org.altbeacon:android-beacon-library:2.1.3:26:13
android:label
ADDED from org.altbeacon:android-beacon-library:2.1.3:29:13
android:exported
ADDED from org.altbeacon:android-beacon-library:2.1.3:27:13
android:isolatedProcess
ADDED from org.altbeacon:android-beacon-library:2.1.3:28:13
android:name
ADDED from org.altbeacon:android-beacon-library:2.1.3:25:13
service#org.altbeacon.beacon.BeaconIntentProcessor
ADDED from org.altbeacon:android-beacon-library:2.1.3:30:9
android:enabled
ADDED from org.altbeacon:android-beacon-library:2.1.3:32:13
android:exported
ADDED from org.altbeacon:android-beacon-library:2.1.3:33:13
android:name
ADDED from org.altbeacon:android-beacon-library:2.1.3:31:13
Any idea what could cause this issue?
When using Robolectric tests with the Android Beacon Library, simply add this line to the top of your test:
BeaconManager.setsManifestCheckingDisabled(true);
This will disable the checking for the proper manifest entries when creating an instance of the BeaconManager. This is necessary, because Robolectric does not give you access to a real AndroidManifest when tests are run. I had encountered the same problem myself when building Robolectric tests inside the library itself. You can see an example of this here:
https://github.com/AltBeacon/android-beacon-library/blob/master/src/test/java/org/altbeacon/beacon/service/scanner/ScanFilterUtilsTest.java#L44

Running app gives 2 app icons in Android Studio

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.

Categories

Resources