xamarin / xamarin-macios

.NET for iOS, Mac Catalyst, macOS, and tvOS provide open-source bindings of the Apple SDKs for use with .NET managed languages such as C#
Other
2.49k stars 515 forks source link

MT4109: Failed to compile the generated registrar code #7065

Closed chrisalansearle closed 5 years ago

chrisalansearle commented 5 years ago

We receive the error "MT4109: Failed to compile the generated registrar code" when we try to use using our build server. Our build server appears to have updated to have the ios 13 SDK on it over the weekend, and since then has failed to build.

Steps to Reproduce

1: run the command : . /Library/Frameworks/Mono.framework/Commands/msbuild /p:Configuration=Ad-Hoc /p:Platform=iPhone /p:BuildIpa=true /p:AppVersion=$version_number /target:Build imsweb/PS.Mobile.iOS.sln /p:IpaPackageDir="Builds/$version_number"

Expected Behavior

I would expect that msbuild would complete the build and generate an IPA file that we are able to distribute.

Actual Behavior

The build fails with the error:

[build.log](https://github.com/xamarin/xamarin-macios/files/3641817/build.log)

"/Users/rgardner/.jenkins/workspace/master/imsweb/PS.Mobile.iOS.sln" (Build target) (1) ->
"/Users/rgardner/.jenkins/workspace/master/imsweb/PS.Mobile.Finisher/PS.Mobile.Finisher.iOS.csproj" (default target) (19) ->
(_CompileToNative target) -> 
  /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS13.0.sdk/System/Library/Frameworks/Photos.framework/Headers/PHImageManager.h(17,47): error GEA45E82A: expected identifier or '{' [/Users/rgardner/.jenkins/workspace/master/imsweb/PS.Mobile.Finisher/PS.Mobile.Finisher.iOS.csproj]
  MTOUCH : error MT4109: Failed to compile the generated registrar code. Please file a bug report at https://github.com/xamarin/xamarin-macios/issues/new [/Users/rgardner/.jenkins/workspace/master/imsweb/PS.Mobile.Finisher/PS.Mobile.Finisher.iOS.csproj]

"/Users/rgardner/.jenkins/workspace/master/imsweb/PS.Mobile.iOS.sln" (Build target) (1) ->
"/Users/rgardner/.jenkins/workspace/master/imsweb/PS.Mobile.Manager/PS.Mobile.Manager.iOS.csproj" (default target) (23) ->
  /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS13.0.sdk/System/Library/Frameworks/Photos.framework/Headers/PHImageManager.h(17,47): error GEA45E82A: expected identifier or '{' [/Users/rgardner/.jenkins/workspace/master/imsweb/PS.Mobile.Manager/PS.Mobile.Manager.iOS.csproj]
  MTOUCH : error MT4109: Failed to compile the generated registrar code. Please file a bug report at https://github.com/xamarin/xamarin-macios/issues/new [/Users/rgardner/.jenkins/workspace/master/imsweb/PS.Mobile.Manager/PS.Mobile.Manager.iOS.csproj]

    76 Warning(s)
    4 Error(s)

It has a preceeding error of:

_CompileToNative:
  /Library/Frameworks/Xamarin.iOS.framework/Versions/Current/bin/mtouch @/Users/rgardner/.jenkins/workspace/master/imsweb/PS.Mobile.Manager/obj/iPhone/Ad-Hoc/response-file.rsp 
  Process exited with code 1, command:
  /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang  -Wno-receiver-forward-class -Wno-objc-missing-super-calls -Wno-unguarded-availability-new -stdlib=libc++ -gdwarf-2 -I/Library/Frameworks/Xamarin.iOS.framework/Versions/12.14.0.114/SDKs/MonoTouch.iphoneos.sdk/usr/include -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS13.0.sdk -Qunused-arguments -miphoneos-version-min=11.0 -arch arm64 -c -o /Users/rgardner/.jenkins/workspace/master/imsweb/PS.Mobile.Manager/obj/iPhone/Ad-Hoc/mtouch-cache/arm64/registrar.o -x objective-c++ /Users/rgardner/.jenkins/workspace/master/imsweb/PS.Mobile.Manager/obj/iPhone/Ad-Hoc/mtouch-cache/registrar.m
  In file included from /Users/rgardner/.jenkins/workspace/master/imsweb/PS.Mobile.Manager/obj/iPhone/Ad-Hoc/mtouch-cache/registrar.m:2:
  In file included from /Users/rgardner/.jenkins/workspace/master/imsweb/PS.Mobile.Manager/obj/iPhone/Ad-Hoc/mtouch-cache/registrar.h:15:
  In file included from /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS13.0.sdk/System/Library/Frameworks/Photos.framework/Headers/Photos.h:31:
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS13.0.sdk/System/Library/Frameworks/Photos.framework/Headers/PHImageManager.h(17,47): error GEA45E82A: expected identifier or '{' [/Users/rgardner/.jenkins/workspace/master/imsweb/PS.Mobile.Manager/PS.Mobile.Manager.iOS.csproj]
  typedef NS_ENUM(NSInteger, UIImageOrientation);
                                                ^ 
  1 error generated.

MTOUCH : error MT4109: Failed to compile the generated registrar code. Please file a bug report at https://github.com/xamarin/xamarin-macios/issues/new [/Users/rgardner/.jenkins/workspace/master/imsweb/PS.Mobile.Manager/PS.Mobile.Manager.iOS.csproj]
Done Building Project "/Users/rgardner/.jenkins/workspace/master/imsweb/PS.Mobile.Manager/PS.Mobile.Manager.iOS.csproj" (default targets) -- FAILED.
Done Building Project "/Users/rgardner/.jenkins/workspace/master/imsweb/PS.Mobile.iOS.sln" (Build target(s)) -- FAILED.

Build FAILED.

Environment

{\rtf1\ansi\ansicpg1252\cocoartf1671\cocoasubrtf600
{\fonttbl\f0\fswiss\fcharset0 Helvetica;}
{\colortbl;\red255\green255\blue255;}
{\*\expandedcolortbl;;}
\paperw11900\paperh16840\margl1440\margr1440\vieww10800\viewh8400\viewkind0
\pard\tx566\tx1133\tx1700\tx2267\tx2834\tx3401\tx3968\tx4535\tx5102\tx5669\tx6236\tx6803\pardirnatural\partightenfactor0

\f0\fs24 \cf0 === Visual Studio Professional 2019 for Mac ===\
\
Version 8.2.6 (build 26)\
Installation UUID: 1acc3bbc-1211-4986-b79f-69683e6cd4c9\
    GTK+ 2.24.23 (Raleigh theme)\
    Xamarin.Mac 5.14.0.85 (d16-2-fix-mac-updates / 86973979)\
\
    Package version: 600000334\
\
=== Mono Framework MDK ===\
\
Runtime:\
    Mono 6.0.0.334 (2019-02/6256b82d62f) (64-bit)\
    Package version: 600000334\
\
=== NuGet ===\
\
Version: 5.1.0.6013\
\
=== .NET Core ===\
\
Runtime: /usr/local/share/dotnet/dotnet\
Runtime Versions:\
    2.1.12\
    2.1.11\
    2.1.9\
SDK: /usr/local/share/dotnet/sdk/2.1.701/Sdks\
SDK Versions:\
    2.1.701\
    2.1.700\
    2.1.505\
MSBuild SDKs: /Library/Frameworks/Mono.framework/Versions/6.0.0/lib/mono/msbuild/Current/bin/Sdks\
\
=== Xamarin.Profiler ===\
\
Version: 1.6.10\
Location: /Applications/Xamarin Profiler.app/Contents/MacOS/Xamarin Profiler\
\
=== Updater ===\
\
Version: 11\
\
=== Apple Developer Tools ===\
\
Xcode 11.0 (14936)\
Build 11A420a\
\
=== Xamarin.Mac ===\
\
Version: 5.14.0.114 (Visual Studio Professional)\
Hash: c6691164\
Branch: d16-2\
Build date: 2019-07-29 15:54:06-0400\
\
=== Xamarin.iOS ===\
\
Version: 12.14.0.114 (Visual Studio Professional)\
Hash: c6691164\
Branch: d16-2\
Build date: 2019-07-29 15:54:05-0400\
\
=== Xamarin.Android ===\
\
Version: 9.4.1.0 (Visual Studio Professional)\
Commit: xamarin-android/d16-2/ebd65c9\
Android SDK: /Users/rgardner/Library/Developer/Xamarin/android-sdk-macosx\
    Supported Android versions:\
        8.1 (API level 27)\
\
SDK Tools Version: 26.1.1\
SDK Platform Tools Version: 28.0.0\
SDK Build Tools Version: 27.0.3\
\
Build Information: \
Mono: mono/mono/2019-02@e6f5369c2d2\
Java.Interop: xamarin/java.interop/d16-2@d64ada5\
LibZipSharp: grendello/LibZipSharp/d16-2@caa0c74\
LibZip: nih-at/libzip/rel-1-5-1@b95cf3f\
ProGuard: xamarin/proguard/master@905836d\
SQLite: xamarin/sqlite/3.27.1@8212a2d\
Xamarin.Android Tools: xamarin/xamarin-android-tools/d16-2@6f6c969\
\
=== Microsoft Mobile OpenJDK ===\
\
Java SDK: /Users/rgardner/Library/Developer/Xamarin/jdk/microsoft_dist_openjdk_1.8.0.25\
1.8.0-25\
Android Designer EPL code available here:\
https://github.com/xamarin/AndroidDesigner.EPL\
\
=== Android Device Manager ===\
\
Version: 1.2.0.60\
Hash: 686c817\
Branch: remotes/origin/d16-2\
Build date: 2019-08-07 15:49:58 UTC\
\
=== Xamarin Inspector ===\
\
Version: 1.4.3\
Hash: db27525\
Branch: 1.4-release\
Build date: Mon, 09 Jul 2018 21:20:18 GMT\
Client compatibility: 1\
\
=== Xamarin Designer ===\
\
Version: 16.2.0.379\
Hash: 3f0652957\
Branch: remotes/origin/d16-2\
Build date: 2019-08-01 17:32:50 UTC\
\
=== Build Information ===\
\
Release ID: 802060026\
Git revision: a4ea4d00345f4d98a95bd2322b1d04935eb553e1\
Build date: 2019-09-05 18:24:25+00\
Build branch: release-8.2\
Xamarin extensions: 366997b587d63360705507e281ae75025762cadf\
\
=== Operating System ===\
\
Mac OS X 10.14.6\
Darwin 18.7.0 Darwin Kernel Version 18.7.0\
    Tue Aug 20 16:57:14 PDT 2019\
    root:xnu-4903.271.2~2/RELEASE_X86_64 x86_64\
\
}

Build Logs

(Please see attached)

chrisalansearle commented 5 years ago

Build Log Attachment: build.log

rolfbjarne commented 5 years ago

The problem is that your Mac auto-upgraded Xcode to the new Xcode 11, and our current version of Xamarin.iOS is not compatible with Xcode 11.

We'll release a version of Xamarin.iOS that is compatible with Xcode 11 later today. A more immediate solution is to install our preview version of Xamarin.iOS with support for Xcode 11.

leonvandebroek commented 5 years ago

Tried updating using preview channel in vs2019 but no luck. Also did obj/bin cleanup and nuget package restore. all futile attempts in my case.