15

FYI: I have gone through these links already 'App not Installed' Error on Android

Application not installed when i try to autoupdate

My question is little different.

  • I released app with default/main activity as XActiivity.java in version 1.0
  • I released update with changing default/main activity as YActivity.java
  • I find that app opens fine from application meanu, but when I try to launch from home screen shortcut, it throws an error saying "Application is not installed"

I know that its due to shortcut referencing to old XActivity.java, by removing would solve this issue, but if I release app to thousands as an update who already have this app would get annoyed at the first instance of this error message. I would loose on good reviews I got

Community
  • 1
  • 1
Shri
  • 1,223
  • 5
  • 22
  • 31

11 Answers11

28

Please check if you have the property android:exported="false" on an activity that should have been a "android.intent.category.LAUNCHER". This disables the specific activity from being launched on the launcher.

Pier Betos
  • 1,038
  • 9
  • 17
  • 4
    Android 12 requires activities [explicitly set this value](https://developer.android.com/about/versions/12/behavior-changes-12#security). I set it to false originally, but changed it because of your answer. Thanks! – Yirmi Aug 04 '21 at 18:57
  • No it didn't, the doc applied it on a service. Just discern what is used as a launcher activity vs what is on a service so you would know where to apply the export attribute. – Pier Betos Aug 05 '21 at 12:32
  • I linked the documented changes for Android 12 (API 31) above. "If your app targets Android 12 and contains **activities**, services, or broadcast receivers that use intent filters, you must explicitly declare the android:exported attribute for these app components." – Yirmi Aug 05 '21 at 12:48
  • I looked more closely, it specifies that activities which use intent filters need the attribute. Since the Main/Launcher activity uses an intent filter, the attribute is required. – Yirmi Aug 05 '21 at 13:07
  • android:exported="true" <= this fixed my issue. – Hassan Naqvi Nov 03 '21 at 08:38
  • This should be the accepted answer; so simple! Thanks @PierBetos! – head in the codes Jan 12 '22 at 04:26
13

in 2021, just add

android:exported="true"

in the manifest, and it will be fixed

Example

Liong
  • 1,324
  • 12
  • 18
4

That is because homescreen shortcuts work slightly differently from the launcher icons in some launchers.

Your old shortcut still contains a reference to XActiivity as the main Activity, when you have updated it to be YActiivity. This causes Android to think the app isn't installed, as it cannot find an XActiivity in your app marked as the MAIN Activity.

Simply removing the home screen icon and adding it back will solve this.

Raghav Sood
  • 81,899
  • 22
  • 187
  • 195
  • Thank you, Yes I agree with /know your solution, but however if I release my update to thousands, its going to effect every one, so they might face same issue. – Shri Jun 28 '13 at 08:58
  • @Shri Unfortunately, there's not much you can do to get around it short of not changing your launcher class' name. Some launchers don't even have this problem, but a fair bit do. Its just one of those things you can't control. – Raghav Sood Jun 28 '13 at 08:59
  • Can anyone identify which launchers have this problem. I would like to be able to reproduce this. – AlexVPerl Feb 25 '15 at 09:00
  • omg I was thinking about an Android issue but it was just an Activity name update, such a stupid typo;) – Choletski Sep 01 '17 at 08:02
3

Putting

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

inside specific activity inside Manifest.XML did the job for me.

  • This is not connected to this problem. Documentation says Activity for shortcuts must be LAUNCHER and action MAIN. ( doc https://developer.android.com/guide/topics/ui/shortcuts) – TheLibrarian May 10 '18 at 15:38
2

This question is old, but still relevant today.

This occurred because I changed the starting activity. I had this originally (truncated):

<manifest>
    <application>
        <activity android:name=".activities.StartActivity">
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />
                <category android:name="android.intent.category.LAUNCHER" />
            </intent-filter>
        </activity>
        <activity
            android:name=".activities.OtherActivity"
            android:exported="false" />
    </application>
</manifest>

I removed StartActivity but I forgot to remove android:exported="false", after adding the intent filter. It looked like this:

<manifest>
    <application>
        <activity
            android:name=".activities.OtherActivity"
            android:exported="false"> <!-- REMOVE THIS -->
            <intent-filter>
                <action android:name="android.intent.action.MAIN"/>
                <category android:name="android.intent.category.LAUNCHER" />
            </intent-filter>
        </activity>
    </application>
</manifest>

In short, make sure your starting activity is exported.

Maalevolent
  • 472
  • 1
  • 5
  • 12
0

What if you implement both XActivity and YActivity as entry points in your app? XActivity could remove its launcher shortcut, install the YActivity shortcut, and launch YActivity.

Sparky
  • 8,437
  • 1
  • 29
  • 41
0

first ensure if current installed apps can be moved to sd card if they cant be that is it you have got the reason on my htc desire 300 while rooting i flashed wrong rom bricked my phone in bootloop got it repaired from a shop now running custom rom i dont know which one but it doesnt support moving app to sd card so i copied app to phone memory unmounted or removed sd card then i try to install from phone memory and my fs2014 1.35 is now installed horrray hope it help you this will only work if you have custom rom because original rom does nt have errors like that or you call that a bug

0

Possible Solutions of “Application not Installed” error

  • Reboot the phone: In times like this, first thing to do is to reboot your device. Or just shut down, remove and reinsert your battery.
  • Make sure to uninstall any apps you don’t use to free up space, also uninstall previous versions of the same app currently installed on
    your device.
  • Double check the apk files you download and be sure they were
    completely copied or downloaded.

  • Try resetting app permissions by going to Settings >Apps>All>Menu key

    Reset application permissions or Reset app preferences.

  • Change app installation location to Automatic or Let system decide.
    Make sure your SD card is not mounted or connected to a PC or
    elsewhere.
  • For worst case scenarios, format your SD card – copy it’s contents
    somewhere else for backup and format.

  • The last solution would be to totally wipe your device. Either by
    doing a factory reset under Settings or by doing a full wipe in
    recovery mode.

Reference

Garg
  • 2,731
  • 2
  • 36
  • 47
0

I've had the same problem, just a minute ago. I'm not expert so all I could get from all answers is problem is in shortcut created on home screen by launcher. I'm using classic minimalist launcher which doesn't have app drawer so all apps are on home screen, so I can't just delete shortcut without uninstalling it.

So I cleared cache of my launcher and it created new shortcut for that app on its own and it started working.

0

Might be a case, check your code for "App shortcut creation" where the Intent.EXTRA_SHORTCUT_INTENT is mapped to the LAUNCHER activity. (Might be SplashScreenActivity)

Sackurise
  • 2,804
  • 1
  • 18
  • 18
-1

The solution I wrote is. AndroidManfest.xml

  1. I retained intent filter android.intent.action.MAIN for my previous XActivity.java.
  2. I also retained intent filter android.intent.action.MAIN and also category as LAUNCHER to YActivity.java

In the onCreate() method of XActivity.java I added these lines, and it seems to have solved issue

Intent thisIntent = getIntent();
if(thisIntent.getAction() == "android.intent.action.MAIN"){

        Intent intent = new Intent(this,YActivity.class);
        startActivity(intent);
        finish();
}
Shri
  • 1,223
  • 5
  • 22
  • 31
  • Hi - I am trying out your solution, but unfortunately this is really hard to test. Can you please explain how this fixes it, because if the problem is with the shortcut having a mismatched launcher activity embedded in its details then I'm not sure how this should resolve it. Please elaborate. Thanks! – AlexVPerl Mar 02 '15 at 08:51
  • This didn't fix it for me, but setting `android:exported="true"` did, as per this answer: https://stackoverflow.com/a/39957428/1346778 – head in the codes Jan 12 '22 at 04:27