Launcher icon missing in Android

2019-01-20 08:44发布

问题:

My manifest launcher activity looks like:

 <activity android:name=".CBMainMenu" android:screenOrientation="portrait" android:windowSoftInputMode="adjustPan" 
                  >
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />
                <category android:name="android.intent.category.DEFAULT" />
                <category android:name="android.intent.category.LAUNCHER" /> 

                <data android:scheme="linkedinapp" android:host="connect" />
            </intent-filter>

Other applications are correctly installing but why does this app not? I can see this app in Applications>Manage Applications but it missing in shortcut.

Here is my full manifest:

<manifest xmlns:android="http://schemas.android.com/apk/res/android"
      package="com.check.careerbuilder"
      android:versionCode="1"
      android:versionName="1.0">

   <uses-permission android:name="android.permission.GET_ACCOUNTS"></uses-permission>
    <uses-permission android:name="android.permission.MANAGE_ACCOUNTS"></uses-permission>
    <uses-permission android:name="android.permission.USE_CREDENTIALS"></uses-permission>


    <uses-permission android:name="com.google.android.googleapps.permission.GOOGLE_AUTH"/>
    <uses-permission android:name="com.google.android.googleapps.permission.GOOGLE_AUTH.youtube"/>

<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<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.READ_PHONE_STATE" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_WIFI_STATE" />
<uses-permission android:name="android.permission.CHANGE_WIFI_STATE" />
<uses-permission android:name="android.permission.VIBRATE" />
 <uses-permission android:name="android.permission.CAMERA" />
 <uses-feature android:name="android.hardware.camera" />
 <uses-feature android:name="android.hardware.camera.autofocus" />

 <uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION"></uses-permission>
    <uses-permission android:name="android.permission.ACCESS_FINE_LOCATION"></uses-permission>
    <uses-permission android:name="android.permission.READ_CONTACTS"></uses-permission>

    <application android:label="@string/app_name" android:icon="@drawable/appicon" >
        <activity android:name=".CBMainMenu" android:label="CB Ambassador" android:screenOrientation="portrait" android:windowSoftInputMode="adjustPan" 
                  >
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />
                <category android:name="android.intent.category.DEFAULT" />
                <category android:name="android.intent.category.LAUNCHER" /> 

                <data android:scheme="linkedinapp" android:host="connect" />
            </intent-filter>

        </activity>

    <uses-library android:name="com.google.android.maps" android:required="true"></uses-library>
    <activity android:name=".GoogleMap"></activity>


     <activity android:name=".Verify"  android:screenOrientation="portrait" android:finishOnTaskLaunch="true"></activity>
     <activity android:name=".VideoPush"  android:screenOrientation="portrait" android:finishOnTaskLaunch="true"></activity>
      <activity android:name=".Videoclass"  android:screenOrientation="portrait" android:finishOnTaskLaunch="true"></activity>

      <activity android:name=".SocialMedia" android:windowSoftInputMode="adjustPan"  android:screenOrientation="portrait" android:finishOnTaskLaunch="true"></activity>
      <activity
            android:name=".PreviewActivity"
            android:windowSoftInputMode="stateHidden" />


        <activity android:name=".SearxhJobs"  android:windowSoftInputMode="adjustPan"  android:screenOrientation="portrait" android:finishOnTaskLaunch="true"></activity>
        <activity android:name=".AboutUs"  android:screenOrientation="portrait" android:finishOnTaskLaunch="true"></activity>
        <activity android:name=".Benefits"  android:screenOrientation="portrait" android:finishOnTaskLaunch="true"></activity>

        <activity android:name=".EndJobList" android:screenOrientation="portrait" android:finishOnTaskLaunch="true"></activity>
<activity android:name=".FirstJobList" android:screenOrientation="portrait" android:finishOnTaskLaunch="true"></activity>
<activity android:name=".SecondJobList" android:screenOrientation="portrait" android:finishOnTaskLaunch="true"></activity>
<activity android:name=".Pleaseselect"  android:screenOrientation="portrait" android:finishOnTaskLaunch="true"></activity>
<activity android:name=".ThirdJobList" android:screenOrientation="portrait" android:finishOnTaskLaunch="true"></activity>
<activity android:name=".FourthJobList" android:screenOrientation="portrait" android:finishOnTaskLaunch="true"></activity>
<activity android:name=".JobsCities" android:screenOrientation="portrait" android:finishOnTaskLaunch="true"></activity>
<activity android:name=".JobsTypes" android:screenOrientation="portrait" android:finishOnTaskLaunch="true"></activity>
<activity android:name=".JobDescription" android:screenOrientation="portrait" android:finishOnTaskLaunch="true"></activity>

<activity android:name="ReferAFriend" android:windowSoftInputMode="adjustPan"  android:screenOrientation="portrait" android:finishOnTaskLaunch="true"></activity>
<activity android:name=".Faq" android:screenOrientation="portrait" android:finishOnTaskLaunch="true"></activity>

<activity android:name=".ThanksActivity1" android:screenOrientation="portrait" android:finishOnTaskLaunch="true"></activity>
<activity android:name=".ThanksActivity" android:screenOrientation="portrait" android:finishOnTaskLaunch="true"></activity>
<activity android:name=".EmailThisJob" android:screenOrientation="portrait" android:theme="@android:style/Theme.Dialog" android:finishOnTaskLaunch="true"></activity>
<activity android:name=".MyDialog" android:screenOrientation="portrait" android:theme="@android:style/Theme.Dialog" android:finishOnTaskLaunch="true"></activity>
<activity android:name=".FileManagerActivity" android:screenOrientation="portrait" android:finishOnTaskLaunch="true"></activity>
<activity android:name=".ReferPopup" android:screenOrientation="portrait" android:theme="@android:style/Theme.Dialog"></activity>
<activity android:name=".Jobs" android:screenOrientation="portrait"></activity>
<activity android:name=".Youtube" android:screenOrientation="portrait"></activity>
<activity android:name=".Profile" android:screenOrientation="portrait"></activity>
<activity android:name=".Colleagues" android:screenOrientation="portrait"></activity>
<activity android:name=".ColleagueProfile" android:screenOrientation="portrait"></activity>
<activity android:name=".Takephoto" ></activity>
<activity android:name=".TwitterFollowers" android:screenOrientation="portrait"></activity>
<activity android:name=".FacebookFriends" android:screenOrientation="portrait"></activity>
<activity android:name=".LinkedinFriends" android:screenOrientation="portrait"></activity>
<activity android:name=".Moreoptions" android:screenOrientation="portrait"></activity>
<activity android:name=".Reader" android:screenOrientation="portrait"></activity>
<activity android:name=".Shareweb" android:screenOrientation="portrait"></activity>
<activity android:name=".Groupon" android:screenOrientation="portrait"></activity>
<activity android:name=".DealsShow" android:screenOrientation="portrait"></activity>
<activity android:name=".LocalWeather" android:screenOrientation="portrait"></activity>

 <activity android:name="com.brightcove.android.oneplanet.Playlists"
                  android:label="@string/app_name"
                  android:screenOrientation="portrait">

        </activity>
        <activity android:name="com.brightcove.android.oneplanet.Videos"
                android:label="@string/videos_activity" 
                android:screenOrientation="portrait"/>
        <activity android:name="com.brightcove.android.oneplanet.Player"
                android:label="@string/player_activity"
                android:configChanges="orientation"
                android:screenOrientation="landscape" />

        <activity android:theme="@style/YtdTheme" android:name="com.google.ytd.SubmitActivity"
                  android:configChanges="orientation|keyboardHidden"/>

        <activity android:theme="@style/YtdTheme" android:name="com.google.ytd.DetailsActivity"/>
        <activity android:theme="@style/YtdTheme" android:name="com.google.ytd.SubmitActivity"
                  android:configChanges="orientation|keyboardHidden"/>      

<activity android:name="com.check.careerbuilder.SmsTo" android:screenOrientation="portrait" android:theme="@android:style/Theme.Dialog"></activity>
 <activity android:name="com.ecs.android.sample.twitter.PrepareRequestTokenActivity" android:launchMode="singleTask">>
            <intent-filter>
                <action android:name="android.intent.action.VIEW" />

                <category android:name="android.intent.category.BROWSABLE" />
                <data android:scheme="x-oauthflow-twitter" android:host="callback" />
            </intent-filter>
        </activity>   

    <activity android:name=".CustomDataActivity" android:label="Custom Data" android:screenOrientation="portrait">

            <intent-filter>

                <action android:name="com.check.careerbuilder.DISPLAY_CUSTOM_DATA" />


                        <data android:scheme="notif" />

            </intent-filter>

</activity>




    </application>
    <uses-sdk android:minSdkVersion="3"  />


   <uses-feature
        android:name="android.hardware.telephony.gsm" />
</manifest>

How to resolve this? what could the problem be?

回答1:

The problem is <data android:scheme="linkedinapp" android:host="connect" /> , you cannot logically use this tag in launcher activity, See below line , I taken from http://blog.marcingil.com/2011/03/starting-android-application-from-browser-uri/

Set if the activity should be an option for the default action (center press) to perform on a piece of data. Setting this will hide from the user any activities without it set when performing an action on some data. Note that this is normal -not- set in the Intent when initiating an action — it is for use in intent filters specified in packages.



回答2:

I know this is a bit old. But, answering it for the benefit of someone who would face the same problem. The launcher activity should have specific filter as below in order for it to show up in the apps list.

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


回答3:

The solution is not given in this topic. The real solution is to use multiple intent filters and is given here - https://stackoverflow.com/a/34611591/1828637



回答4:

Try to add

android:label="My App"

like this:

<activity android:name=".CBMainMenu" android:screenOrientation="portrait" android:windowSoftInputMode="adjustPan" android:label="My App" >


回答5:

For some days i have been facing the same problem, cant find my launcher icon. So here's what i did. The launcher activity should have this(MAIN)<action android:name="android.intent.action.MAIN"

Also have you tried it after removing <category android:name="android.intent.category.DEFAULT" in your `

            <data android:scheme="linkedinapp" android:host="connect" />
        </intent-filter>`

Hope it helps.