Missing AVDs during debug in Eclipse - android

I'm developing a widget with the following Sdk settings in AndroidManifest.xml:
<uses-sdk
android:minSdkVersion="8"
android:targetSdkVersion="15" />
I've defined some devices with android 4.0.3 (Intel), some with 2.3.3 (both Arm and Intel) and I have also a physical device at 4.0.4:
When I try to debug my widget app, the only available devices (running or that can be started) are the devices at 4.0.3 and 4.0.4. I tried to manually start from AVD Manager one of the devices at 2.3.3 and then it showed up in the list of the running devices, but with a red X that (I think) means there is some problem:
I can debug then the app on the 2.3.3 device, but I'm experiencing some problems (not yet investigated)... Can you tell me a possible reason for AVDs not showing up in the debug window?
If I create another blank project with targetSdkVersion=10 all the devices are shown, but they should be shown also in my project, given the minSdkVersion="8", right?

The AVDs aren't showing up in the "Choose a running Android device" panel because they haven't started yet. You need to manually start the AVDs on your computer to run your app on them. Another option is to have it set up to start an AVD automatically when you want to run the app and no devices are connected, but that can get in the way sometimes.
Also, the red X there is usually because you're building for an Android version that's above the version that the device is running.

I had the same problem. The only thing that helped was an upgrade of ADT/SDK. If you do want to test your app, start the emulator in the AVD manager and wait for it to start up. Then you will be able to select it when pressing "run".
The red X is not a problem. It just means that it doesn't meet the build target of the app. Which... if you are developing, you should be targeting the highest version.

Related

Virtual Machine not running over genymotion(stuck on initialization tab)

I just started android studio for learning purpose, it has been about a week that I am unable to setup android studio properly to run.
However I tried every possible solution to make it run, which includes
Setting up SDK properly
Setting Virtual Devices to low resolutions
Went for genymotion to make it run
Setup AVD properly according to what i seen on this site
Therefore, now switching to Genymotion and setting up all the things properly(e.g Virtual device path, Making Virtual Device), I'm unable to make it run through Android Studio. When i open Genymotion Device Manager(through Android Studio), there is device present which i created in Genymotion, after that when I hit Start button it just stuck on the following "initializing VD" tab
I have waited for this to complete for 3 hours.
What should i do now?
Turning the Virtual Device ON from Genymotion and running it directly from "run selected configuration" from android device worked for me. However turning device on through genymotion device manager still doesn't worked but I made my app run anyhow. Thanks
There used to be a bug in Android Studio startup script (caused by the way it setup the LD_LIBRARY_PATHvariable, see https://youtrack.jetbrains.com/issue/IDEA-171503). This has been fixed in Android Studio 3.1. If you are using an older version, updating should help.

Unable to select my Android device when running project in Eclipse

I'm trying to develop an Android app using the Eclipse IDE and I want to debug using my physical Moto X (2nd gen, Android version 4.4.4). I thought it was as easy as turning on USB debugging on the phone, plugging it into my macbook (OS X Yosemite 10.10.1), running my Android application from eclipse, and selecting my device.
However when the device chooser dialogue comes up, it doesn't show my moto x in there. It shows all the Android Virtual Devices I have set up, but nothing under running Android device. What's particularly mind-blowing about this to me is that I can clearly see my device in the eclipse device view as online. I can also see it by going into the sdk folder and running adb devices. The only time to doesn't show up is when I try to run the application and select what to run it on.
Has anyone ever encountered this problem before? Is there something here I'm missing? I have the latest Android SDK all up to date, as well as my Eclipse (I'm running Juno if that matters). My Min SDK version is 11, and the Target is 21, so my device should be in that range. I have also tried restarting the device, eclipse, and even my macbook with no luck.
If you are on Yosemite, try to drag corner of one of the column headers in the device chooser box and it will show the device. This is a hilariously stupid bug on eclipse for Mac. Check this answer.
There might be something wrong with eclipse. Sometimes the only solution to fix eclipse is to redownload a fresh copy of ADT from website.
You say that you can see your device when you run adb devices.
In this case use eclipse to build your project then use adb to install the apk on the phone:
adb install /path/to/projectRoot/bin/myBuild.apk
Better yet I would take this as a sign to forget Eclipse and move to Android Studio. Version 1.0 was released today (no more beta).

Genymotion devices not working in Eclipse on OS X Yosemite

I updated from Mavericks to Yosemite and now I can't use any Genymotion device anymore.
You can see the devices in Eclipse, but when you want to run an application you can't select one of these devices.
I've already re-installed Eclipse, Genymotion and Virtualbox...
The Genymotion Virtual Devices Manager shows a Nexus 5 which is stated 'On'
When I want to run my application, there is no Nexus 5..
This is a bug in eclipse - OSX yosemite, what you need to do is in the Android Device Chooser Window, try to RESIZE THE SERIAL NUMBER TAB and you will see the genymotion emulator that is running
If you don't see it, or the Android Device Chooser Window doesn't appear, check three things before running again:
Developer Options is enabled from settings (by repeated touching 7
times the build number in about phone), even though developer
options is available in the list of apps in genymotion emulator
In Settings>Security, make sure "Unknown Sources" is enabled
Go to Run Configuration (for Android app), select the Target Tab, Enable Always prompt to pick device and hit apply.
Additionally I downloaded the jar files from Genymotion Download Page manually and replaced it in the plugin folder of eclipse.
EDIT
FYI, a bug has been opened in AOSP's issue tracker.
Issue 78436: [ADT/Eclipse] Cannot see my device in the Android Device Chooser dialog even though it is there in the Devices view
At bottom of this page, there is a link to 'Vote for this issue' ...
I can resolve this problem by connect a real device one time.
Please scroll down and see list of devices which is connected to ADB.
I had a similar issue, but my problem was that the emulated device was running Android 4.3 (SDK version 18), but the app had android:minSdkVersion="19" so since no compatible device was found the list was empty.
Double check your emulated device version, and the minSdkVersion number, to make sure it's compatible.

Can't get Eclipse to build and run app on Galaxy Note 2

I've followed all the instructions at http://developer.android.com/training/basics/firstapp/running-app.html to make a "hello world" app, but despite everything I try, nothing is happening on my device.
I've installed Samsung Kies for what it's worth, and my phone is detected by the OS for file transfer... but when I "Run As - Android Application" in Eclipse, nothing happens at all.
USB debugging is on for my phone.
Edit (June 7, 2013):
I've removed my old installation of Eclipse and the android SDK and downloaded the bundle from http://developer.android.com/sdk/index.html. Still nothing will happen when I try to run as Android Aplication.
I've run adb devices and I get the following output, so I guess my phone is detected:
List of devices attached
42f78b1517259fe5 device
I managed to find a way to add a device to Eclipse, as Galaxy Note 2 wasn't in the dropdown box... but that doesn't seem to do anything other than change the preview image in the activity editor.
I'm not sure if I did it right, but here's the logcat -d dump as suggested
http://pastebin.com/fmrPn3UU
My phone is running 4.1.2. I don't know what else to try, and I can't seem to find out anything else online.
Try forcing Eclipse to prompt you for a device to choose. See if it still does nothing, or if it actually runs.
To allow Eclipse to prompt you:
Open the Run menu > Run configurations
Within the new window, under the Android Application
If you have any configuration, delete the configuration
Create a new configuration by double clicking Android Application or clicking the New button.
Under the Android tab
Select your Android app project within the Project box
Launch action should be Launch Default Activity
Next, open the Target tab
Select Always prompt to pick device
Click Apply
Click Close
Now the next time you run your application, it will ask you to start your application in your phone or an emulator.
If you want to use the same one for the duration of your eclipse session, or until you've unplugged your phone, check the Use same device for future launches box.
This also has the added benefit of allowing you to choose different AVD versions to test your app on different devices or emulators easier.
Update from comments
To force stop your app if completely necessary
Go to the DDMS perspective within Eclipse
Window > Open Perspective > DDMS (it's it not listed, click Other...)
Click your process such as com.example.testapp
Click the Stop button (red stop sign)
I think your question is
Q: "Should I be able to run and debug my Android application on a physical handset, not just the emulator?"
A: Yes, absolutely. Including your Galaxy Note 2
Look here:
http://developer.android.com/tools/device.html
This is basically exactly the same, except it gives details specifically for the Galaxy Note:
http://www.technipages.com/samsung-galaxy-note2-how-to-enable-usb-debugging.html
BOTTOM LINE:
You should be able to debug using either/both an emulator and/or a physical handset, all from your Eclipse IDE.
'Hope that helps..
Try using the Galaxy Note 2 toolkit from XDA and installing the drivers that way, then manually set up your device in Eclipse.
Try looking at your AndroidManifest.xml file in your Android project. I believe your note 2 is running Android 4.1.2 (which is revision 16).
If your Hello World application has the minimum SDK version requirement set to be 17 or higher, your device will not be recognized on the available devices. Change android:minSdkVersion attribute in uses-sdk tag to android:minSdkVersion="16" and it will be displayed.
In 'USB PC connection' in the floating menu there are two options. In my cell was labeled 'Media Device' and I switched to 'Camera' and started to work.
I got the same problem. I am using MAC. I downloaded Eclipse(Java Standard 4.4) first and then installed ADT from eclipse manually. My code works and it can only run in emulator. It cannot find the Note2. I install Android Studio and it works with my Note2. Tried many methods but my eclipse cannot find my Note2. so I download the Android ADT from android.com directly and it works with my Note2. Since we can have two Eclipse on one computer, so it you can keep both Eclipse like me. One for PHP and one for Android. If you have the same problem, please try it.

how to test my 2.1 android application on 2.2 device?

i have made an android application using android 2.1. i want to test how my application will behave on a device with android 2.2 and 2.3. How do i test it in eclipse. i do not have any real devices to test my application.
In eclipse, if i make an emulator with 2.2 , it does not list up in my application run configration. what i mean to say is that eclipse is not allowing me to run my 2.1 app on 2.2 device. how do i test my application on an emulator?
thank you in advance.
Launch the emulator in which you have to test the application. Wait until the home screen is ready.
then run the application it will load it in the emulator currently running.
You have specify the following line in emulator,
<uses-sdk android:minSdkVersion="7" />
You should be able to run your application on any device (emulator or physical) that has a version greater than the one specified in your manifest minSdkVersion attribute.
Note that you can also run an application compiled with a greater SDK version on an older emulator (again, the minSdkVersion attribute should be having a proper value). This way you can test support for the newest features without crashing on the older platforms.
The previous answers are both good. To be more specific, start your 2.2 emulator by going in "Window" -> "Android SDK and AVD manager", select the emulator you want to test on and press Start.
After the emulator finished loading run your project with "Run Configurations...", select "Manual" deployment in the "Target" tab and after you press Run you should be able to select the emulator from a list of running Android devices.
Hope this is clear enough.

Categories

Resources