Open ArtefactoDev opened 1 day ago
I cannot debug it using 'hot reload' in any way.
This phrasing is confusing, are you trying to debug or use hot reload? The error looks like the debugger is not connecting.
Change the file 'ExemploAndroid.csproj' to:
Does the default template with no changes work? What change did you make that "breaks" things?
The error looks like what you would see if you put the emulator in airplane mode, for example.
This phrasing is confusing, are you trying to debug or use hot reload? The error looks like the debugger is not connecting.
I can't debug when I try to use a physical Android device.
Does the default template with no changes work?
No work. if you try to generate a default template (same Steps to Reproduce ) and try to debug (without any modification) using a physical Android device you will receive the following error:
ADB0020: Mono.AndroidTools.IncompatibleCpuAbiException: The package does not support the CPU architecture of this device
Shouldn't the template, without any modifications, work without errors?
What change did you make that "breaks" things?
Basically, trying to get around the 'ADB0020' error, I only added these lines:
`
`
`
`
if you try to generate a default template (same Steps to Reproduce ) and try to debug (without any modification) using a physical Android device you will receive the following error:
I do this daily, and it is working for me. What device are you using? Can you share a .binlog
of the failure? https://aka.ms/binlog
ADB0020: Mono.AndroidTools.IncompatibleCpuAbiException: The package does not support the CPU architecture of this device
ADB0020
is a completely different issue than debugging or hot reload. It means the deploy failed.
Is the device a 32-bit device? If so, you would need to list android-arm
as a RuntimeIdentifier
as you tried:
<RuntimeIdentifiers Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'android'">android-arm;android-arm64;android-x64;</RuntimeIdentifiers>
A .binlog
would allow us to investigate further, thanks!
do this daily, and it is working for me. What device are you using?
Not for me, even using the default template without any changes It works normally if I use the Android emulator, but not with the physical device.
Are you trying an emulator or are you trying to use a physical device for this test? because in the emulator it works normally. Physical device: Motorola G(8) (Android 10)
Can you share a .binlog of the failure? https://aka.ms/binlog
I attributed the log to open ticket to try to help.EngineTrace_4472.txt EngineTrace_12004.txt EngineTrace_23944.txt EngineTrace_26780.txt EngineTrace_27524.txt EngineTrace_28940.txt EngineTrace_29052.txt MSBuild_CommTrace_PID_4472.txt MSBuild_CommTrace_PID_12004.txt MSBuild_CommTrace_PID_23944.txt MSBuild_CommTrace_PID_26780.txt MSBuild_CommTrace_PID_27524.txt MSBuild_CommTrace_PID_28940.txt MSBuild_CommTrace_PID_29052.txt SchedulerState_12004.txt SchedulerTrace_12004.txt
ADB0020 is a completely different issue than debugging or hot reload. It means the deploy failed.
I know, I explained what happens when you try to debug a physical device using the default template, without any changes. I just find it strange that the default template without any changes, but with .Net 8 (templante default) works without any problems...
Is the device a 32-bit device? If so, you would need to list android-arm as a RuntimeIdentifier as you tried: (...)
I added all the code from the 'csproj' project to the ticket. I tried what you said, but it still didn't work.
Maybe the problem is with arm.. But, don't you agree that this should already come by default in the default template, if we consider that more than 90% of the time we will come across ARM devices on Android?
Thank you very much for the excellent help, I'm sure the team will solve it! Because you are excellent!
The logs above are not .binlog
files. Were you able to collect those?
90% of the time we will come across ARM devices on Android?
The default is android-arm64;android-x64
in .NET 9, you would have a very old Android device for it to be arm
and 32-bit.
The logs above are not .binlog files. Were you able to collect those?
The default is android-arm64;android-x64 in .NET 9, you would have a very old Android device for it to be arm and 32-bit.
It's a possibility. Is there a way I can get around this to test?
You already mentioned the solution for this which is to add android-arm
to the list of RuntimeIdentifiers
.
<RuntimeIdentifiers Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'android'">android-arm;android-arm64;android-x86;android-x64;</RuntimeIdentifiers>
Android framework version
net9.0-android
Affected platform version
VS 17.12.2, SDK 9.0.100, Windows 11 24H2
Description
The system compiles the code and sends it to the Android phone, however, after generating the .apk package in the system correctly, Visual Studio does not allow me to debug it.
I can open the generated package on my cell phone without errors, but I cannot debug it using 'hot reload' in any way.
Cell phone model: Motorola G(8) Android Version: Android 10
Detail, on the same machine I have another application developed in Xamarin for the same cell phone, and I can debug it normally.
Steps to Reproduce
Video Error: https://github.com/user-attachments/assets/4260e896-6c6a-4fd8-9101-87aff3ee9893
1 - Start Visual Studio 2 - Create a New Project 3 - .NET MAUI App (name: ExemploAndroid)
4 - Net 9 ('include sample content' NOT selected)
Change the file 'ExemploAndroid.csproj' to:
Plug in your cell phone (already configured in developer mode), choose to debug and after deployment, Visual Studio stops debugging.
Did you find any workaround?
unfortunately not.
Relevant log output