Notice (2018-05-24): bugzilla.xamarin.com is now in
Please join us on
Visual Studio Developer Community and in the
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
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.
Various members of my team get this error dialog periodically when trying to open a XIB file from MonoDevelop.
We haven't been able to track down exactly what causes the error to appear. The basic setup is a directory of custom view controllers (each with .cs, .designer.cs, .xib). Some of the XIB files contain outlets that are custom UIViews. The custom UIViews live in a different assembly and namespace from the view controllers. It is these outlets that Xcode can't resolve. It seems like it happens when one team member modifies either one of the view controllers or one of the custom views.
Once the error appears then the only thing that fixes it is force-syncing the directories containing the XIBs and the custom views. Some things that don't fix the problem include: restarting MonoDevelop, restarting Xcode, deleting the directory containing the generated Xcode project.
Here's the text of the error:
An error has occurred:
Error updating Xcode project. Could not generate outlet 'MyOutletThatsACustomUIView' in class 'MyCompany.MyNamespace.MyUIViewController' as its type 'MyCompany.MyOtherNamespace.MyCustomUIView' could not be resolved to Obj-C
MonoDevelop.MacDev.ObjCIntegration.ObjectiveCGenerationException: Could not generate outlet 'MyOutletThatsACustomUIView' in class 'MyCompany.MyNamespace.MyUIViewController' as its type 'MyCompany.MyOtherNamespace.MyCustomUIView' could not be resolved to Obj-C
at MonoDevelop.MacDev.ObjCIntegration.NSObjectTypeInfo.GenerateObjcType (System.String directory, System.String frameworks) [0x001e8] in /Users/builder/data/lanes/monodevelop-mac-126.96.36.199/cc9fe83c/source/monodevelop/main/src/addins/MonoDevelop.MacDev/ObjCIntegration/NSObjectTypeInfo.cs:159
at MonoDevelop.MacDev.XcodeSyncing.XcodeSyncedType.SyncOut (IProgressMonitor monitor, MonoDevelop.MacDev.XcodeSyncing.XcodeSyncContext context) [0x0001b] in /Users/builder/data/lanes/monodevelop-mac-188.8.131.52/cc9fe83c/source/monodevelop/main/src/addins/MonoDevelop.MacDev/XcodeSyncing/XcodeSyncedType.cs:79
at MonoDevelop.MacDev.XcodeSyncing.XcodeMonitor.UpdateProject (IProgressMonitor monitor, System.Collections.Generic.List`1 allItems, MonoDevelop.MacDev.XcodeIntegration.XcodeProject emptyProject) [0x002e3] in /Users/builder/data/lanes/monodevelop-mac-184.108.40.206/cc9fe83c/source/monodevelop/main/src/addins/MonoDevelop.MacDev/XcodeSyncing/XcodeMonitor.cs:152
at MonoDevelop.MacDev.XcodeSyncing.XcodeProjectTracker.UpdateXcodeProject (IProgressMonitor monitor) [0x00000] in /Users/builder/data/lanes/monodevelop-mac-220.127.116.11/cc9fe83c/source/monodevelop/main/src/addins/MonoDevelop.MacDev/XcodeSyncing/XcodeProjectTracker.cs:392
This has been happening through a few MonoTouch updates, but here's my current version info:
Installation UUID: 1480f558-ce01-4cc9-8f58-058dda76f061
Mono 2.10.9 (tarball Tue Mar 20 15:31:37 EDT 2012)
Apple Developer Tools:
Xcode 4.3.1 (1176)
Mono for Android not installed
Someone else just hit this on the mailing-list as well and I'd really like to solve this but I have no idea what is causing this to happen.
If this happens again, would it be possible for you to zip up your project and let us take a look at it and see what is going wrong?
If you attach it here, you can mark it as private by checking the checkbox labeled "Make attachment and comment private" (you'll see it on the "Add an attachment" screen).
I was just look at this code and trying to help someone else with their project and hit something similar.
Take a look at MyCompany.MyOtherNamespace.MyCustomUIView and make sure that it has a [Register] attribute on the class definition.
That should fix the issue.
Now the question is whether or not we can work around users not tagging some of their custom base classes with [Register]...
All of the views I've checked do have the [MonoTouch.Foundation.Register("MyCustomUIView")] attribute. In some cases, the attribute is inside a #if block (but the enabled case of it, so I don't think that should matter).
I was able to reproduce this again. I tried to zip up my project to send it to you, but found it's not reproducible after unzipping the zipped project! I also tried copying some parts of my project to a new directory, but the bug disappeared in that copy too. However, the original project still exhibits the error (but I'm guessing that force syncing the directories containing the XIBs and custom views will fix it again).
Let me know if there's anything else I can try.
*** This bug has been marked as a duplicate of bug 4562 ***
I have checked if the [Register] attribute was on my classes and indeed it was. However this morning it just magically started working again. If it makes any difference, the debugger was running and connected to the simulator when I tried to open the xib.
Once it opened successfully, it seems to continue working again afterwards, even if the debugger isn't running. Im not sure if this is a coincidence, but just thought id mention it.
As a temporary workaround, could you guys try deleting all of the *.pidb files in your project?
These files are auto-generated by MonoDevelop and may be corrupt, which might be causing the problem you guys are seeing.
Oh, I should maybe re-word my previous comment:
Instead of deleting them, perhaps you could just move them somewhere else so that you can send them to us if this does actually fix the problem.
Someone else who reported this issue to me on friday emailed me back saying that deleting his *.pidb files fixed it for him (after I suggested that he could try that).
This is fixed in MonoDevelop 2.9.5 alpha