Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

App installed through android studio not shown in Launcher

All of a sudden the app i'm working on doesn't show in the launcher. I can see it in Settings>Apps and it runs like a normal app when I start it from Android Studio.

So it sounds like I'm missing:

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

in the manifest. Nope they're there. What else can cause this? Does build gradle mess with this possibly?

This is my full manifest and build gradle file. Can anyone see something I'm missing?

<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
     package="com.example.app" >

<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.GET_ACCOUNTS" />
<uses-permission android:name="android.permission.USE_CREDENTIALS" />
<uses-permission android:name="android.permission.WAKE_LOCK" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-permission android:name="com.google.android.c2dm.permission.RECEIVE" />
<uses-permission android:name="com.example.gcm.permission.C2D_MESSAGE" />

<uses-feature android:name="android.hardware.camera" />

<application
    android:allowBackup="true"
    android:icon="@drawable/ic_launcher"
    android:label="@string/app_name"
    android:theme="@style/AppTheme" >

    <meta-data
        android:name="com.crashlytics.ApiKey"
        android:value="xxxxxx" />
    <meta-data
        android:name="com.google.android.gms.version"
        android:value="@integer/google_play_services_version" />
    <meta-data
        android:name="com.facebook.sdk.ApplicationId"
        android:value="xxxx" />

    <activity
        android:name="com.example.app.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" />

            <data android:host="com.example.twitter.oauth" android:scheme="oauth" />
        </intent-filter>
    </activity>

    <activity
        android:name="com.example.app.SigninActivity"
        android:label="@string/sign_in"
        android:screenOrientation="portrait" >
    </activity>

    <activity
        android:name="com.example.app.PostActivity"
        android:label="@string/action_new"
        android:screenOrientation="portrait" >
    </activity>

    <activity
        android:name="com.example.app.twitter.OAuthActivity"
        android:label="@string/action_new"
        android:screenOrientation="portrait" >
    </activity>

    <activity
        android:name="com.facebook.LoginActivity"
        android:theme="@android:style/Theme.Translucent.NoTitleBar"
        android:label="@string/app_name" />

    <receiver
        android:name="com.example.app.gcm.GCMBroadcastReceiver"
        android:permission="com.google.android.c2dm.permission.SEND" >
        <intent-filter>
            <action android:name="com.google.android.c2dm.intent.RECEIVE" />
            <category android:name="com.example.gcm" />
        </intent-filter>
    </receiver>

    <service android:name="com.example.app.gcm.GCMIntentService" />

</application>

</manifest>

build.gradle:

buildscript {
    repositories {
        maven { url 'http://download.crashlytics.com/maven' }
    }

    dependencies {
        classpath 'com.crashlytics.tools.gradle:crashlytics-gradle:1.+'
    }
}

apply plugin: 'com.android.application'
apply plugin: 'crashlytics'

repositories {
    maven { url 'http://download.crashlytics.com/maven' }
}


android {
    compileSdkVersion 19
    buildToolsVersion '19.1.0'
    def versionPropsFile = file('version.properties')
    if (versionPropsFile.canRead()) {
        def Properties versionProps = new Properties()

        versionProps.load(new FileInputStream(versionPropsFile))

        def value = 0

        def runTasks = gradle.startParameter.taskNames
        if ('assemble' in runTasks || 'assembleRelease' in runTasks || 'aR' in runTasks) {
            value = 1;
        }

        def versionMajor = 1
        def versionMinor = 0
        def versionPatch = versionProps['VERSION_PATCH'].toInteger() + value
        def versionBuild = versionProps['VERSION_BUILD'].toInteger() + 1
        def version_Code = versionProps['VERSION_CODE'].toInteger() + value

        versionProps['VERSION_PATCH'] = versionPatch.toString()
        versionProps['VERSION_BUILD'] = versionBuild.toString()
        versionProps['VERSION_CODE'] = version_Code.toString()

        versionProps.store(versionPropsFile.newWriter(), null)

        defaultConfig {
            versionCode version_Code
            versionName "${versionMajor}.${versionMinor}.${versionPatch} (${versionBuild}) Alpha"
            minSdkVersion 15
            targetSdkVersion 19
        }
    } else {
        throw new GradleException("Could not read version.properties!")
    }

    signingConfigs {
        debug {
            storeFile file('xxx.jks')
            storePassword 'xxx'
            keyAlias 'debug'
            keyPassword 'xxx'
        }
        releaseKey {
            storeFile file('xxx.jks')
            storePassword 'xxx'
            keyAlias 'com.example.app'
            keyPassword 'xxx'
        }
    }

    buildTypes {
        debug {
            debuggable true
            applicationIdSuffix '.debug'
            runProguard false
        }
        release {
            runProguard false
        }
    }

    lintOptions{
        checkReleaseBuilds false
        abortOnError false
    }
}

dependencies {
    compile files('libs/twitter4j-core-4.0.1.jar')
    compile files('libs/okhttp-2.0.0.jar')
    compile files('libs/okio-1.0.0.jar')
    compile 'com.android.support:support-v4:20.0.+'
    compile 'com.google.android.gms:play-services:+'
    compile 'com.android.support:appcompat-v7:20.0.+'
    compile project(':facebook')
    compile project(':parallaxViewPager')
    compile 'com.crashlytics.android:crashlytics:1.+'
}
like image 484
just_user Avatar asked Jul 03 '14 07:07

just_user


People also ask

Where are Android Studio apps stored?

For normal apps, there are stored in internal memory in /data/app. Some of the encrypted apps, the files are stored in /data/app-private. For apps stored in the external memory, files are stored in /mnt/sdcard/Android/data.

Where did my installed app go?

Android. You can see your Android app history on your phone or on the web. On your Android phone, open the Google Play store app and tap the menu button (three lines). In the menu, tap My apps & games to see a list of apps currently installed on your device.

Why my phone is not showing installed apps?

Shut Down and Restart Your Android Phone It can also result from the home screen display issue. To fix the issue, you can shut down and restart your Android device: Long-press the “power” button for about 3 seconds and click on the “Power off” option to shut down your Android phone.

Why my app is not opening in Android Studio?

Unplug your device from the USB port on the computer. Restart the device by powering off and back on. Verify that Settings => Developer options => USB Debugging is enabled. Quit and re-launch Android Studio.


1 Answers

You can actually have an intent filter with data android:host in the launcher activity. It just needs to be a separate filter to the one containing the launcher category. The following setup makes my activity both a launcher one and browsable in order to read input parameters:

<activity android:name=".MainActivity" android:label="@string/app_name_full">
        <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="http"
                  android:host="www.giorgos.nl"
                  android:pathPrefix="/cv" />
            <data android:scheme="cv"
                  android:host="giorgos"/>
        </intent-filter>
</activity>
like image 106
giorgos.nl Avatar answered Oct 04 '22 18:10

giorgos.nl