When trying out the example code in google code lab. I create a very simple hello world app with NDK components. Compiling and running on the phone were successful.
However, I couldn't start debugging the native code. When I press the Debug :app icon, the app shows Waiting For Debugger screen, while Android studio got stuck at Starting LLDB Server... .After a few minutes, the console output Failed to connect port.
Neither a real phone nor an emulator can successfully start the debug process.
Updating to Platform-tools version 29.0.4 solves the problem. Apparently, this problem appears in platform-tools 29.0.3
When trying to debug an app in android studio when I press the debug button it builds and installs the app but it displays 'waiting for debugger' on phone/tablet I'm trying to debug my app on, I have to connect the debugger through studio using the 'attach debugger to app' button rather than just automatically attaching the debugger and running. I know it sounds like a small problem but when you are doing this a lot it takes a lot of your time that could be spent debugging the app or writing feature code!
Running Android Studio 2.3 Beta 3 and Java 8
I would recommend using the built in emulator that Android Studio comes with,
Visual Studio's stand alone Android Emulator
That way you can debug your code on your development device without messing with adb
I'm using android studio in an Ubuntu VM in Virtualbox on a Linux Mint host.
I'm able to connect my s5 to the vm and compile then launch the app on my phone. However, sometimes (usually after 2 or 3 prior launches) I will select run, android studio will finish building but then nothing happens. The app does not launch but it shows my phone is still connected. The way I have to fix this (as retrying does not work) I disconnect phone from vm, reconnect phone and restart android studio then the app launches on first try. It seems like a problem with android studio since the only way to get out of it is to restart but I'm not sure how to prevent this problem.
i also face this problem but i fix it by reinstalling the app
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.
The interactive debugger works fine on one computer. But on another, which I configured the same way, I am having these problems...
When I try to run my android application from MonoDevelop the "Select Device" window is empty. There are three emulators listed in the AVD manager. (On my other computer I see all three emulators in the Select Device window.)
If I manually start an emulator it does appear. The Ok button never lights up, but if I double-click on it my application will deploy. However the debugger isn't working. Breakpoints are not honored and any exception will simply crash the application. I can see Debug.WriteLine info.
I tried restarting the adb server using the Refresh button.
I tried restarting the adb server from the command line.
I tried restarting my computer.
I tried uninstalling and reinstalling Mono for Android and its dependencies
Assuming you are using MonoDevelop on Windows, this is a recent bug that should be fixed in the next release:
http://bugzilla.xamarin.com/show_bug.cgi?id=2196