Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error MT4109 : Failed to compile the generated registrar code. #19257

Closed
Sebastian1989101 opened this issue Oct 18, 2023 · 6 comments
Closed
Labels
need-attention An issue requires our attention/response
Milestone

Comments

@Sebastian1989101
Copy link

Steps to Reproduce

  1. Updated Visual Studio for Mac for Xcode 15 support
  2. Tried to archive my Xamarin.Forms project for an iOS release

Expected Behavior

It works.

Actual Behavior

It does not work.

Environment

Version information
Visual Studio Professional 2022 for Mac
Version 17.6.5 (build 417)
Installation UUID: 5d0d2766-dad1-4e07-b27f-c5627e1b1c35

Runtime
.NET 7.0.3 (64-bit)
Architecture: Arm64
Microsoft.macOS.Sdk 13.1.1007; git-rev-head:8afca776a0a96613dfb7200e0917bb57f9ed5583; git-branch:release/7.0.1xx-xcode14.2

Roslyn (Language Service)
4.6.0-3.23180.6+99e956e42697a6dd886d1e12478ea2b27cceacfa

NuGet
Version: 6.4.0.117

.NET SDK (Arm64)
SDK: /usr/local/share/dotnet/sdk/7.0.309/Sdks
SDK Versions:
	7.0.309
	7.0.308
	7.0.307
	7.0.306
	7.0.304
	7.0.302
	7.0.203
	7.0.202
	7.0.201
	7.0.200
	7.0.103
	7.0.102
	7.0.101
	7.0.100
	6.0.415
	6.0.414
	6.0.413
	6.0.412
	6.0.410
	6.0.408
	6.0.407
	6.0.406
	6.0.405
	6.0.404
	6.0.403
	6.0.402
	6.0.401
	6.0.400
	6.0.302
	6.0.301
	6.0.300
MSBuild SDKs: /Applications/Visual Studio.app/Contents/MonoBundle/MSBuild/Current/bin/Sdks

.NET SDK (x64)
SDK Versions:
	6.0.415
	6.0.414
	6.0.413
	6.0.412
	6.0.410
	6.0.408
	6.0.407
	6.0.406
	6.0.405
	6.0.404
	6.0.403
	6.0.402
	6.0.401
	6.0.400
	6.0.302
	6.0.301
	6.0.300
	6.0.106
	6.0.105
	6.0.104
	6.0.103
	6.0.102
	6.0.101
	5.0.408
	5.0.407
	5.0.406
	5.0.405
	5.0.404
	3.1.426
	3.1.425
	3.1.424
	3.1.423
	3.1.422
	3.1.421
	3.1.420
	3.1.419
	3.1.418
	3.1.417
	3.1.416

.NET Runtime (Arm64)
Runtime: /usr/local/share/dotnet/dotnet
Runtime Versions:
	7.0.12
	7.0.11
	7.0.10
	7.0.9
	7.0.7
	7.0.5
	7.0.4
	7.0.3
	7.0.2
	7.0.1
	7.0.0
	6.0.23
	6.0.22
	6.0.21
	6.0.20
	6.0.18
	6.0.16
	6.0.15
	6.0.14
	6.0.13
	6.0.12
	6.0.11
	6.0.10
	6.0.9
	6.0.8
	6.0.7
	6.0.6
	6.0.5

.NET Runtime (x64)
Runtime: /usr/local/share/dotnet/x64/dotnet
Runtime Versions:
	6.0.23
	6.0.22
	6.0.21
	6.0.20
	6.0.18
	6.0.16
	6.0.15
	6.0.14
	6.0.13
	6.0.12
	6.0.11
	6.0.10
	6.0.9
	6.0.8
	6.0.7
	6.0.6
	6.0.5
	6.0.4
	6.0.3
	6.0.2
	6.0.1
	5.0.17
	5.0.16
	5.0.15
	5.0.14
	5.0.13
	3.1.32
	3.1.31
	3.1.30
	3.1.29
	3.1.28
	3.1.27
	3.1.26
	3.1.25
	3.1.24
	3.1.23
	3.1.22

Xamarin.Profiler
Version: 1.8.0.49
Location: /Applications/Xamarin Profiler.app/Contents/MacOS/Xamarin Profiler

Updater
Version: 11

Xamarin.Android
Version: 13.2.2.0 (Visual Studio Professional)
Commit: xamarin-android/d17-5/45b0e14
Android SDK: /Users/sebastian/Library/Developer/Xamarin/android-sdk-macosx
	Supported Android versions:
		12.1 (API level 32)
		8.0  (API level 26)
		6.0  (API level 23)
		12.0 (API level 31)
		5.0  (API level 21)
		11.0 (API level 30)
		13.0 (API level 33)
		7.0  (API level 24)

SDK Command-line Tools Version: 7.0
SDK Platform Tools Version: 34.0.1
SDK Build Tools Version: 33.0.0 rc1

Build Information: 
Mono: d9a6e87
Java.Interop: xamarin/java.interop/d17-5@149d70fe
SQLite: xamarin/sqlite/3.40.1@68c69d8
Xamarin.Android Tools: xamarin/xamarin-android-tools/d17-5@ca1552d

Microsoft Build of OpenJDK
Java SDK: /Library/Java/JavaVirtualMachines/microsoft-11.jdk
11.0.16.1
Android Designer EPL code available here:
https://github.com/xamarin/AndroidDesigner.EPL

Eclipse Temurin JDK
Java SDK: /Library/Java/JavaVirtualMachines/temurin-8.jdk
1.8.0.302
Android Designer EPL code available here:
https://github.com/xamarin/AndroidDesigner.EPL

Android SDK Manager
Version: 17.6.0.50
Hash: a715dca
Branch: HEAD
Build date: 2023-10-04 18:09:18 UTC

Android Device Manager
Version: 0.0.0.1309
Hash: 06e3e77
Branch: HEAD
Build date: 2023-10-04 18:09:18 UTC

Apple Developer Tools
Xcode: 15.0 22265
Build: 15A240d

Xamarin.Mac
Version: 9.3.0.18 Visual Studio Professional
Hash: 9d266025e
Branch: xcode14.3
Build date: 2023-09-06 19:52:26-0400

Xamarin.iOS
Version: 16.4.0.18 Visual Studio Professional
Hash: 9d266025e
Branch: xcode14.3
Build date: 2023-09-06 19:52:27-0400

Xamarin Designer
Version: 17.6.3.9
Hash: 2648399ae8
Branch: remotes/origin/d17-6
Build date: 2023-10-04 18:09:13 UTC

Build Information
Release ID: 1706050417
Git revision: 6d6585a706becbd4a5be3b0e99ace260dfdf5748
Build date: 2023-10-04 18:07:26+00
Build branch: release-17.6
Build lane: release-17.6

Operating System
Mac OS X 14.0.0
Darwin 23.0.0 Darwin Kernel Version 23.0.0
    Fri Sep 15 14:41:43 PDT 2023
    root:xnu-10002.1.13~1/RELEASE_ARM64_T6000 arm64

Enabled user installed extensions
Project System Tools 0.13


Build Logs

tmpMHSj6i.binlog.zip

Example Project (If Possible)

@rolfbjarne
Copy link
Member

I haven't seen this error before, would you be able to create a test project to reproduce this, or give us access to your project?

@rolfbjarne rolfbjarne added this to the Future milestone Oct 19, 2023
@rolfbjarne rolfbjarne added the need-info Waiting for more information before the bug can be investigated label Oct 19, 2023
@Sebastian1989101
Copy link
Author

@rolfbjarne this happens in every Xamarin.Forms project I tried to Archive for iOS publishing. So I guess it's a general problem with Xamarin.Forms projects. I cannot share my projects and I don't have the time again to play beta tester for Microsoft releasing unfinished products.

@microsoft-github-policy-service microsoft-github-policy-service bot added need-attention An issue requires our attention/response and removed need-info Waiting for more information before the bug can be investigated labels Oct 19, 2023
@rolfbjarne
Copy link
Member

I figured out the cause: it happens when building Objective-C++ for armv7.

The problem is that Apple's headers in Xcode 15 are broken when building for armv7.

Just a single line of Objective-C code triggers the error:

#import <ModelIO/ModelIO.h>

So this will show the error:

$ echo "#import <ModelIO/ModelIO.h>" |
  /Applications/Xcode_15.0.0.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang \
  -isysroot /Applications/Xcode_15.0.0.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS17.0.sdk \
  -arch armv7 \
  -x objective-c++ \
  -c \
  -
In file included from <stdin>:1:
In file included from /Applications/Xcode_15.0.0.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS17.0.sdk/System/Library/Frameworks/ModelIO.framework/Headers/ModelIO.h:10:
In file included from /Applications/Xcode_15.0.0.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS17.0.sdk/System/Library/Frameworks/ModelIO.framework/Headers/MDLAsset.h:10:
In file included from /Applications/Xcode_15.0.0.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS17.0.sdk/System/Library/Frameworks/ModelIO.framework/Headers/MDLObject.h:9:
In file included from /Applications/Xcode_15.0.0.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS17.0.sdk/System/Library/Frameworks/ModelIO.framework/Headers/MDLTypes.h:13:
In file included from /Applications/Xcode_15.0.0.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS17.0.sdk/usr/include/simd/simd.h:23:
/Applications/Xcode_15.0.0.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS17.0.sdk/usr/include/simd/matrix.h:1105:25: error: use of undeclared identifier 'vzip1q_f32'; did you mean 'vzipq_f32'?
    simd_float4 __r01 = vzip1q_f32(__x0, __x1);
                        ^
[...]

There's not much we can do about this, and I don't think filing an issue with Apple will fix anything, since armv7 is deprecated. I wasn't even able to create a test project in Xcode 15, because Xcode fails the build immediately with:

The armv7 architecture is deprecated. You should update your ARCHS build setting to remove the armv7 architecture.

This means the fix is to remove ARMv7 from the MtouchArch property in the project file (for all configurations).

Alternatively you may try to continue using Xcode 14.3.

@Sebastian1989101
Copy link
Author

I just checked and ARMv7 is not part of any of my Xamarin.Forms projects. And Xcode 14.x is no option as this does not run under the latest macOS anymore so I assume it is also not able to be used for command line tools.

@rolfbjarne
Copy link
Member

I just checked and ARMv7 is not part of any of my Xamarin.Forms projects.

According to your binlog, this file:

/Users/sebastian/WorkingCopy/git/BreathCompanion/BreathCompanion/BreathCompanion/BreathCompanion.iOS/BreathCompanion.iOS.csproj

has numerous ARMv7 entries:

<MtouchArch>ARMv7, ARM64</MtouchArch>

@Sebastian1989101
Copy link
Author

I see. It's in the *.csproj file but this is what I can see in the VS for Mac UI so I thought it won't be in there..
Bildschirmfoto 2023-10-19 um 11 59 56

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
need-attention An issue requires our attention/response
Projects
None yet
Development

No branches or pull requests

2 participants