0

I updated to Android Studio 2.0 and debugged an app with it. I noticed that the debug-app isn't listed in launchable apps in the menu anymore and thought that this might be due to the new instant-run feature of Android Studio 2.0.

Then, I generated a signed release .apk and uploaded it to the store. Two test devices installed the update but they aren't able to launch the app anymore. It isn't listed in the said menu too and Google Play's only option is to "uninstall" the app, there is no launch button.

Where do I have to search for the cause of this issue and how can I resolve it? I already checked my AndroidManifest.xml to mark the Activity as Main:

    <activity
        android:name=".activities.LoginActivity"
        android:label="@string/app_name"
        android:theme="@style/AppTheme.NoActionBar">
        <intent-filter>
            <action android:name="android.intent.action.MAIN" />

            <category android:name="android.intent.category.LAUNCHER" />

            <action android:name="android.intent.action.VIEW" />

            <category android:name="android.intent.category.DEFAULT" />
            <category android:name="android.intent.category.BROWSABLE" />

            <data android:scheme="myapp" />
        </intent-filter>
    </activity>
user3105453
  • 1,881
  • 5
  • 32
  • 55
  • So when updating your apk release, you updated the version code and whatever you need to update? – Eenvincible Apr 10 '16 at 18:21
  • Yes, `versionCode 4` and `versionName "0.0.4"` were updated. I think Google Play wouldn't let me upload an .apk with the same version info. – user3105453 Apr 10 '16 at 18:22

1 Answers1

2

Your problem is this:

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

        <category android:name="android.intent.category.LAUNCHER" />

        <action android:name="android.intent.action.VIEW" />

        <category android:name="android.intent.category.DEFAULT" />
        <category android:name="android.intent.category.BROWSABLE" />

        <data android:scheme="myapp" />
    </intent-filter>

You are saying that this activity requires three conditions to be met:

  • Either ACTION_VIEW or ACTION_MAIN
  • Either CATEGORY_DEFAULT or CATEGORY_BROWSABLE or CATEGORY_LAUNCHER
  • myapp as a scheme

The home screen launcher will not be adding myapp as a scheme, and so the home screen (and the Settings app) cannot start this activity.

Presumably, what you want is two separate <intent-filter> elements for the same <activity>:

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

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

        <category android:name="android.intent.category.DEFAULT" />
        <category android:name="android.intent.category.BROWSABLE" />

        <data android:scheme="myapp" />
    </intent-filter>
CommonsWare
  • 986,068
  • 189
  • 2,389
  • 2,491