Unable to select my Android device when running project in Eclipse - android

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

Related

Android Studio not connecting to devices

I am having an issue with Android Studio not connecting to any devices. This includes physical devices, as well as emulators. Everything was working, but I updated AS to the latest version, and now it is not working. The devices still show as connected when I use adb on the command line, so I am able to run commands through that. However, I can not run anything from Android Studio, or debug, or use logcat. What could possible be the issue where adb is connected to the devices, but Android Studio is not?
Even using the connection assistant shows that I have a pixel connected, but AS does not recognize it as an android device.
This is for Android Studio 3.6.2, updated recently: Directory 'platform-tools' contains a directory of the same name, and I made the hypothesis that this was a bug and that the lower dir should not the there. Using the Mac Finder, I copied all files and directories from the lower dir to the upper one, I closed and restarted Android Studio, and voila, the Run > Select Device... can see my tablet, and I could run the app on it.
I'm running on a mac with Yosemite. I tried running old versions of Android Studio that were laying around which was a waste of time. So I got drastic.
This is a really bad solution, but has allowed me to actually get back to work.
Completely uninstall Android Studio and the Android SDK (the sdk might have been over-kill, but I'll let someone else figure that out). If you like, here's a website that helps uninstall AS. https://nektony.com/how-to/uninstall-android-studio-on-mac
Re-install Android Studio using an older version. I used 3.5.2 because I liked that color of green better than the new one. The link to find it: https://developer.android.com/studio/archive (you'll have to agree to their terms before being able to even look at the list!).
Run the newly-installed AS. Connect your device (remember to turn dev-mode!)...voila!
Well, it worked for me. And I only wasted 1 day.

Android Studio: Running application in emulator not working

Today I downloaded Android Studio for my Debian Testing system. I wanted to run a HelloWorld application but weren't able to run it. With adb I can install it without having any problems.
However, if I try to do it with Android Studio, it gets stuck on 'Installing APKs'. The same happens when I try to start it in an emulator (gets stuck on 'Waiting for target device to come online').
My device is a Samsung Galaxy S3 with LineageOS (Android 7.1.2) and root permissions. Android Studio recognizes my phone properly.
What I've already done:
installed openjdk
set android_home
installed all the SDK-platforms since Android 4.3 and Android Emulator from SDK tools
enabled USB-debugging
tried with MTP and PTP
tried another emulated phone
installed lib32stdc++6
restarted my computer
and probably much more
I tried to do it the whole evening and couldn't find a solution. Is there something Debian-specific because I can only find instructions for Ubuntu? I have never experienced anything close to this on other systems.
Thank you in advance.
EDIT: I am now able to use my phone to run the android application by using USB 2.0 instead of USB 3.0! Is that a normal behavior since it works with native adb? I mean, if I buy a new PC after some years which has got only USB 3.0 ports, will I not be able to use phone debugging with Android Studio or is this just an issue? It is still known since 2014 (https://stackoverflow.com/a/9548311/8292104).
However, I still cannot get the app running on an AVD. I changed graphics to software, now it shows the phone but the screen remains black and the phone won't start. What can I do to fix it?
Try to completely delete and install Android Studio again, I think that it will solve the problem
Another possible solution that worked for me is to, in the application, go to
app - build - intermediates - split-apk - debug - slices
and then delete all of the contents within this folder. Then again, this only worked for me, so I would duplicate the document in case of corruption.

Xamarin.Android Projects failed to deploy in visual studio emulator for android

I'm using visual studio 2015 update 1 with windows 10 build 10586 TH1.
also I'm using Xamarin Version 4.0.1.96.
I have created a blank Xamarin.Forms app. It deploys to Windows Phone emulators without any issue. But unable to deploy to Android Emulators.
When I start android project Android Emulator launched successfully but visual studio freeze at this step.
I've tried a lot of android emulator profiles but cannot solve the problem.
This problem only exists for Emulators and project successfully deployed on physical android device.
I have the same issue with Xamarin.Android projects.
Here is all of the text in output window:
1>Starting deploy 4.5" KitKat (4.4) HDPI Phone ...
1>Starting emulator 4.5" KitKat (4.4) HDPI Phone ...
1>Validating emulator arguments...
1>Determining if emulator is already running...
1>Preparing virtual machine...
1>Launching emulator...
1>Emulator launched successfully
Thank you in advance for your help.
I was running into the same issue with the emulator starting up find but Visual Studio getting hung on the build/deploy. Finally figured it out from here.
Visual Studio gets stuck trying to deploy the app to the emulator or the emulator does not appear as a debug target in other IDEs
If the emulator is running, but it does not appear to be connected to
ADB (Android Debug Bridge) or it does not appear in Android tools that
make use of ADB (for example, Android Studio or Eclipse), you may need
to adjust where the emulator looks for ADB. The emulator uses a
registry key to identify the base location of your Android SDK, and
looks for the \platform-tools\adb.exe file under that directory. To
modify the Android SDK path used by the emulator:
Open Registry Editor by selecting Run from the Start buttons context menu, typing regedit in the dialog box, and choosing OK.
Navigate to HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Android SDK Tools in the folder tree on the left.
Modify the Path registry variable to match the path to your Android SDK. Restart the emulator and you should now be able to see the
emulator connected to ADB and associated Android tools.
The value in my registry was set to "C:\Program Files (x86)\Android\android_sdk" (or similar). Updating it to "C:\Users\{USERNAME}\AppData\Local\Xamarin\MonoForAndroid\AndroidSDK" solved it for me. (I haven't yet worried about how to make this work for all users.)
I had the same issue but in my case it was not the registry. After doing a release build, I deployed the app to the emulator device in release mode which pushes the app to the device and then effectively "disconnects". These leaves a version of the app on the device which seems to block further attempts at debugging.
I solved it by starting the emulator, going to "settings -> apps" and manually uninstalling my app. Then the next debug build & deploy worked again.
I had the same issue. After a long struggle i fixed it.
Sol 1 :
Check with the registry as mentioned by others.
**HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Android SDK Tools**
Sol 2 :
In my case there is no android-SDK tool found in registry. So you have to add the registry manually here "**HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node**"
you can add it by right click on **Wow6432Node** => **New** => **key**.
Set Key name as **"Android SDK Tools"**then right click on **Android SDK Tools** =>**New** => **String Value**
Set Name as **Path** for newly added string. Then right click on **Path** => **Modify..**
Copy the Android SDK Tools path from program files and paste in Value Data.
Now the registry is created manually. You can debug the project via emulator.
Note : Don't forgot to restart the system.
Have a look here:
Xamarin Forms Android App Crashes Running Debug with VS Android Emulator
Start the Hyper-V manager
Select the emulator you are trying to use
Right-click, hit settings
Click processor
Click Compatibility
Set checkbox “Migrate to a physical computer with a different processor version”
You do not have this issue on a laptop because its processor does not provide the new features which are unsupported by the Android Emulator for Visual Studio. The described tweak is only needed on PCs with newer CPUs.
I got round this problem by starting Visual Studio as an administrator.
I too have had weirdness with the Visual Studio Emulator for Android and visual studio appearing to be stuck at the "Deploying ..." step trying to launch the app for debugging.
What I discovered is that restarting both the emulator and visual studio seems to make things better for me once it starts to do this.
Also, when debugging an app, it seems that exiting your app normally helps compared to when using the "Stop Debugging" button.
For example, I started my app twice and killed it w/ the "Stop Debugging" button, but couldn't deploy/start the app a 3rd time w/out a restart of visual studio and the emulator.
Am using VS 2015 Community edition w/ update 3.
I just had a very interesting experience,
In my case the registry path to SDK was correct,
I had unchecked the "Use Fast Deployment" (under packaging properties in android options), and
all my efforts to reboot the PC, close VS, Close Emulator start over had failed.
However I did these two:
1 - Updated all the components in android SDK manager and restarted the PC,
2 - Disabled my anti-virus! and then suddenly VS deployed the app to the emulator!! (It was stuck in the same situation where the emulator starts and nothing happens!, I did this out of despair!)
(OS: win 7, professional, VS 2017 Community edition!)
More Details
I have been trying this for three more days
For my special case disabling the Anti Virus seems to solve the issue every single time!
The solution for me was to Check the deploy box in the Configuration Manager
This answer came from Xamarin Forum

Android Studio wont recognize Nexus 7 as device

I am having trouble running an app I am developing in Android Studio on my Nexus 7. I have successfully gotten this to work before using the same tablet and computer (running Windows 8), but since having my laptop repaired and everything wiped I'm convinced something with my dev environment is messed up.
When I go to run the project, there are no available devices, so it is not recognizing my Nexus 7 anymore.
Things I have tried
making sure my computer recognizes the device and that I have the Nexus 7 driver installed from ASUS
going to the SDK manager and ensuring I have the Google USB driver installed
closing Android Studio and re opening it, restarting my computer, restarting my Nexus 7
killing adb.exe from the task manager
ensuring I have USB debugging enabled and toggling that on and off
switching from MTP to PTP and back again (currently connected as MTP, not sure if that is correct)
Any help would be greatly appreciated. This is very frustrating and I would like to just get back to developing again.
Update- I just noticed that when I go to developer options, "Wait for debugger" (near where you toggle USB Debugging) is grayed out. I think this has something to do with it but I'm not sure how to enable it.
I got it!
This was at least the issue in my case, I hope maybe this will help someone someday, apparently I had not installed the adb driver properly:
Search for Device Manager from the search bar on the start screen
Open Device manager, click on your Android device
Select"Update Driver Software"
BOOM. Now Android Studio recognizes the device.
I know this may not be the solution for everyone, but its worth a shot if you are having trouble testing apps on your device.
Between upgrading my second-gen Nexus 7 to Android 5.0.x and Android Studio leaving beta I lost the ability to debug on my tablet.
To get this working again I used a combination of the above advice.
I grabbed a copy of the USB Driver from Asus, but updating the Device in Device Manager and pointing to the unzipped files wasn't enough.
The next step was to point Device Manager to the Android Studio sdk directory (on a 64-bit Windows 8 install that was C:\Program Files (x86)\Android\sdk - beta versions of Android Studio - or %localappdata%\Android\sdk - switched to in 1.x) and then things worked just fine again.
Another possible reason that you may not be able to connect is:
Don't forget to enable debugging mode in Android setting.
I have had the same problem, although just getting started with my Nexus 5 and windows 7. I installed google usb driver package using SDK manager first, computer recognized phone but studio could not find it. Went in to manually update driver for phone but update driver couldnt find it, downloaded driver separately and pointed it to directory path, driver installed then studio found it and ran fine.

Android app not running on emulator nor real device

I've installed eclipse (JUNO version), SDK, ADT (20.0.3) and configured them through the Developer.android.com. After that I made a virtual device on eclipse (Android 4.1 API level 16) as well, but when I run the "Hello World" application in eclipse, the emulator is running with out error but the app is not running on the emulator.
There is also the problem with real device. I use Windows 7/64 bit and HTC incredible S phone. When I connect the device to my pc, windows detect it, but eclipse does not detect it. (The USB Debugging is enable on device and USB driver is updated on windows).
I tried different solutions like reinstalling eclpise, SDK and ADT, removing ADV and creating the new one,... but the problem did not solve.
Did u located your android sdk? If not,locate the sdk as follows:
open Eclipse->Windows->preferences->Android->Select your android sdk folder.
then please try to run you program. Tell me the status after that.

Categories

Resources