Two launcher icons created for one app

RasmusVindRasmusVind USMember ✭✭
edited November 2017 in Xamarin.Android

Hi
I really hope someone can se what i am missing.
When i install my app at a huawei android 7.0 phone from the play store it gets two icons.
all other phones i have tryed it on i only get one.

I have read that this could be from having two activitys set with

          <intent-filter>
            <action android:name="android.intent.action.MAIN" />
            <category android:name="android.intent.category.LAUNCHER" />
          </intent-filter>

But i cannot finde any other place in my app that has that other than my splash activity.
Bellow is my release android manifest.

Does anyone have an idea on how to fix this?

<manifest xmlns:android="http://schemas.android.com/apk/res/android" android:installLocation="auto" package="com.####" android:versionName="1.0.5" android:versionCode="34">
  <!--suppress UsesMinSdkAttributes-->
  <uses-sdk android:minSdkVersion="16" />
  <uses-permission android:name="android.permission.INTERNET" />
  <uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
  <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
  <uses-permission android:name="android.permission.CAMERA" />
  <uses-feature android:name="android.hardware.camera" android:required="false" />
  <uses-feature android:name="android.hardware.camera.autofocus" android:required="false" />
  <application android:label="####" android:icon="@drawable/icon" android:debuggable="false" android:name="android.app.Application" android:allowBackup="true">
    <provider android:name="android.support.v4.content.FileProvider" android:authorities="com.####.fileprovider" android:exported="false" android:grantUriPermissions="true">
      <meta-data android:name="android.support.FILE_PROVIDER_PATHS" android:resource="@xml/file_paths"></meta-data>
    </provider>
    <activity android:configChanges="orientation|screenSize" android:icon="@drawable/icon" android:label="####" android:theme="@style/CustomThemeLight" android:name="############################.MainActivity" />
    <activity android:configChanges="orientation|screenSize" android:label="####" android:noHistory="true" android:theme="@style/Theme.Splash" android:name="#############################.SplashScreen">
      <intent-filter>
        <action android:name="android.intent.action.MAIN" />
        <category android:name="android.intent.category.LAUNCHER" />
      </intent-filter>
    </activity>
    <activity android:configChanges="orientation|screenSize" android:name="#############################.MediaPickerActivity" />
    <provider android:name="mono.MonoRuntimeProvider" android:exported="false" android:initOrder="2147483647" android:authorities="com.########.mono.MonoRuntimeProvider.__mono_init__" />
    <meta-data android:name="android.support.VERSION" android:value="25.4.0" />
  </application>
</manifest>

Best Answer

  • RasmusVindRasmusVind US ✭✭
    Accepted Answer

    Just had it confirmed to be resolved.
    For some reason the huawei phone put two icons on the home screen bc both the app and the activity had one defined.
    After removing the refrence to a android:icon from the activity and only having it under the application tag it works as expected.

Answers

  • CharwakaCharwaka INMember ✭✭✭✭✭

    @RasmusVind said:

    Hi
    I really hope someone can se what i am missing.
    When i install my app at a huawei android 7.0 phone from the play store it gets two icons.
    all other phones i have tryed it on i only get one.

    I have read that this could be from having two activitys set with

              <intent-filter>
                <action android:name="android.intent.action.MAIN" />
                <category android:name="android.intent.category.LAUNCHER" />
              </intent-filter>
    

    But i cannot finde any other place in my app that has that other than my splash activity.
    Bellow is my release android manifest.

    Does anyone have an idea on how to fix this?

    <manifest xmlns:android="http://schemas.android.com/apk/res/android" android:installLocation="auto" package="com.####" android:versionName="1.0.5" android:versionCode="34">
      
      <uses-sdk android:minSdkVersion="16" />
      <uses-permission android:name="android.permission.INTERNET" />
      <uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
      <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
      <uses-permission android:name="android.permission.CAMERA" />
      <uses-feature android:name="android.hardware.camera" android:required="false" />
      <uses-feature android:name="android.hardware.camera.autofocus" android:required="false" />
      <application android:label="####" android:icon="@drawable/icon" android:debuggable="false" android:name="android.app.Application" android:allowBackup="true">
        <provider android:name="android.support.v4.content.FileProvider" android:authorities="com.####.fileprovider" android:exported="false" android:grantUriPermissions="true">
          <meta-data android:name="android.support.FILE_PROVIDER_PATHS" android:resource="@xml/file_paths"></meta-data>
        </provider>
        <activity android:configChanges="orientation|screenSize" android:icon="@drawable/icon" android:label="####" android:theme="@style/CustomThemeLight" android:name="############################.MainActivity" />
        <activity android:configChanges="orientation|screenSize" android:label="####" android:noHistory="true" android:theme="@style/Theme.Splash" android:name="#############################.SplashScreen">
          <intent-filter>
            <action android:name="android.intent.action.MAIN" />
            <category android:name="android.intent.category.LAUNCHER" />
          </intent-filter>
        </activity>
        <activity android:configChanges="orientation|screenSize" android:name="#############################.MediaPickerActivity" />
        <provider android:name="mono.MonoRuntimeProvider" android:exported="false" android:initOrder="2147483647" android:authorities="com.########.mono.MonoRuntimeProvider.__mono_init__" />
        <meta-data android:name="android.support.VERSION" android:value="25.4.0" />
      </application>
    </manifest>
    

    have u tried with sample code ?

  • RasmusVindRasmusVind USMember ✭✭
    Accepted Answer

    Just had it confirmed to be resolved.
    For some reason the huawei phone put two icons on the home screen bc both the app and the activity had one defined.
    After removing the refrence to a android:icon from the activity and only having it under the application tag it works as expected.

Sign In or Register to comment.