Repository navigation
build issue typemaps.x86_64.ll: error: Could not open input file: no such file or directory #8967
Description
Activity
- addedArea: App+Library BuildIssues when building Library projects or Application projects.Issues when building Library projects or Application projects.needs-triageIssues that need to be assigned.Issues that need to be assigned.
on May 20, 2024 @grendello let's discuss the build issue here.
I recorded a binlog and can share it confidentially (it contains client information).
The logs are shared with @grendello's Microsoft account via OneDrive
@hansmbakker can you modify the
C:\Program Files\dotnet\packs\Microsoft.Android.Sdk.Windows\34.0.95\tools\Xamarin.Android.Common.targetsfile 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?
Reacted by fonlow, Serdar Ablyametov, Grave, Mateus Henrique and Alexey RudenkoReacted by Scott Christian, Stephan Bisschop, Dmitrii Filippov, Odnovolov Artem, Vitaly Knyazev, iida-i3, Mike Goatly, Borja Serrano, Vsevolod245, conbre and 8 moreReacted by Paul Astro and iida-i3- addedneed-infoIssues that need more information from the author.Issues that need more information from the author.and removedneeds-triageIssues that need to be assigned.Issues that need to be assigned.
on May 23, 2024 I'm off until Monday and will reply when I have a chance to do it
Reacted by Marek Habersack- addedneed-attentionA xamarin-android contributor needs to reviewA xamarin-android contributor needs to reviewand removedneed-infoIssues that need more information from the author.Issues that need more information from the author.
on May 23, 2024 @grendello I tried your change and it seems to help. I had to restart Visual Studio before it picked it up.
I updated the reproduction steps - it had something to do with switching debugging between devices that have different architectures.
Please note that xamarin/Xamarin.Forms#15719 and dotnet/maui#14531 (comment) seem to be related.
Just popping in to say I'm getting this error too, but don't think I have anything helpful to add. Let me know if there is something I could provide to assist though.
@grendello I tried the change as well and it worked for me. I did not have to restart Visual Studio.
Reacted by Marek Habersack13 remaining items
For me it seemed to happen when switching not between platforms per se (I did not try building for windows or iOS) but switching between targets devices.
I was switching between different android phones - two physical and one emulator. There were different processor architectures.
- added a commit that references this issue
on Jul 8, 2024 For all of those hitting this issue (and for whom the fix worked) it would be really nice to figure out what is deleting these files in the first place.
I think it's not copying them in the first place. If I rebuild the basic template project then the only
.llfiles copied intoobj/Debug/net8.0-android/android/are.arm64-v8a.llfiles. When I then try to debug on an x86_x64 emulator, it copies the.x86_x64.llversions of all excepttypemaps. However, the fix doesn't work for me so maybe there are multiple issues at play here.Edit: a workaround for me for development is to add
<AndroidCreatePackagePerAbi>True</AndroidCreatePackagePerAbi>to the csproj, but I suspect that I won't want that when I come to compile a bundle for release.The reason only the
x86.64.llfile is used when debugging is we detect the device abi which you are debugging agsinst and only build for that abi. This is different from release packages where we build for all the selected abis.For all of those hitting this issue (and for whom the fix worked) it would be really nice to figure out what is deleting these files in the first place.
I think it's not copying them in the first place. If I rebuild the basic template project then the only
.llfiles copied intoobj/Debug/net8.0-android/android/are.arm64-v8a.llfiles. When I then try to debug on an x86_x64 emulator, it copies the.x86_x64.llversions of all excepttypemaps. However, the fix doesn't work for me so maybe there are multiple issues at play here.Edit: a workaround for me for development is to add
<AndroidCreatePackagePerAbi>True</AndroidCreatePackagePerAbi>to the csproj, but I suspect that I won't want that when I come to compile a bundle for release.This workaround worked for me
- added a commit that references this issue
on Jul 26, 2024 Does someone know the repro steps to cause this problem?
I thought that this would cause it inside Visual Studio:
- F5 to an arm64 device
- F5 to an x86_64 emulator
But that seems to work fine.
For me it happened just now the first time after switching from the Android emulator (on x64) to a Samsung device (arm64) and then back again to the emulator.
The fix now allows me to run my app in the emulator again.- added a commit that references this issue
on Aug 6, 2024 @grendello has given a good answer about modifying file in tools\Xamarin.Android.Common.targets
The problem has come back to me upon VS 17.11.2, now go to the targets file in
C:\Program Files\dotnet\packs\Microsoft.Android.Sdk.Windows\34.0.113\toolsNot sure if MS should fix this?
@zijianhuang it's fixed in #9174
- locked and limited conversation to collaborators
on Oct 4, 2024
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 directoryThis 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.