I've come to a point in my development where it's about time I test the app on an actual device and so I a trying to do that on my old HTC Hero.
I've followed the instructions on the developers website for android at this link: http://developer.android.com/training/basics/firstapp/running-app.html and everytime I go to 'Run' the app it tells me there is "No active compatible AVD's or devices found. Relaunch this configuration after connecting a device or starting an AVD."
When I look at the setup of the app it's configured for Android 2.1 (api 7) and the HTC Hero is Android 2.1 (update-1). I have gone into settings>Applications>Development on the phone and set it to allow debugging through USB.
Therefore I am really struggling to find out how to fix this.
Make sure the phone is set to file mode (e.g. you can open it as if it were another disk drive). Some modes can prevent adb from picking it up. If it were a version problem, Eclipse would say that, it wouldn't just not show any device.
To rule out it being a config issue in eclipse, you should be able to call 'adb logcat' in command line (find adb in your android-sdk directory under platform-tools/adb.exe) and it should spit out the log for your phone (and not say something like 'waiting for device').
Finally, you may need specific drivers for some phones (e.g. HTC Sync). If you're on linux, you can setup udev rules for it http://developer.android.com/tools/device.html#setting-up
Related
I am using a brand new xamarin.forms solution generated with the flyout shell template in VS 2022 community edition.
When I open the emulator and follow the first time setup, where it generates a common android device I get this error when trying to launch the emulator. I also get this error when creating a device myself.
Unknown AVD Name Error <- This part has been fixed by setting the ANDROID_SDK_HOME variable to the correct directory in the Environment Variables in system settings. But the emulator can still not be used for debugging.
I have tried looking around for solutions on all sorts of forums to get the emulator to work, but didn't find anything that made a difference.
I have tried running on a local device using USB instead as it was suggested that it was easier to get to work then the emulator, which didn't work either. The device does not show up in the Android Emulator drop-down menu. I then tried different cables and it still did not show up as a detected device.I then tried via wireless connection just in case something was up with the cables. It still doesn't show up. But if I check the devices through the adb command prompt I can see the device is connected and authorized, both when using the cable and when using the wireless connection. And the computer itself detects the device just fine.
The Device is in developer mode.
USB debugging is on.
The computer is approved as a trusted device.
Android project is set as start up project.
SDK's and tools have been downloaded using the Android SDK manager.
USB drivers have been downloaded for the device.
I have already tried
closing and opening VS multiple times.
Unloading and reloading the project.
Setting the device to PTP mode instead.
Reinstalling VS including deleting and regenerating the Java and Android folders.
Uninstalling VS 2022 and trying 2019 instead.
Generating a new VS solution.
downloading and installing the JDK manually.
Seeing that Virtual emulation is on in the BIOS.
Making sure the system is able to run Hyper-V and that it is on.
checking that the folder paths are set correctly in the options menu.
Making sure all nuget packages are up to date.
Any suggestions would be highly appreciated as I cannot debug and test the device properly at the moment.
If you see an error about a failure to install the APK on the emulator or a failure to run the Android Debug Bridge (adb), verify that the Android SDK can connect to your emulator. To verify emulator connectivity, use the following steps:
Launch the emulator from the Android Device Manager (select your virtual device and click Start).
Open a command prompt and go to the folder where adb is installed. If the Android SDK is installed at its default location, adb is located at C:\Program Files (x86)\Android\android-sdk\platform-tools\adb.exe; if not, modify this path for the location of the Android SDK on your computer.
Type the following command:
adb devices
If the emulator is accessible from the Android SDK, the emulator should appear in the list of attached devices. For example:
List of devices attached
emulator-5554 device
If the emulator does not appear in this list, start the Android SDK Manager, apply all updates, then try launching the emulator again.
Update:
you can open the Android Device Manager first.
Select the device you want to run and click the Start button, so that the virtual machine can be started and detected, and then your virtual machine The device will be added to the Android Emulators menu.
I ended up wiping the hard-drive and starting from scratch. This time all I had to do was install VS and enable Hyper-v and everything worked as it should right away.
I have absolutely zero idea what caused this issue, but a complete wipe fixed it.
I'm (very) new to Android development, and am trying to test my app on my Nexus 5X. I've previously done it successfully, on the same 5X, with the same version of Android Studio on the same computer, so I'm not sure what's changed.
With the phone connected via USB to my laptop running Linux Mint (18.1), in the 'Select Deployment Target' screen in Android Studio (v2.3.1) under 'Connected Devices', I see a single entry:
00b9xxxxxxxxcb26 [null]
(that's a full ID, but I'm not sure how sensitive it is as a value, so am being conservative).
I'm sure previously here it said "Nexus 5X" or something similar.
If I try to deploy to that device it fails, with an error saying:
Session 'mobile': Error Installing APK
No message appears on the phone, which definitely has USB Debugging enabled.
There's nothing in the Android Monitor tab, and the Event Log just shows:
21:42 Executing tasks: [:mobile:assembleDebug]
21:42 Gradle build finished in 661ms
21:42 Session 'mobile': Error Installing APK
I've tried updating Android Studio (I was previously on 2.3, and the same happened), restarting the phone and Android Studio. The app runs successfully in a Nexus 5X emulator.
I can't think of any other useful information that might be relevant, except that I'm connected USB-C to USB-C, but I'm pretty sure that was how I connected the phone before, I can try USB-A to USB-C tomorrow, but don't have that cable available right now. Any other thoughts?
Possible solutions:
disable USB debugging and re-enable it again
check the cable - if it's not the cable, connect the phone directly to the computer, without using any hub or anything
stop adb deamon: adb kill-server, and then remove the .android directory in your home directory - this will remove the debug keys *
removing your debug keys and restarting adb should make appear a confirmation dialog on your android device when you connect it
Adding a new answer, because although Adam Szewera and A. Petrizza's answers helped get me there, neither of them quite includes the key problem.
That was that I'd changed the 'Use USB to...' option, which appears as a notification when you plug the phone in to a computer to 'Charge this device'. Changing it to 'Transfer files' immediately fixed the problem, and now I see "LGE Nexus 5X ..." in Android Studio, and can deploy to it as before.
Thanks both for your pointers which got me thinking straight :)
Plan A.
You need to make sure the cord that is plugged into the computer is used for data transfer and not just for charging your device!
Go to your phone's settings and make sure that the developer settings are turned on (my phone tends to turn this off randomly sometimes).
If all else fails try the good ole' phone off and back on again.
Plan B.
go to Run
Click on Edit Configurations
Select the project
find the Target Device section under the General tab on the Android Application page.
I have recently bought a HTC Nexus 9 tablet for the purpose of USB debugging in Android Studio. This process works on other computers at university but I cannot get it to work properly from my home system,which is what I require. I have tried every single suggestion I have came across online but none have actually worked.
Steps Tried:
Downloading the latest google USB Driver
Installing it through Android Studio and Manually in device manager
Tried ADB Interface Driver and ADB Composite Interface Driver
Configuring driver inf file by adding hardware ID's
Ensuring usb debugging is enabled on the device
Using different USB ports,3 different cables
Tried connecting in PTP mode,MTP mode,charging only mode
Rebooted device and computer
Re installed android studio
No matter what I do,the device wont be shown in android studio or ADB.exe(under list all devices in terminal,also tried start and kill server). I am officially out of ideas,if anyone could figure this out I would be forever grateful!
I have attached some images of some of the things I have tried without success. Once driver has been installed it is listed as "Android Composite ADB Interface" or "Android ADB Interface". Operating system is Windows 7 64-bit
Device on first plug in
Picking a driver
Download HTC PC suite from following link ,install and give a try
http://pc2.software112.com/getfreesw/231109-1805719/htc-pc-suite-07.html
I personally have had many issues with setting things up for Android. Things you should ensure you do include;
Ensure you obtain the appropriate packages in the SDK manager - for example, I wasn't able to make logcat work when debugging with my phone until I downloaded the files for my specific version of Android (so the API files for a Nexus 9).
I believe you may also have to download drivers for your actual phone to allow connection - you should be able to download this from the HTC website. This might be what you need, although I haven't checked it out, and I cant find where I downloaded my drivers from;
http://forum.xda-developers.com/showthread.php?t=2217396
In general, you want to download lots of things from the SDK manager as you'll need them anyway, so don't hold back on just downloading them.
For those (like me) who is still concerned with this issue. You need to go to win+pause break ->Device Manager->Find "AdbInterface" with exclamation sign->Update driver->Search manually->Specify USB driver downloaded from SDK and enjoy: C:\Users\username\AppData\Local\Android\Sdk\extras\google\usb_driver
So, I'm just trying to get into Android development and trying to setup my system with eclipse so I can run through the tutorials and whatnot to familiarize myself with the ecosystem. I'm running this on Ubuntu 12.10 (amd64) with eclipse version 3.8. I've run into a couple issues/questions with the initial setup and I'm not sure what to do about them...
1 - I don't seem to get the "adb devices" command to see any devices. I have both a Verizon Galaxy Nexus and a Nexus 7 tablet connected to my system and nothing is seen. I tried adding a couple Vendor IDs to the adb_usb.ini file, but that doesn't seem to have done the trick. The two IDs I added are "0x4e41" and "0x18d1" - I thought the latter was the "Google" device ID, but I'm obviously mistaken somewhere.
2 - I don't have anything configured under the "Run" button and I'm not sure how to configure running apps through the AVD emulators or through a device. I'm pretty sure I'm not going to be able to run any apps through my devices since adb isn't seeing them, but I do have a 4.1 AVD setup, which should be able to run any apps created. How do I configure the Run button to push the app through the emulator? Does it need to be started first or can it start the emulator and push the app automatically? Also, once I resolve the issue above in part 1, how do I configure the Run button to send apps to either of my devices?
Any/all help would be much appreciated. Thanks in advance.
EDIT: As both comments up till this point have mentioned using the Run menu, but I don't seem to have the same Run menu as either of you. The only thing I have under the Run menu is
"External Tools", then under that is
"Run As" (which is a sub-menu with nothing under it - I assume since I've not configured anything),
"External Tools Configuration..."
"Organize Favorites...".
I'm not seeing anything relating to "Run Configurations" at all.
EDIT2: I just tried adding the udev rules file as mentioned in the "Using hardware" page on d.android.com and that doesn't seem to have had any affect (even after reboot). Still not able to see any devices in "adb devices". And, yes, my devices both have USB debugging turned on.
EDIT3: Seem to have gotten the devices to show up in the adb devices listing, but still not sure how to load the apps onto them automatically. Also, I tried running the "ant debug" command listed on http://developer.android.com/training/basics/firstapp/running-app.html and I'm getting an error of:
Buildfile: build.xml does not exist!
Build failed
Not sure what should be in the build.xml file as this is just supposed to be the tutorial app.
Usb does not need to be set up on ubuntu
you may need to switch adt from stable to beta see notes - that may work
reinstalling does not work.
I did the upgrade and adt broke completely - fails on WST or something like that.
Have a look at the tutorial at http://developer.android.com/tools/device.html
First make sure that you have the USB drivers. Make sure your Nexus device is set up for development. Load your drivers. It may be necessary to restart Eclipse to ensure that your new config takes effect.
You can start your AVDs through the AVDManager, or from Eclipse. Go to Run-> Run Configurations to set up which device to send apps to, or which emulator to start up.
1) Have you set your Application to debuggable? Also, don't forget to set your device up to USB Debugging mode.
Then try this at the terminal:
cd android-sdk-linux/platform-tools/
su
killall adb
./adb usb
2) Go to Run > Run Configurations > Target tab > Select your 4.1 AVD (on Automatically pick compatible device) and hit run. After that you will just have to click on run do test your app.
I want to run my Android Project iwrote with emulators on my Android Device. The Device is Connected on an USB-Port. When I start the "Android Device Chooser" nothing happens. No running device in the "Choose a running Android Device"-Table is displayed.
I tried to reboot the system(PC and Smartphone) while connecting. I tried every USB mode. I tried another Device( G1 and HTC Desire). Unknown Source is always true.
I tried another Eclipse-Version(64 and 32 bit), tried another SDK(64 and 32 bit) and reinstalled the android sdk.
I still can't see any device. Everything worked fine on my old 32 bit system. Now i have to work with my 64 bit lenovo. (both windows 7)
somebody got another idea?
Thank you.
Fabian
See this link for detailed info: http://developer.android.com/guide/developing/device.html#setting-up
In short, you have to:
Mark your app as debuggable (in Manifest)
Allow USB debug on your device (Settings->Application)
And, if developing in Windows, download drivers.
Try command line "adb devices" to see if your phone is detected ok. Except limited number of phones supported by Android by default, manufacturer-supplied setup needs to be used to start usb mode. In my case, Vodafone 845, setup was contained in phone storage. So after phone was detected as normal usb storage, I located that utility and simply ran it. Then it started to be detected as android phone.
The easiest way to this dilema i found here. If you are on windows,
Make sure you have install the google usb driver
Ensure USB Debugging is enabled.
download the adbdriver setup from http://adbdriver.com/downloads/
just follow the wizard and install, automatically it should see your device or you try restarting android studio.
Enable USB Debugging :
Setting - About Phone - Tap Build Number 5 times.
Then go to : Setting - Developer Options - Turn On Usb Debugging.
Download and install Wondershare Mobile Go / Snappea. That program will download and install your android device.
If this popup appears, click allow.