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

My emulator does not run my app.

My emulator starts up and displays a lock screen. When I unlock it, I get a perfectly functional Android device that I can manipulate like a regular phone. However, unlike the video my app does not start.

Below is what comes up in message log:

Waiting for device. Target device: Android442 [emulator-5554] Uploading file local path: C:\Users\JR\AndroidStudioProjects\FunFacts\app\build\outputs\apk\app-debug.apk remote path: /data/local/tmp/JAR503.funfacts Installing JAR503.funfacts DEVICE SHELL COMMAND: pm install -r "/data/local/tmp/JAR503.funfacts" pkg: /data/local/tmp/JAR503.funfacts Failure [INSTALL_PARSE_FAILED_MANIFEST_MALFORMED]

I downloaded the Android Studio and the Java kit from the "Teachers Notes" portion of the course, I am assuming that I am not missing anything needed to follow along with the videos.

Any help with this issue is greatly appreciated. Also, if I could get a rundown of what is going on in the message log above I would appreciate it, too!

Thank you.

Hello,

There appears to be a problem with your AndroidManifest.xml file, could you post it, as well as your build.gradle file?

Hello @jamessimshaw,

AndroidManifest.xml

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

    <application
        android:allowBackup="true"
        android:icon="@drawable/ic_launcher"
        android:label="@string/app_name"
        android:theme="@style/AppTheme" >
        <activity
            android:name=".FunFactActivity"
            android:label="@string/app_name" >
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />

                <category android:name="android.intent.category.LAUNCHER" />
            </intent-filter>
        </activity>
    </application>

</manifest>

build.gradle contents is below:

apply plugin: 'com.android.application'

android { compileSdkVersion 19 buildToolsVersion "20.0.0"

defaultConfig {
    applicationId "JAR503.funfacts"
    minSdkVersion 14
    targetSdkVersion 19
    versionCode 1
    versionName "1.0"
}
buildTypes {
    release {
        runProguard false
        proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
    }
}

}

dependencies { compile fileTree(dir: 'libs', include: ['*.jar']) }

I have not made any changes to these files. I am just trying to get the app to display 'Hello World' in the emulator like it does in the 'Running the Fun Facts Project' video.

Thanks!

This is build.gradle file I found in the Android Studio, (I think I posted something else last time.)

build.gradle

apply plugin: 'com.android.application'

android {
    compileSdkVersion 19
    buildToolsVersion "20.0.0"

    defaultConfig {
        applicationId "JAR503.funfacts"
        minSdkVersion 14
        targetSdkVersion 19
        versionCode 1
        versionName "1.0"
    }
    buildTypes {
        release {
            runProguard false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }
}

dependencies {
    compile fileTree(dir: 'libs', include: ['*.jar'])
}

1 Answer

Hello,

In your package name, you are using capital letters. This can cause issues like this to occur. Try changing your package name to all lowercase letters and try again.

Can you clarify what you mean by the package name? Where can I find and edit that?

Here should be a decent resource on changing the name of your package. Right now your package is named JAR503.funfacts, try changing the JAR503 to jar503

I don't understand that thread you linked.

I am just going to start over and leave the name lowercase.

Thank you for taking the time to help me out!