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.
Related
I have an Xamarin project (On a Mac) that I'm working on. Up until today I was able to Launch it under debug, it would deploy the app and start it up attached so I could hit break points on the device. If I do this in an emulator, things work fine.
So when I run in Debug on Android, it deploys, I get no errors or messages that indicate an issue, but it just stops and is no longer running.
So what I've done
I've uninstalled and re-installed Visual Studio, no change
I've tried on multiple devices, with different OS versions
I've reset my project to be the same as others on the team, they have no issue
I've verified that the same project works fine on my Windows machine.
I've verified that I can run a Release version with no problem, I hit run, it deploys and launches the app just fine.
I can deply the iOS version in an emulator with no problems.
I've verified that if I set Debug Information to Full in the Release project, I have the same issue.
I've rebooted the device, the Mac, uninstalled the app on the device, it doesn't matter.
I'm at a loss, any help would be appreciated.
Well, there are a couple of things that connecting and deploying your app require, including setting the configuration and making sure you have the ADB installed correctly. You can check on Mac by following these steps to install Chrome and DevTools.
Another user suggested(in the comments under question):
"I would suggest trying to delete the Mono Shared Runtime and any Xamarin Android API-XX Support from the installed apps" on your targeted device.
These are the docs on Configuration Management in Xamarin
on Microsoft.com
I know it's very late answer but I had same problem and could solve it so may be it could be helpful for over people facing same problem.
Android csproj file must be located two levels lower than the .sln file. Android will disconnect when debugging if it is located in another location.
For example:
C:\Projects\Mobile\My.Xamarin.sln
C:\Projects\Mobile\My.Xamarin\My.Xamarin.Android\My.Xamarin.Android.csproj
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.
I create blank xamarin android project without add any code when i debug this project debugging without problem but when i run app with visual studio emulator for android emulator is running but not starting my app and deploy failed and don't show me error
why ?
please help me
I had the same issue. VS 2015 can launch the VS emulator but can't deploy the app.
I was able to solve the issue like this:
Launch the emulator (F5 in VS, then cancel the deployment using the Build/Cancel menu)
Click on the chevron icon (») in the toolbar to the right of the emulator
Select the Network tab
Locate the preferred network ip address
Back in VS, click on the Open Adb Command Prompt toolbar button
Type adb connect [the emulator ip address]
Press F5 again in VS
Looks like a VS bug to me.
I had the same issue. It turned out the root cause was that the VS Emulator couldn't find adb.exe.
When that happens it won't connect to the emulator unless you do the manual connection following the steps CSharpRocks gives. The emulator also won't be listed under "adb devices".
The fix for me was to reinstall the Android SDK, using the Windows EXE based installer (not the zip installer). The EXE installer sets the HKEY_LOCAL_MACHINE\SOFTWARE\WOW6432Node\Android SDK Tools key, Path value, in the registry, pointing to the Android SDK root directory.
The VS Emulator uses that registry setting (or the Android Studio install registry setting) to find the SDK, assuming you didn't install the Android SDK with Visual Studio itself. With that, it should be able to find adb.exe and work.
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”
I'm having a very similar issue. I have found two different kind-of-work-arounds, but have not yet figured out a full solution.
Start the emulator before trying to deploy to it
Launch the Visual Studio Emulator for Android application from the start menu.
Launch one of the available emulators via the green arrow
Attempt to again launch your application from visual studio, selecting the VS Emulator N-inch... emulator from the drop down menu
For me for some reason the app still doesn't "launch" on the emulator, although it is installed. So I have to open the application menu and select my app. Additionally it will usually crash the first several times I try to open it, but eventually displays my single default label, Welcome to Xamarin Forms!.
Run the application in Ad-Hoc mode
Before running the application, change the solution configuration (from the top toolbar next to the green "run" button) to Ad-Hoc.
The problem with both of these methods though is that I'm still not able to actually debug an application. I can run it, but my breakpoints are ignored and I think that will make finding bugs difficult once I actually start to write a real application.
I hope to update this answer once I figure out an actual solution.
I had the same problem yesterday. The problem appeared (probably) because I tried to start development after a long break. I updated VS and everything, but faced many issues.
Eventually you need to start fresh
Make sure SDK for emulator points to the right place (HKEY_LOCAL_MACHINE\SOFTWARE\WOW6432Node\Android SDK Tools)
Run Visual Studio with Administrator privileges
Go to Hyper-V Manager and delete ALL Virtual Switches - let the system recreate them when needed. It will do it properly
Delete all existing emulators and recreate them in Visual Studio. I even found a comment to name them without spaces - not sure if it is needed, but wouldn't hurt.
Doing all this helped me. But I was on the verge of reinstalling Windows 10 clean. I think lots of things and configuration changed and are no longer compatible.
Try it enabling Hyper-V and using a Visual Studio Emulator from android; that worked for me after a lot of attempts and research
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". This leaves a version of the app on the device which seems to block further attempts at debugging or deploying.
I solved it by starting the emulator, going to "settings -> apps" and manually uninstalling my app. Then the next debug build & deploy worked again.
You could probably also manually start the emulator and say "wipe device" option so it starts fresh.
In VS2017, on a Windows10 machine, all I had to do to get the app to show up was turn off Mobile Data.
(swipe down or use settings, then click Mobile Data and confirm to turn it off).
After I turned it back on, I could access the app. Before doing this, it always seemed that the emulator ran, but wouldn't run the app.
... no idea why this worked, but I'm posting it here in case it helps someone.
During my troubleshooting process, I also looked at these articles:
VS Android Emulator wont run application
Troubleshooting the Visual Studio Emulator for Android
Update Your Path For The New Android Emulator Location
Install apache in VS 2015 here.
Visual studio requires apache to develop android apps.
You also may want to look at some other suggestions:
notshowing, troubleshooting
I had such issues before with the android SDK emulator, now I'm using Genymotion emulator instead of it, it is more light and faster and will be detected automatically by you VS once launched.
you can download the free version from here : https://www.genymotion.com/
and also you can download any device emulator.
Just yesterday I updated Android Studio. Before I updated it everything was working fine, meaning I was able to use my Samsung Galaxy S4 to debug my apps with no problem. After the update, Android Studio no longer sees my device when I try to debug.
Furthermore when I type in adb devices on my terminal (I am using Ubuntu), my device doesn't show in the list of devices attached. Please help! I'm been trying to find a solution but most only talk about reinstalling drivers for Windows users.
Also, not sure if this may help but when I updated Android Studio, I was prompted to move the SDK folder to another location.
Thanks ahead of time!
Google's usb driver is located within the Android SDK folders, so perhaps in moving that, your computer can not find the driver anymore.
Try going to Device Manager (the windows one from the Control Panel), look for your mobile device and choose to re-install the driver, choosing one from your own disk.
It should be located at ~\android-sdk\extras\google\usb_driver
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).