android: build issue typemaps.x86_64.ll: error: Could not open input file: no such file or directory

Android application type

.NET Android (net7.0-android, net8.0-android, etc.)

Affected platform version

VS 2022 17.10 Preview 7

Description

When trying to debug my app, I sometimes get an issue like typemaps.x86_64.ll: error: Could not open input file: no such file or directory. Another error I got was typemaps.armeabi-v7a.ll: error: Could not open input file: no such file or directory

This happens both in Visual Studio and on the command line using MSBuild.

The build error code is XA3006.

Steps to Reproduce

Not sure, but it is related to debugging on different devices having different processor architectures.

It happens e.g. when I try to deploy to my x86_64 emulator on my development machine after debugging via USB on a physical phone (which has an ARM processor).

Did you find any workaround?

No

Relevant log output

Please see the relevant tail of the logs below. The part before this (building the app) is common to all target devices and is working fine.

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 "_GenerateEmptyAndroidRemapNativeCode" because all output files are up-to-date with respect to the input files.
Touching "obj\Debug
et8.0-android\stamp\_GeneratePackageManagerJava.stamp".
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.
[llc.EXE stderr] C:\Program Files\dotnet\packs\Microsoft.Android.Sdk.Windows\34.0.95\tools\binutils\bin\llc.exe: error: C:\Program Files\dotnet\packs\Microsoft.Android.Sdk.Windows\34.0.95\tools\binutils\bin\llc.exe: typemaps.x86_64.ll: error: Could not open input file: no such file or directory
XA3006: Could not compile native assembly file: typemaps.x86_64.ll

stderr | C:\Program Files\dotnet\packs\Microsoft.Android.Sdk.Windows\34.0.95\tools\binutils\bin\llc.exe: error: C:\Program Files\dotnet\packs\Microsoft.Android.Sdk.Windows\34.0.95\tools\binutils\bin\llc.exe: typemaps.x86_64.ll: error: Could not open input file: no such file or directory


Done building project "Anonymized.App.csproj" -- FAILED.
Build FAILED.
2>Deployment failed to Small_Phone_API_34.
2>Deploy failed
========== Build: 1 succeeded, 0 failed, 5 up-to-date, 0 skipped ==========
========== Build completed at 13:32 and took 11,768 seconds ==========
========== Deploy: 0 succeeded, 1 failed, 0 skipped ==========
========== Deploy completed at 13:32 and took 11,768 seconds ==========

About this issue

  • Original URL
  • State: closed
  • Created 3 years ago
  • Comments: 26 (6 by maintainers)

Commits related to this issue

Most upvoted comments

@hansmbakker can you modify the C:\Program Files\dotnet\packs\Microsoft.Android.Sdk.Windows\34.0.95\tools\Xamarin.Android.Common.targets file and apply the following diff:

diff --git a/src/Xamarin.Android.Build.Tasks/Xamarin.Android.Common.targets b/src/Xamarin.Android.Build.Tasks/Xamarin.Android.Common.targets
index 5d81e3f75..5c35118e6 100644
--- a/src/Xamarin.Android.Build.Tasks/Xamarin.Android.Common.targets
+++ b/src/Xamarin.Android.Build.Tasks/Xamarin.Android.Common.targets
@@ -1443,7 +1443,7 @@ because xbuild doesn't support framework reference assemblies.
 <Target Name="_GenerateJavaStubs"
     DependsOnTargets="$(_GenerateJavaStubsDependsOnTargets);$(BeforeGenerateAndroidManifest)"
     Inputs="@(_AndroidMSBuildAllProjects);@(_ResolvedUserMonoAndroidAssemblies);$(_AndroidManifestAbs);$(_AndroidBuildPropertiesCache);@(AndroidEnvironment);@(LibraryEnvironments)"
-    Outputs="$(_AndroidStampDirectory)_GenerateJavaStubs.stamp">
+    Outputs="$(_AndroidStampDirectory)_GenerateJavaStubs.stamp;@(_TypeMapAssemblySource)">
 
   <PropertyGroup>
     <_ManifestOutput Condition=" '$(AndroidManifestMerger)' == 'legacy' ">$(IntermediateOutputPath)android\AndroidManifest.xml</_ManifestOutput>

And see if that fixes the issue?

@dellis1972 I have installed project-system-tools as requested. I have to be away until after the holiday so I will try to reproduce and send you the logs with my details as soon as I am able. Although it does work now, I am curious if building one of the other platforms has anything to do with this issue.

thank you… this solved the issue

gracias @grendello, también me funciono a mi esa solución

Thanks @grendello. It helped to me too.

@grendello I tried the change as well and it worked for me. I did not have to restart Visual Studio.

I’m off until Monday and will reply when I have a chance to do it