Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

Android

App not showing up on my emulator

I am following the videos, and ran into an issue. The emulator on my program, android studio, seems to be working fine, however when i run it, the app doesn't show up on the emulator at all.

Has anyone else ran into this issue, and if so, how did you fix it?

1 Answer

If you are using android studio first see the errors(gradle build errors, android logs). I assume that you are developing Crystal Ball app, one of the problems is the supported library v7 in android studio. If you want to build application using this library you have to use appcompat theme. When theme doesn't match emulator will not run the application. If the problem is theme try this in style.xml file

<?xml version="1.0" encoding="utf-8"?>
<resources>
    <style name="AppTheme" parent="Theme.AppCompat">
        <item name="android:windowNoTitle">true</item>
        <item name="android:windowActionBar">false</item>
        <item name="android:windowFullscreen">true</item>
    </style>
</resources>

Another problem could be gradle build. Always be sure that your compiledSdkVersion matches minSdkVersion and supported by targetSdkVersion. Here is example of my build.gradle file:

apply plugin: 'com.android.application'
android {
    compileSdkVersion 16
    buildToolsVersion '19.1.0'

    defaultConfig {
        applicationId "com.example.pasha.crystalball"
        minSdkVersion 16
        targetSdkVersion 19
        versionCode 1
        versionName "1.0"
    }
    buildTypes {
        release {
            runProguard true
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }
}
dependencies {
    compile fileTree(dir: 'libs', include: ['*.jar'])
    compile 'com.android.support:appcompat-v7:19.+'
}