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

Apps Newbie question - app not running in AVD?

Discussion in 'Android Development' started by horseman_uk, May 8, 2012.

  1. horseman_uk

    horseman_uk Newbie
    Thread Starter
    Rank:
    None
    Points:
    16
    Posts:
    25
    Joined:
    Apr 25, 2011

    Apr 25, 2011
    25
    1
    16
    Hi all,

    Firstly, thanks for any help anyone can offer me with my foray into Android app development. I've been a Java developer for many years although I've been in management circles in recent years so a little rusty.

    I've got Eclipse (Indigo) installed and I've used Eclipse extensively in the past so nothing too new to me there. I've installed the Android SDK and all the associated packages via the SDK Manager. All the icons have appeared in Eclipse and I can start an Android Project so it all looks good. I've created two AVDs - one 4.0 and another 2.1.

    The trouble I'm having is getting my app (ANY app) to run in the AVD. I've followed a number of tutorials on how to do this and they are all very similar. I create a Run Configuration naming my Project and the default activity (created at the same time I created the Project) and associated it with one of the AVD (appropriate to the Project version.)

    The AVD starts and eventually I get the full Android home screen, as expected, but that's it. Nothing else. I've watched a video on YouTube showing what should happen and my console output isn't the same. I don't get the bit about installing the apk.

    This is the console output:
    [2012-05-08 11:05:49 - MyFirstDroid] ------------------------------
    [2012-05-08 11:05:49 - MyFirstDroid] Android Launch!
    [2012-05-08 11:05:49 - MyFirstDroid] adb is running normally.
    [2012-05-08 11:05:49 - MyFirstDroid] Performing com.burmania.MyFirstDroidActivity activity launch
    [2012-05-08 11:05:50 - MyFirstDroid] Automatic Target Mode: Preferred AVD 'API7_AVD' is not available. Launching new emulator.
    [2012-05-08 11:05:50 - MyFirstDroid] Launching a new emulator with Virtual Device 'API7_AVD'

    I've left the AVD for a number of HOURS as I've read that it can sometimes take a fair while to launch but after five hours nothing has changed.

    Can anyone help me with this or point me in the right direction?

    Thanks for your help!!
     

    Advertisement

  2. jonbonazza

    jonbonazza Android Expert
    Rank:
    None
    Points:
    163
    Posts:
    1,930
    Joined:
    Jul 13, 2010

    Jul 13, 2010
    1,930
    457
    163
    Male
    I have actually experienced a similar problrm on occasion with the newest adt build, but simply closing out the emulator and relaunching it usually fixes the issue. Other than that, I'm really not sure what advice to offer.
     
  3. horseman_uk

    horseman_uk Newbie
    Thread Starter
    Rank:
    None
    Points:
    16
    Posts:
    25
    Joined:
    Apr 25, 2011

    Apr 25, 2011
    25
    1
    16
    Thanks for your reply but after a number of shutting the AVD down and bringing it back up it's still not working. I'm kinda lost without knowing where to start looking without investigating how to deploy manually onto AVD but that doesn't feel like the right way to do it.

    No point in having a useful IDE if I'm not going to use it properly...
     
  4. horseman_uk

    horseman_uk Newbie
    Thread Starter
    Rank:
    None
    Points:
    16
    Posts:
    25
    Joined:
    Apr 25, 2011

    Apr 25, 2011
    25
    1
    16
    This is driving me absolutely bonkers. I've re-installed everything following the steps on here and I'm getting exactly the same issue. If I run the AVD through AVD Manager and then start my project via Eclipse then a second AVD is launched with warnings about "changes will not be persisted" because the SD image is already in use (from the AVD manager version that is running.) Still not a single mention of the package being uploaded anywhere in Eclipse console.
     
  5. wubbzy

    wubbzy Well-Known Member
    Rank:
    None
    Points:
    63
    Posts:
    109
    Joined:
    Dec 19, 2011

    Dec 19, 2011
    109
    32
    63
    *nix kernel's by day
    Silicon Valley
    not sure but maybe it will help. Adb is located in android sdk platform-tools dir

    adb kill-server
    adb start-server

    Long time to start could mean memory pressure, keyword is "could" not sure it is the case with you. What kind of dev env have you? win, os x, linux....
     
  6. horseman_uk

    horseman_uk Newbie
    Thread Starter
    Rank:
    None
    Points:
    16
    Posts:
    25
    Joined:
    Apr 25, 2011

    Apr 25, 2011
    25
    1
    16
    Thanks for the reply, Wubbzy.

    It's definitely not my machine that's slow - AMD Athlon II X4 645, 8GB 1,333Mhz RAM, 2TB HDD (128GB SSD for OS), Windows 7 Ultimate 64-bit.

    Every time I try to run the project from Eclipse it wants to start a new VMD and I'm still not getting any messages about packages being installed/deployed to the VMD. I've tried using a different version of Eclipse but it doesn't make any difference.

    I'm not entirely clear on what the adb does but it doesn't list any devices attached regardless of what is happening. :/
     
  7. wubbzy

    wubbzy Well-Known Member
    Rank:
    None
    Points:
    63
    Posts:
    109
    Joined:
    Dec 19, 2011

    Dec 19, 2011
    109
    32
    63
    *nix kernel's by day
    Silicon Valley
    so the next question would be what are config parameters in AVD. Mine look like, though I must admit I very rarely use it (double click on avd to find out):

    Name: Andy
    Target Name: Google APIs( Google Inc.)
    Platform: 2.1
    API Level: 7
    CPU/ABI: ARM (armeabi)
    SKIN: WVGA800
    hw.mainKeys: yes
    hw.gps: yes
    hw.icd.density: 240
    disk.CachePartition: yes
    vm.HeapSize: 24

    I have Sun Java version 1.6 SDK with Eclipse Indigo

    Option#2 would be "try" starting AVD from command line, this page describes how to

    Managing AVDs from the Command Line | Android Developers
     
  8. horseman_uk

    horseman_uk Newbie
    Thread Starter
    Rank:
    None
    Points:
    16
    Posts:
    25
    Joined:
    Apr 25, 2011

    Apr 25, 2011
    25
    1
    16
    C:\Users\Richard>java -version
    java version "1.7.0_04"
    Java(TM) SE Runtime Environment (build 1.7.0_04-b20)
    Java HotSpot(TM) 64-Bit Server VM (build 23.0-b21, mixed mode)

    Name: Blah
    CPU/ABI: ARM (armeabi-v7a)
    Path: c:\Users\Richard\.android\avd\Blah.avd
    Target: Android 4.0.3 (API Level 15)
    Skin: WVGA800
    SD Card: 1024M
    hw.lcd.density: 240
    hw.cpu.model: cortex-a8
    vm.heapSize: 48
    hw.ramSize: 512

    Eclipse Java EE IDE for Web Developers.
    Version: Indigo Service Release 2
    Build id: 20120216-1857

    Will try starting AVD from command line in a bit.
     
  9. horseman_uk

    horseman_uk Newbie
    Thread Starter
    Rank:
    None
    Points:
    16
    Posts:
    25
    Joined:
    Apr 25, 2011

    Apr 25, 2011
    25
    1
    16
    Are you sure that you can start an AVD from the command line? The 'android.bat' only creates/deletes/updates AVDs and doesn't appear to 'start' or 'stop' them.
     
  10. wubbzy

    wubbzy Well-Known Member
    Rank:
    None
    Points:
    63
    Posts:
    109
    Joined:
    Dec 19, 2011

    Dec 19, 2011
    109
    32
    63
    *nix kernel's by day
    Silicon Valley
    Though I did look at requirements page and must admit dev's visit that page probably once or twice during in their lifetime :)

    System Requirements | Android Developers

    This page talks about JDK 6 and not JDK 7. Try switching back to JDK 1.6x. Maybe this is your devil.

    Other misc stuff:

    From my bookmarks: (Though must admit I personally have never tried it, but last year I came across this). How do I launch the android emulator from the command line? - Stack Overflow

    Would it be possible to disable cpu modeling? i.e. take the hw.cpu.model line out. Though I somehow feel you'd have give that a shot already :), remove SD card allocation, use standard (get it to work and then incrementally add stuff back in)
     
  11. horseman_uk

    horseman_uk Newbie
    Thread Starter
    Rank:
    None
    Points:
    16
    Posts:
    25
    Joined:
    Apr 25, 2011

    Apr 25, 2011
    25
    1
    16
    Well, I've had an interesting outcome. I uninstalled Java 7 and put 6 on and... it still didn't work. I've pretty much tried uninstalling and reinstalling everything over and over again but nothing has worked.

    So, as they say, if you do the same thing over and over again you can only expect the same result over and over again. Time to try something new. I created a virtual machine in Virtualbox running Windows 7 and without installing anything except what was absolutely necessary (OS, updates, Java 6, Android SDK, Eclipse) and... it worked straight away. Up popped my test app on the screen of the AVD - a virtual machine running in a virtual machine.

    Clearly something in my main system is getting in the way but at least I appear to have a way forward. If I really can't figure out what's going on I'm going to have to re-install Windows on my machine but that's no biggie, I do it all the time. :)
     
  12. wubbzy

    wubbzy Well-Known Member
    Rank:
    None
    Points:
    63
    Posts:
    109
    Joined:
    Dec 19, 2011

    Dec 19, 2011
    109
    32
    63
    *nix kernel's by day
    Silicon Valley
    ah bummer...at least you get consistent results :)
    I'm glad that at least you found one way to work with it (or around it)
     
  13. horseman_uk

    horseman_uk Newbie
    Thread Starter
    Rank:
    None
    Points:
    16
    Posts:
    25
    Joined:
    Apr 25, 2011

    Apr 25, 2011
    25
    1
    16
    Thanks for your help, Wubbzy!

    To continue the theme I have completely re-installed my machine and so far my app is being deployed to the AVD. I'm going to keep piling my usual programs on until it stops. If I figure out exactly what was causing the issue I will post it here so that any other poor sole having the same problem might be able to help themselves.
     
  14. horseman_uk

    horseman_uk Newbie
    Thread Starter
    Rank:
    None
    Points:
    16
    Posts:
    25
    Joined:
    Apr 25, 2011

    Apr 25, 2011
    25
    1
    16
    Okay, I've identified what the problem is/was. I use Comodo Free for AV and Firewall and this was causing the problems. Despite clicking "Allow" on every request while it booted the AVD (and there were a lot) it must be blocking something. Strangely, even once I uninstalled Comodo it still didn't work complaining about abd. I had to remove the Android SDK and Eclipse then re-install before it worked again.

    Is anyone else finding that their AV is causing problems with Android development?
     
    wubbzy likes this.
  15. wubbzy

    wubbzy Well-Known Member
    Rank:
    None
    Points:
    63
    Posts:
    109
    Joined:
    Dec 19, 2011

    Dec 19, 2011
    109
    32
    63
    *nix kernel's by day
    Silicon Valley
    interesting find...thanks for sharing. I've known AV's (especially Host Intrusion Detection Kinda like in Symantec's) to screw up things, but not in this context.
     
    horseman_uk likes this.
  16. horseman_uk

    horseman_uk Newbie
    Thread Starter
    Rank:
    None
    Points:
    16
    Posts:
    25
    Joined:
    Apr 25, 2011

    Apr 25, 2011
    25
    1
    16
    After some testing it was definitely Comodo causing the issue and despite trying lots of different things with Comodo I couldn't stop it intefering with Eclipse. I've switched from Comodo to Avira and it's all working fine now. Strange.
     

Share This Page

Loading...