maui: Cant debug on real Android API 21 Device

Description

I want to develop a MAUI-App and read that it works back to API 21. So i created an emulated device that uses Android API 21. All the Debug-Stuff works well, but when i try to start debugging on a “real” Device (In my Case a Samsumg Galaxy Tab 4 (SM-T535) i get the following Error as seen in the log.

The device dont start the app even after Factory-Reset.

Steps to Reproduce

1.) Create a new .NET MAUI Application 2.) Debug Application on a real connected Device.

Version with bug

Preview 14 (current)

Last version that worked well

Unknown/Other

Affected platforms

Android

Affected platform versions

Android 5.0.2

Did you find any workaround?

Nope.

Relevant log output

Build started...
1>------ Build started: Project: MauiApp1, Configuration: Debug Any CPU ------
1>You are using a preview version of .NET. See: https://aka.ms/dotnet-core-preview
1>Skipping analyzers to speed up the build. You can execute 'Build' or 'Rebuild' command to run analyzers.
1>MauiApp1 -> C:\Users\djdee\source\repos\MauiDemoApp\MauiApp1\bin\Debug\net6.0-android\MauiApp1.dll
2>------ Deploy started: Project: MauiApp1, Configuration: Debug Any CPU ------
2>Starting deployment to Samsung SM-T535 ...
2>Deploying to Samsung SM-T535 ...
Build started.
Project "MauiApp1.csproj" (Install target(s)):
You are using a preview version of .NET. See: https://aka.ms/dotnet-core-preview
There is no application host available for the specified RuntimeIdentifier 'android-x86'.
Found Java SDK version 11.0.12.
Found Java SDK version 11.0.12.
 Found Xamarin.Android 31.0.200.106
Dex Fast Deployment Enabled: False
MonoAndroid Tools: C:\Program Files\dotnet\packs\Microsoft.Android.Sdk.Windows\31.0.200-preview.14.106\tools\
Android Platform API level: 31
TargetFrameworkVersion: v6.0
Android NDK: C:\Program Files (x86)\Android\android-sdk
dk-bundle\
Android SDK: C:\Program Files (x86)\Android\android-sdk\
Android SDK Build Tools: C:\Program Files (x86)\Android\android-sdk\build-tools\30.0.3\
Java SDK: C:\Program Files\Microsoft\jdk-11.0.12.7-hotspot\
Application Java class: android.app.Application
Skipping target "ProcessMauiSplashScreens" because all output files are up-to-date with respect to the input files.
Skipping target "ProcessMauiFonts" because all output files are up-to-date with respect to the input files.
Skipping target "ResizetizeImages" because all output files are up-to-date with respect to the input files.
Skipping target "_ResolveLibraryProjectImports" because all output files are up-to-date with respect to the input files.
Skipping target "_BuildLibraryImportsCache" because all output files are up-to-date with respect to the input files.
Skipping target "_GenerateAndroidResourceDir" because all output files are up-to-date with respect to the input files.
Skipping target "_GenerateLayoutBindings" because it has no outputs.
Skipping target "_ConvertResourcesCases" because all output files are up-to-date with respect to the input files.
Skipping target "_CompileResources" because all output files are up-to-date with respect to the input files.
Skipping target "_PrepareUpdateAndroidResgen" because all output files are up-to-date with respect to the input files.
Skipping target "_UpdateAndroidResgen" because all output files are up-to-date with respect to the input files.
Project "MauiApp1.csproj" (_ComputeFilesToPublishForRuntimeIdentifiers target(s)):
Done building project "MauiApp1.csproj".
Skipping target "_LinkAssembliesNoShrink" because all output files are up-to-date with respect to the input files.
Skipping target "_GenerateJavaStubs" because all output files are up-to-date with respect to the input files.
Skipping target "_ManifestMerger" because all output files are up-to-date with respect to the input files.
Skipping target "_ConvertCustomView" because all output files are up-to-date with respect to the input files.
Skipping target "_AddStaticResources" because all output files are up-to-date with respect to the input files.
Skipping target "_GeneratePackageManagerJava" because all output files are up-to-date with respect to the input files.
Skipping target "_GenerateAndroidAssetsDir" because all output files are up-to-date with respect to the input files.
Skipping target "_PrepareCreateBaseApk" because all output files are up-to-date with respect to the input files.
Skipping target "_CreateBaseApk" because all output files are up-to-date with respect to the input files.
Skipping target "_CompileJava" because all output files are up-to-date with respect to the input files.
Skipping target "_CompileNativeAssemblySources" because all output files are up-to-date with respect to the input files.
Skipping target "_CreateApplicationSharedLibraries" because all output files are up-to-date with respect to the input files.
Skipping target "_CompileToDalvik" because all output files are up-to-date with respect to the input files.
Copying file from "C:\Users\djdee\source\repos\MauiDemoApp\MauiApp1\obj\Debug
et6.0-android\android\bin\com.companyname.mauiapp1.apk" to "C:\Users\djdee\source\repos\MauiDemoApp\MauiApp1\bin\Debug
et6.0-android\com.companyname.mauiapp1.apk".
Creating "obj\Debug
et6.0-android\android_debug_keystore.flag" because "AlwaysCreate" was specified.
C:\Program Files (x86)\Android\android-sdk\build-tools\30.0.3\zipalign.exe -p 4 "obj\Debug
et6.0-android\android\bin\com.companyname.mauiapp1.apk" "bin\Debug
et6.0-android\\com.companyname.mauiapp1-Signed.apk" 
C:\Program Files\Microsoft\jdk-11.0.12.7-hotspot\bin\java.exe -jar "C:\Program Files\dotnet\packs\Microsoft.Android.Sdk.Windows\31.0.200-preview.14.106\tools\apksigner.jar" sign --ks "C:\Users\djdee\AppData\Local\Xamarin\Mono for Android\debug.keystore" --ks-pass pass:android --ks-key-alias androiddebugkey --key-pass pass:android --min-sdk-version 21 --max-sdk-version 31  bin\Debug
et6.0-android\com.companyname.mauiapp1-Signed.apk 
Signed android package 'bin\Debug
et6.0-android\com.companyname.mauiapp1-Signed.apk'
Using cached value from RegisterTaskObject
Found device: cf92711d
XA0132: The package was not installed. Please check you do not have it installed under any other user.
If the package does show up on the device, try manually uninstalling it then try again.
You should be able to uninstall the app via the Settings app on the device.
Done building project "MauiApp1.csproj" -- FAILED.
Build FAILED.
2>Deployment failed to Samsung SM-T535.
2>Deploy failed
========== Build: 1 succeeded, 0 failed, 0 up-to-date, 0 skipped ==========
========== Deploy: 0 succeeded, 1 failed, 0 skipped ==========

About this issue

  • Original URL
  • State: closed
  • Created 2 years ago
  • Comments: 22 (9 by maintainers)

Most upvoted comments

None of the .NET assemblies were fast deployed:

F/monodroid(14234): No assemblies found in '/data/data/com.companyname.testmaui/files/.__override__' or '<unavailable>'. Assuming this is part of Fast Deployment. Exiting...

Since you got this before:

XA0132: The package was not installed. Please check you do not have it installed under any other user.
If the package does show up on the device, try manually uninstalling it then try again.
You should be able to uninstall the app via the Settings app on the device.

Can you manually uninstall the app, then set <EmbedAssembliesIntoApk>true</EmbedAssembliesIntoApk> in your .csproj?

That should solve the issue, I think?