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.

enter image description here


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.

Mirrana
  • 1,601
  • 6
  • 28
  • 66

6 Answers6

3

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

enter image description here

  • Next, open the Target tab
  • Select Always prompt to pick device
  • Click Apply
  • Click Close

enter image description here

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)

enter image description here

Kirk
  • 16,182
  • 20
  • 80
  • 112
  • I get the following message when I try to run it. Maybe there's something else wrong? An internal error occurred during: "Launching New_configuration". Path for project must have only one segment. – Mirrana Jun 08 '13 at 00:01
  • 1
    Try double checking that the run configuration has the correct project selected. Just a shot in the dark, but I'll add to my answer in a moment – Kirk Jun 08 '13 at 00:04
  • That did it. After I selected my project was selected (it wasn't previously) it now builds on my phone. I have to wonder why it wasn't doing so automatically beforehand. – Mirrana Jun 08 '13 at 00:09
  • Now... how to stop it from running? I can't find a stop button now. – Mirrana Jun 08 '13 at 00:11
  • I'm guessing Eclipse made some broken run configuration for some reason. Even though you've fixed it now, I've added some extra steps if it helps someone. – Kirk Jun 08 '13 at 00:12
  • To stop it, force close it within your phone, or go to the DDMS tab within Eclipse and stop it. You can leave it running as well, unless your app does something weird to your phone. – Kirk Jun 08 '13 at 00:13
  • I've added the steps to force close within Eclipse if it's something you ever need to do. – Kirk Jun 08 '13 at 00:21
1

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:

This is basically exactly the same, except it gives details specifically for the Galaxy Note:

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..

paulsm4
  • 114,292
  • 17
  • 138
  • 190
  • Actually, I know you can - according to the instructions I've been following it says it should work... but I don't know if it's a problem with drivers, or device compatibility, or something else. – Mirrana Mar 21 '13 at 03:05
  • OK - I wasn't clear how much you knew, or how far you got. The next step is 1) exit and restart the IDE, 2) make sure you can select your handset from the IDE (following the instructions, and post back if you *don't* see an entry for your handset!), and 3) post your logcat entries up to/including point of failure/end of logcat. PS: "Samsung Kies" is the correct Windows driver. – paulsm4 Mar 21 '13 at 03:08
  • 1
    I too had this problem. It was not an issue with eclipse, but with ADB not finding the device. It was solved after I updated the driver (Control Panel->Hardware->Device Manager->Portable devices->Note II->Update driver) and then rebooted windows. Of course you must also follow all of the normal steps to set up debugging of the device. – Dorje Apr 18 '13 at 06:47
0

Try using the Galaxy Note 2 toolkit from XDA and installing the drivers that way, then manually set up your device in Eclipse.

chrigist
  • 41
  • 2
  • How do I "manually setup" my device in Eclipse? I couldn't see anything aside from the Android Virtual Device Manager – Mirrana Jun 08 '13 at 00:07
0

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.

0

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.

Alex
  • 1
0

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.

hatted
  • 1,535
  • 1
  • 15
  • 26