1. Download our Official Android App: Forums for Android!

Apps Run via emulator not working

Discussion in 'Android Development' started by qxc, May 2, 2011.

  1. qxc

    qxc Lurker
    Thread Starter
    Rank:
    None
    Points:
    5
    Posts:
    5
    Joined:
    Apr 26, 2011

    Apr 26, 2011
    5
    0
    5
    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?
     

    Advertisement

  2. TzaGear

    TzaGear Lurker
    Rank:
    None
    Points:
    5
    Posts:
    5
    Joined:
    Apr 26, 2011

    Apr 26, 2011
    5
    0
    5
    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 (Text):
    1.  
    2. <?xml version="1.0" encoding="UTF-8"?>
    3. -<manifest package="com.helloandroid.android.newsdroid" xmlns:android="http://schemas.android.com/apk/res/android">
    4. -<application android:icon="@drawable/icon">
    5. -<activity android:label="@string/app_name" [COLOR="Navy"][B]class=".FeedsList"[/B][/COLOR]>
    6. -<intent-filter>
    7. <action android:value="android.intent.action.MAIN"/>
    8. <category android:value="android.intent.category.LAUNCHER"/>
    9. </intent-filter>
    10. </activity>
    11. <activity android:label="@string/url_editor" class=".URLEditor"/>
    12. <activity android:label="@string/articles_list" class=".ArticlesList"/>
    13. </application>
    14. </manifest>
    15.  
    Bolded and made blue the most likely culprit
     
  3. qxc

    qxc Lurker
    Thread Starter
    Rank:
    None
    Points:
    5
    Posts:
    5
    Joined:
    Apr 26, 2011

    Apr 26, 2011
    5
    0
    5
    What's the android manifest? How would I check if I have a default activity setup correctly or not? I'm mostly just following an old tutorial and havn't done much android before this.
     
  4. TzaGear

    TzaGear Lurker
    Rank:
    None
    Points:
    5
    Posts:
    5
    Joined:
    Apr 26, 2011

    Apr 26, 2011
    5
    0
    5
    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.
     
  5. qxc

    qxc Lurker
    Thread Starter
    Rank:
    None
    Points:
    5
    Posts:
    5
    Joined:
    Apr 26, 2011

    Apr 26, 2011
    5
    0
    5
    Posted my manifest
    Code (Text):
    1.  
    2. <?xml version="1.0" encoding="utf-8"?>
    3. <manifest xmlns:android="http://schemas.android.com/apk/res/android"
    4.     package="newsDroid.com">
    5.     <application android:icon="@drawable/icon">
    6.         <activity class=".FeedsList" android:label="@string/app_name" android:name="FeedsList">
    7.             <intent-filter>
    8.                 <action android:value="android.intent.action.MAIN" android:name="Main" />
    9.                 <category android:value="android.intent.category.LAUNCHER" android:name="Launcher" />
    10.             </intent-filter>
    11.         </activity>
    12.         <activity class=".URLEditor" android:label="@string/url_editor" android:name="url_editor"/>
    13.         <activity class=".ArticlesList" android:label="@string/articles_list" android:name="@string/articles_list" />
    14.     </application>
    15. </manifest>
    16.  
    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!
     
  6. TzaGear

    TzaGear Lurker
    Rank:
    None
    Points:
    5
    Posts:
    5
    Joined:
    Apr 26, 2011

    Apr 26, 2011
    5
    0
    5
    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.
     

Share This Page

Loading...