I'm developing a Xamarin Form app in Visual Studio installed in a VM created with Hyper-V. With ADB and port forwarding (https://bitbucket.org/chabernac/adbportforward/wiki/Home) I connect my physical device to VM in wi-fi mode.
Visual studio in VM see correctly the device but when i start debugging, the app is installed correctly in my device but debug crashes when app is going to open. The output of Visual Studio is:
Cannot start debugging: Cannot connect to 127.0.0.1:29308: No connection could be made because the target machine actively refused it 127.0.0.1:29309
Couldn't connect debugger. You can see more details in Xamarin Diagnostic output and the full exception on logs.
On Xamarin Diagnostic output can't see anything that can make me understand what the problem could be.
Can you help me? Thanks
You must update SDK Platform Tools at latest.
Related
my system which I develop MAUI on is not enough for running android emulator, so I decided to run android emulator on another Computer and debug my project remotely on it, I use this help to make a connection between computers, then when I build my project to debug it, visual studio recognize the emulator, install the app on it, and shows the splash screen, but after some minute, it shows this error and debuger agent can not connect:
[monodroid-debug] Trying to initialize the debugger with options:
--debugger-agent=transport=dt_socket,loglevel=0,address=10.0.2.2:36845,embedding=1
[mono] debugger-agent: Unable to connect to 10.0.2.2:36845
I should notice that the port is random
in this documentation of developer.android it shows that
10.0.2.2 is Special alias to your host loopback interface (127.0.0.1 on your development machine)
how should I fix it to can debug remotely in my development machine?
Problem pairing Android Studio to Device by Wi-Fi
I managed to pair an Android Device to Android Studio via Wi-Fi using a QR code. But then I got a "Default Activity Now Found" error when I tried to run my program to the device, I went through the steps to fix that error. And that led me to not only cleaning and rebuilding the project but when I restarted Visual Studio, I thought I would remove and re-add the listing in Device Manager.
And this is where the problem is. Since I removed the device listing in Device Manager, I have not been able to get it back. I have been trying both the QR code as well as the pairing code. The Android cell lists the computer. But each method I have tried to get Android Studio to recognize the cell, it fails. It says it may take up to 2 minutes to complete but it will say that there is an error pairing the device. It does not matter if I the computer name from the list of paired devices on the android or not.
The address and port number appear on the page for Wireless debugging on the Android device. When I try to use it in the Ubuntu OS where I am using Android Studio with:
(adb connect ip_address:port_number)
adb connect 192.168.0.13:37049
It states:
failed to connect to '192.168.0.13:37049' Connection refused
When I try to
adb tcpip 37049 it says:
error: no device/emulators found
I am unable to attach debugger in Android Studio in MacBook. I am getting this error
Failed to start monitoring <deviceID>
I have tried multiple solutions :
Turn on/off usb debugging on device
Invalidate cache/restart Android Studio & Build -> Clean project
Stop and start adb server from terminal
Changing cable/usb port
Reboot Android device, Mac
Reset Android device
Upgrade gradle plugin & Android Studio to new version
Setup:
Macbook,
Android Studio 4.2,
Pixel 3a Android 11
OnDevice USB Preferences:
USB Controlled by: This Device
Use USB For: No Data transfer
I was able to work with the debugger fine for a very long time (~8 months) but it stopped abruptly few days ago and did not have any luck since then.
I have tried various solutions from stackoverflow, medium most of them fall under the things I have tried above and I have observed that the solutions are for Windows machines, so wondering if there is anything different for Android Studio on Macbook?
Appreciate your time looking into this. Thanks in advance.
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
I have installed Xamarin in Visual studio 2015 and I have android and ios application within same solution file. when I am trying run android project in my local machine, I got error 'click retry to run the emulator in elevated mode. you do not have permission to modify internal Hyper-V network adapter settings,which are required to run the emulator'. So I clicked on "Retry" - it said windows packages changed to machine and I click on 'Yes', after that my local machine internet connection was gone. with the help of network engineer,Internet connection came back, my question is how can I run android application to my local machine without Hyper-V error.
I am a .Net developer and learning Mobile Application development, please can you help me out and suggest me that what I need to do?.
Thanks.
You did the right thing by retrying emulator in elevator mode, That is supposed to create internal switches to run your emulator and set up internet connection for it. Shouldn't affect your internet connection.
I'll advice
1. Try running the emulator again and let it create the adapters as Visual studio android emulators run in Hyper V.
Test app with a physical device connected to your computer