• After 15+ years, we've made a big change: Android Forums is now Early Bird Club. Learn more here.

Apps Run via emulator not working

qxc

Lurker
Apr 26, 2011
5
0
I have my code without any errors compiled and ready to run. I right click on my project and select run as -> Android Application. The emulator starts with the virtual device I made and the emulator gets to the android desktop but it doesn't actually run my program.

What do I do?
 
Trying to figure out exactly where you are in the scheme of things.

My first guess is that your application is installing but you don't have your default activity. I would take a look at your android manifest, make sure names line up for activities.

Did you see if the application is present at all on the emulator?



EDIT 1: Did you change any of the names of classes reference in the original manifest you were building from
Code:
<?xml version="1.0" encoding="UTF-8"?>
-<manifest package="com.helloandroid.android.newsdroid" xmlns:android="http://schemas.android.com/apk/res/android"> 
-<application android:icon="@drawable/icon"> 
-<activity android:label="@string/app_name" [COLOR="Navy"][B]class=".FeedsList"[/B][/COLOR]> 
-<intent-filter> 
<action android:value="android.intent.action.MAIN"/> 
<category android:value="android.intent.category.LAUNCHER"/>
</intent-filter> 
</activity> 
<activity android:label="@string/url_editor" class=".URLEditor"/> 
<activity android:label="@string/articles_list" class=".ArticlesList"/> 
</application>
</manifest>
Bolded and made blue the most likely culprit
 
Upvote 0
root folder for project, androidmanifest.xml



A few questions, with links to help answer:

Are you signing the app as debug or might your debug have expired?
(if you are using Eclipse as IDE then it does this by default, however if you imported the project it may behave differently)
Signing Your Applications | Android Developers

Are you planning to or have you tried test cases?
(These can be ideal as you can control what they fetch, in most cases a test app acts as a wrapper for your App letting you see all the I/O going on. Mocks also let you test the functionality of your app before you have to deal with formatting issues if you are fetching data.)
Testing Fundamentals | Android Developers

What do you see in the debug perspective?
Debugging from Eclipse with ADT | Android Developers



Simply put, check on the manifest, then the signing. Those should get you to a point where you can at least see what you have thrown down thus far. After that I highly recommend familiarizing yourself with testing and the debugging, if you haven't already.
 
Upvote 0
Posted my manifest
Code:
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    package="newsDroid.com">
    <application android:icon="@drawable/icon">
        <activity class=".FeedsList" android:label="@string/app_name" android:name="FeedsList">
            <intent-filter>
                <action android:value="android.intent.action.MAIN" android:name="Main" />
                <category android:value="android.intent.category.LAUNCHER" android:name="Launcher" />
            </intent-filter>
        </activity>
        <activity class=".URLEditor" android:label="@string/url_editor" android:name="url_editor"/>
        <activity class=".ArticlesList" android:label="@string/articles_list" android:name="@string/articles_list" />
    </application>
</manifest>
Everything compiles fine but when I tried to run it just went to the Android desktop. I'm using the Eclipse IDE so I don't think I have any problems with signing or the like.

After changing the manifest (didn't even know about it before) to the above I tried running and got the error

[2011-05-02 21:31:19 - NewsDroidDB] Installation error: INSTALL_PARSE_FAILED_MANIFEST_MALFORMED
[2011-05-02 21:31:19 - NewsDroidDB] Please check logcat output for more details.
[2011-05-02 21:31:19 - NewsDroidDB] Launch canceled!
 
Upvote 0
package name correct?
FeedList the correct class name?

I know a few other things I want you to check, but I don't remember all the steps from memory. Need to get back to my development machine and turn off my shortcuts/paths before I can walk you through them. I will edit/reply when I get home.
 
Upvote 0

BEST TECH IN 2023

We've been tracking upcoming products and ranking the best tech since 2007. Thanks for trusting our opinion: we get rewarded through affiliate links that earn us a commission and we invite you to learn more about us.

Smartphones