Bug 59677 - Failed to compile the generated registrar code
Summary: Failed to compile the generated registrar code
Status: RESOLVED ANSWERED
Alias: None
Product: iOS
Classification: Xamarin
Component: MSBuild ()
Version: XI 11.0 (xcode9)
Hardware: PC Windows
: --- normal
Target Milestone: Untriaged
Assignee: Bugzilla
URL:
Depends on:
Blocks:
 
Reported: 2017-09-22 03:46 UTC by ebugden
Modified: 2017-09-22 05:33 UTC (History)
2 users (show)

Tags:
Is this bug a regression?: ---
Last known good build:

Notice (2018-05-24): bugzilla.xamarin.com is now in read-only mode.

Please join us on Visual Studio Developer Community and in the Xamarin and Mono organizations on GitHub to continue tracking issues. Bugzilla will remain available for reference in read-only mode. We will continue to work on open Bugzilla bugs, copy them to the new locations as needed for follow-up, and add the new items under Related Links.

Our sincere thanks to everyone who has contributed on this bug tracker over the years. Thanks also for your understanding as we make these adjustments and improvements for the future.


Please create a new report on Developer Community or GitHub with your current version information, steps to reproduce, and relevant error messages or log files if you are hitting an issue that looks similar to this resolved bug and you do not yet see a matching new report.

Related Links:
Status:
RESOLVED ANSWERED

Description ebugden 2017-09-22 03:46:12 UTC
the following error was reported:

1>------ Rebuild All started: Project: AutoPayPhone.iOS, Configuration: Release iPhone ------
1>  Connecting to Mac server Earls-Mac-mini.local...
1>  AutoPayPhone.iOS -> E:\Development\jci\PaymentMinder4.5\Phone\AutoPayPhone\AutoPayPhone\AutoPayPhone.iOS\bin\iPhone\Release\AutoPayPhoneiOS.exe
1>  Detected signing identity:
1>    Code Signing Key: "iPhone Developer: Earl Bugden (5ZC2E7CCKV)" (F7C99E613A2378ECF3A0730B6D3884C889963D3D)
1>    Provisioning Profile: "Development Phone" (57ea4fde-afb6-4b0a-a452-4f954bae0d6d)
1>    Bundle Id: ca.jenark.autopayphone
1>    App Id: KDR7HRB8ZN.ca.jenark.autopayphone
1>  Process exited with code 1, command:
1>  /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang  -Wno-receiver-forward-class -gdwarf-2 -I/Library/Frameworks/Xamarin.iOS.framework/Versions/11.0.0.0/SDKs/MonoTouch.iphoneos.sdk/usr/include -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS10.3.sdk -Qunused-arguments -miphoneos-version-min=8.0 -arch arm64 -c -o /Users/Jenark/Library/Caches/Xamarin/mtbs/builds/AutoPayPhone.iOS/c111094a34f47094f0e609f125f8434b/obj/iPhone/Release/mtouch-cache/arm64/registrar.o -x objective-c++ /Users/Jenark/Library/Caches/Xamarin/mtbs/builds/AutoPayPhone.iOS/c111094a34f47094f0e609f125f8434b/obj/iPhone/Release/mtouch-cache/64/registrar.m
1>  /Users/Jenark/Library/Caches/Xamarin/mtbs/builds/AutoPayPhone.iOS/c111094a34f47094f0e609f125f8434b/obj/iPhone/Release/mtouch-cache/64/registrar.m:1617:117: error: unknown type name 'CBL2CAPChannel'
1>  static void native_to_managed_trampoline_31 (id self, SEL _cmd, MonoMethod **managed_method_ptr, CBPeripheral * p0, CBL2CAPChannel * p1, NSError * p2, uint32_t token_ref)
1>                                                                                                                      ^ 
1>  /Users/Jenark/Library/Caches/Xamarin/mtbs/builds/AutoPayPhone.iOS/c111094a34f47094f0e609f125f8434b/obj/iPhone/Release/mtouch-cache/64/registrar.m:2968:61: error: expected a type
1>          -(void) peripheral:(CBPeripheral *)p0 didOpenL2CAPChannel:(CBL2CAPChannel *)p1 error:(NSError *)p2;
1>                                                                     ^ 
1>  /Users/Jenark/Library/Caches/Xamarin/mtbs/builds/AutoPayPhone.iOS/c111094a34f47094f0e609f125f8434b/obj/iPhone/Release/mtouch-cache/64/registrar.m:3012:61: error: expected a type
1>          -(void) peripheral:(CBPeripheral *)p0 didOpenL2CAPChannel:(CBL2CAPChannel *)p1 error:(NSError *)p2
1>                                                                     ^ 
1>  /Users/Jenark/Library/Caches/Xamarin/mtbs/builds/AutoPayPhone.iOS/c111094a34f47094f0e609f125f8434b/obj/iPhone/Release/mtouch-cache/64/registrar.m:3015:3: error: no matching function for call to 'native_to_managed_trampoline_31'
1>                  native_to_managed_trampoline_31 (self, _cmd, &managed_method, p0, p1, p2, 0x33004);
1>                  ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1>  /Users/Jenark/Library/Caches/Xamarin/mtbs/builds/AutoPayPhone.iOS/c111094a34f47094f0e609f125f8434b/obj/iPhone/Release/mtouch-cache/64/registrar.m:1617:13: note: candidate function not viable: no known conversion from 'id' to 'int *' for 5th argument
1>  static void native_to_managed_trampoline_31 (id self, SEL _cmd, MonoMethod **managed_method_ptr, CBPeripheral * p0, CBL2CAPChannel * p1, NSError * p2, uint32_t token_ref)
1>              ^ 
1>  4 errors generated.
1>  Process exited with code 1, command:
1>  /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang  -Wno-receiver-forward-class -gdwarf-2 -I/Library/Frameworks/Xamarin.iOS.framework/Versions/11.0.0.0/SDKs/MonoTouch.iphoneos.sdk/usr/include -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS10.3.sdk -Qunused-arguments -miphoneos-version-min=8.0 -arch armv7s -c -o /Users/Jenark/Library/Caches/Xamarin/mtbs/builds/AutoPayPhone.iOS/c111094a34f47094f0e609f125f8434b/obj/iPhone/Release/mtouch-cache/armv7s/registrar.o -x objective-c++ /Users/Jenark/Library/Caches/Xamarin/mtbs/builds/AutoPayPhone.iOS/c111094a34f47094f0e609f125f8434b/obj/iPhone/Release/mtouch-cache/32/registrar.m
1>  /Users/Jenark/Library/Caches/Xamarin/mtbs/builds/AutoPayPhone.iOS/c111094a34f47094f0e609f125f8434b/obj/iPhone/Release/mtouch-cache/32/registrar.m:1617:117: error: unknown type name 'CBL2CAPChannel'
1>  static void native_to_managed_trampoline_31 (id self, SEL _cmd, MonoMethod **managed_method_ptr, CBPeripheral * p0, CBL2CAPChannel * p1, NSError * p2, uint32_t token_ref)
1>                                                                                                                      ^ 
1>  /Users/Jenark/Library/Caches/Xamarin/mtbs/builds/AutoPayPhone.iOS/c111094a34f47094f0e609f125f8434b/obj/iPhone/Release/mtouch-cache/32/registrar.m:2968:61: error: expected a type
1>          -(void) peripheral:(CBPeripheral *)p0 didOpenL2CAPChannel:(CBL2CAPChannel *)p1 error:(NSError *)p2;
1>                                                                     ^ 
1>  /Users/Jenark/Library/Caches/Xamarin/mtbs/builds/AutoPayPhone.iOS/c111094a34f47094f0e609f125f8434b/obj/iPhone/Release/mtouch-cache/32/registrar.m:3012:61: error: expected a type
1>          -(void) peripheral:(CBPeripheral *)p0 didOpenL2CAPChannel:(CBL2CAPChannel *)p1 error:(NSError *)p2
1>                                                                     ^ 
1>  /Users/Jenark/Library/Caches/Xamarin/mtbs/builds/AutoPayPhone.iOS/c111094a34f47094f0e609f125f8434b/obj/iPhone/Release/mtouch-cache/32/registrar.m:3015:3: error: no matching function for call to 'native_to_managed_trampoline_31'
1>                  native_to_managed_trampoline_31 (self, _cmd, &managed_method, p0, p1, p2, 0x32104);
1>                  ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1>  /Users/Jenark/Library/Caches/Xamarin/mtbs/builds/AutoPayPhone.iOS/c111094a34f47094f0e609f125f8434b/obj/iPhone/Release/mtouch-cache/32/registrar.m:1617:13: note: candidate function not viable: no known conversion from 'id' to 'int *' for 5th argument
1>  static void native_to_managed_trampoline_31 (id self, SEL _cmd, MonoMethod **managed_method_ptr, CBPeripheral * p0, CBL2CAPChannel * p1, NSError * p2, uint32_t token_ref)
1>              ^ 
1>  4 errors generated.
1>  Process exited with code 1, command:
1>  /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang  -Wno-receiver-forward-class -gdwarf-2 -I/Library/Frameworks/Xamarin.iOS.framework/Versions/11.0.0.0/SDKs/MonoTouch.iphoneos.sdk/usr/include -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS10.3.sdk -Qunused-arguments -miphoneos-version-min=8.0 -arch armv7 -c -o /Users/Jenark/Library/Caches/Xamarin/mtbs/builds/AutoPayPhone.iOS/c111094a34f47094f0e609f125f8434b/obj/iPhone/Release/mtouch-cache/armv7/registrar.o -x objective-c++ /Users/Jenark/Library/Caches/Xamarin/mtbs/builds/AutoPayPhone.iOS/c111094a34f47094f0e609f125f8434b/obj/iPhone/Release/mtouch-cache/32/registrar.m
1>  /Users/Jenark/Library/Caches/Xamarin/mtbs/builds/AutoPayPhone.iOS/c111094a34f47094f0e609f125f8434b/obj/iPhone/Release/mtouch-cache/32/registrar.m:1617:117: error: unknown type name 'CBL2CAPChannel'
1>  static void native_to_managed_trampoline_31 (id self, SEL _cmd, MonoMethod **managed_method_ptr, CBPeripheral * p0, CBL2CAPChannel * p1, NSError * p2, uint32_t token_ref)
1>                                                                                                                      ^ 
1>  /Users/Jenark/Library/Caches/Xamarin/mtbs/builds/AutoPayPhone.iOS/c111094a34f47094f0e609f125f8434b/obj/iPhone/Release/mtouch-cache/32/registrar.m:2968:61: error: expected a type
1>          -(void) peripheral:(CBPeripheral *)p0 didOpenL2CAPChannel:(CBL2CAPChannel *)p1 error:(NSError *)p2;
1>                                                                     ^ 
1>  /Users/Jenark/Library/Caches/Xamarin/mtbs/builds/AutoPayPhone.iOS/c111094a34f47094f0e609f125f8434b/obj/iPhone/Release/mtouch-cache/32/registrar.m:3012:61: error: expected a type
1>          -(void) peripheral:(CBPeripheral *)p0 didOpenL2CAPChannel:(CBL2CAPChannel *)p1 error:(NSError *)p2
1>                                                                     ^ 
1>  /Users/Jenark/Library/Caches/Xamarin/mtbs/builds/AutoPayPhone.iOS/c111094a34f47094f0e609f125f8434b/obj/iPhone/Release/mtouch-cache/32/registrar.m:3015:3: error: no matching function for call to 'native_to_managed_trampoline_31'
1>                  native_to_managed_trampoline_31 (self, _cmd, &managed_method, p0, p1, p2, 0x32104);
1>                  ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1>  /Users/Jenark/Library/Caches/Xamarin/mtbs/builds/AutoPayPhone.iOS/c111094a34f47094f0e609f125f8434b/obj/iPhone/Release/mtouch-cache/32/registrar.m:1617:13: note: candidate function not viable: no known conversion from 'id' to 'int *' for 5th argument
1>  static void native_to_managed_trampoline_31 (id self, SEL _cmd, MonoMethod **managed_method_ptr, CBPeripheral * p0, CBL2CAPChannel * p1, NSError * p2, uint32_t token_ref)
1>              ^ 
1>  4 errors generated.
1>C:\Program Files (x86)\Microsoft Visual Studio\2017\Professional\MSBuild\Xamarin\iOS\Xamarin.iOS.Common.targets(748,3): error : Failed to compile the generated registrar code. Please file a bug report at http://bugzilla.xamarin.com
Comment 1 Rolf Bjarne Kvinge [MSFT] 2017-09-22 05:33:38 UTC
This can happen in some projects, it's the MT4109 error mentioned in the release notes [1].

This is why the notes mention that Xamarin.iOS 11.0 requires Xcode 9 and its SDK. 

It's not strictly true (it works in some cases) and there are some possible workarounds, but they are not optimal. E.g. since header files will not be available, application performance can suffer since what's can be done at build time needs to be done at startup.

The easiest solution is to update your Mac to use Xcode 9.

However, I'm interested in looking at your exact scenario so that we can try to improve it in the future, so could you attach the following files to the bug report before upgrading Xcode?

> /Users/Jenark/Library/Caches/Xamarin/mtbs/builds/AutoPayPhone.iOS/c111094a34f47094f0e609f125f8434b/obj/iPhone/Release/mtouch-cache/32/registrar.m
> /Users/Jenark/Library/Caches/Xamarin/mtbs/builds/AutoPayPhone.iOS/c111094a34f47094f0e609f125f8434b/obj/iPhone/Release/mtouch-cache/32/registrar.h


[1] https://developer.xamarin.com/releases/ios/xamarin.ios_11/xamarin.ios_11.0/#Requirements