Bug 44817 - iOS: Failed to compile the generated registrar code.
Summary: iOS: Failed to compile the generated registrar code.
Status: RESOLVED ANSWERED
Alias: None
Product: iOS
Classification: Xamarin
Component: Xamarin.iOS.dll ()
Version: XI 10.0 (iOS10)
Hardware: PC Windows
: --- normal
Target Milestone: Untriaged
Assignee: Rolf Bjarne Kvinge [MSFT]
URL:
Depends on:
Blocks:
 
Reported: 2016-09-28 09:53 UTC by tjsmithdeveloper
Modified: 2016-10-03 06:11 UTC (History)
2 users (show)

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


Attachments
iOS Build Log (216.93 KB, text/plain)
2016-09-28 09:53 UTC, tjsmithdeveloper
Details


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 tjsmithdeveloper 2016-09-28 09:53:50 UTC
Created attachment 17779 [details]
iOS Build Log

I've been writing an iOS app for a few months. Testing it on the simulator and my iPad device. A couple of weeks ago I got this error when I tried to compile it for the iPad.

error : Failed to compile the generated registrar code. Please file a bug report at http://bugzilla.xamarin.com

I'm using Visual Studio 2015 (Community version) with the Xamarin plugin. I have a MacBook Pro that I'm using as a Mac Agent.

I then decided to upgrade all software to the latest (Xcode, Xamarin) to see if that fixed the error. But I'm still getting this error. It compiles and runs fine on the simulator, but I get this error when I try to compile for the device.
Comment 1 Rolf Bjarne Kvinge [MSFT] 2016-09-28 17:37:04 UTC
Could you please attach these two files?

    /Users/TJ/Library/Caches/Xamarin/mtbs/builds/CoffeeIOS2/22b64b3ea55d51d722a8f06b2c1320b2/obj/iPhone/Debug/mtouch-cache/64/registrar.m
    /Users/TJ/Library/Caches/Xamarin/mtbs/builds/CoffeeIOS2/22b64b3ea55d51d722a8f06b2c1320b2/obj/iPhone/Debug/mtouch-cache/64/registrar.h
Comment 2 tjsmithdeveloper 2016-10-01 05:09:04 UTC
Hi Rolf,

Firstly, I could not find the files you mentioned. In fact that whole directory structure does not exist. Is this a temporary compile folder that gets deleted after compilation? I'm fairly new to Mac computers. However, I was looking through the build log again and noticed that the error was pointing to a file called UIButtonTypeSystem.cs. I did not create this file in my project and I don't know how it got there. So I deleted it from my project, and the app recompiled successfully (for the device).

But this has presented me with another (unrelated) issue. Even though the app compiled successfully, I could not launch the app on my iPad. I'm using an old iPad 2 for my testing. Since upgrading Xcode to version 8.0 (iOS 10.0) the old iPad 2's cannot upgrade it's OS to version 10.0. It's stuck on version 9.3.5.

After looking on the internet I saw suggestions about copying the old SDK 9.3 from Xcode 7 into the new SDK path of Xcode 8. But this didn't seem to work. I'm still getting errors about the SDK version.

I guess the only other way to use my old iPad for testing is to uninstall version 8.0 of Xcode and go back to version 7.
Comment 3 Rolf Bjarne Kvinge [MSFT] 2016-10-03 06:11:38 UTC
(In reply to tjsmithdeveloper from comment #2)
> Hi Rolf,
> 
> Firstly, I could not find the files you mentioned. In fact that whole
> directory structure does not exist. Is this a temporary compile folder that
> gets deleted after compilation? I'm fairly new to Mac computers. However, I
> was looking through the build log again and noticed that the error was
> pointing to a file called UIButtonTypeSystem.cs. I did not create this file
> in my project and I don't know how it got there. So I deleted it from my
> project, and the app recompiled successfully (for the device).

Ok, I'm closing this bug report then, since the build is working for you now.

> But this has presented me with another (unrelated) issue. Even though the
> app compiled successfully, I could not launch the app on my iPad. I'm using
> an old iPad 2 for my testing. Since upgrading Xcode to version 8.0 (iOS
> 10.0) the old iPad 2's cannot upgrade it's OS to version 10.0. It's stuck on
> version 9.3.5.

If launching doesn't work, it's a bug somewhere, but more information is needed (crash reports, device log, etc) to diagnose. Please open a different bug (since it's an unrelated issue) and provide this information, and we'll have a look.

> 
> After looking on the internet I saw suggestions about copying the old SDK
> 9.3 from Xcode 7 into the new SDK path of Xcode 8. But this didn't seem to
> work. I'm still getting errors about the SDK version.
> 
> I guess the only other way to use my old iPad for testing is to uninstall
> version 8.0 of Xcode and go back to version 7.

There's no reason that you can't use Xcode 8 to deploy to your iPad 2, even though your iPad can't upgrade to iOS 10.