Bug 58198 - Attempting to add Outlet in Xcode 9 IB: Could not insert new outlet connection: Could not find any information for the class named ...
Summary: Attempting to add Outlet in Xcode 9 IB: Could not insert new outlet connectio...
Status: VERIFIED FIXED
Alias: None
Product: Xamarin Studio
Classification: Desktop
Component: iOS add-in (show other bugs)
Version: unspecified
Hardware: PC Mac OS
: --- normal
Target Milestone: 15.4
Assignee: Jeffrey Stedfast
URL:
: 59616 59632 59645 59791 (view as bug list)
Depends on:
Blocks: 59616
  Show dependency tree
 
Reported: 2017-07-17 20:17 UTC by Larry O'Brien
Modified: 2017-10-18 16:31 UTC (History)
22 users (show)

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


Attachments
Screen cast showing behavior (2.67 MB, video/mp4)
2017-07-17 20:17 UTC, Larry O'Brien
Details
VSMac Project with behavior (19.92 KB, application/zip)
2017-07-17 20:18 UTC, Larry O'Brien
Details

Description Larry O'Brien 2017-07-17 20:17:00 UTC
Created attachment 23609 [details]
Screen cast showing behavior

In the attached project, in the watchOS extension solution, I have `class InterfaceController : WKInterfaceController` and Interface.storyboard in the watch project. When I open Interface.storyboard in Xcode 9 Interface Builder and open the Assistant Editor, I see the expected Obj-C header for `InterfaceController` ("This file has been generated automatically" etc.)

When I control-drag from the button on the storyboard into the Assistant Editor, I see the expected "Insert Outlet or Action" dialog, but after entering a name, Xcode says "Could not insert new outlet connection: Could not find any information for the class named InterfaceController." 

I have attached a screencast showing the behavior.
Comment 1 Larry O'Brien 2017-07-17 20:18:50 UTC
Created attachment 23610 [details]
VSMac Project with behavior
Comment 2 Alex Soto [MSFT] 2017-07-17 23:16:32 UTC
I am unsure if this is the right Component for Xcode 9 Interface Builder integration
Comment 3 Larry O'Brien 2017-07-18 21:54:51 UTC
UPDATE: I am seeing this same behavior in non-WatchOS projects. For instance, I see it in a standard single-view C# iOS app. I think it may be something with my configuration. Not sure how to help in terms of tracking things down, though.
Comment 4 Jeffrey Stedfast 2017-07-19 15:02:11 UTC
So this just worked for me, but I noticed afterward that when I clicked on the split-screen toolbar button in Xcode, it showed me the .m file instead of the .h file when I opened the storyboard.

Perhaps you need to drag&drop outlets to the .m file now?
Comment 5 Jeffrey Stedfast 2017-07-19 15:05:40 UTC
I was just about to try and repeat this using the .h file but I can't get Xcode to show me the .h side-by-side with the storyboard. No matter what order I open files, it always swaps out the .h and shows me the .m instead.
Comment 6 Jeffrey Stedfast 2017-08-08 21:03:34 UTC
I've been playing with this again (Xcode9beta4 and Xcode9beta5) but still have problems reproducing.

A few notes:

1. I can't add buttons to Watch interfaces - Xcode says it's not allowed. Rather, I *can* add them visually, but Xcode has an error notice in the UI represented as a red stop sign thingy in the status bar, which, when I hover over it, says it's not allowed.

2. Xcode doesn't seem to allow me to add Outlets to .h files, only .m files. I tested this using standard iOS storyboards - only Actions can be added to .h files.
Comment 7 Brendan Zagaeski (Xamarin Support) 2017-09-20 03:02:52 UTC
I wonder if Xcode 9 has changed when it chooses to create its "indexes" for projects.

See for example similar error messages mentioned by users in the past who were using Xcode directly and had changed the indexing settings, such as: https://stackoverflow.com/a/18010619/2561894.
Comment 8 Matt Cuda 2017-09-20 17:12:43 UTC
I am seeing the same type of behavior in XCode 9, but in a non-appwatch project.
Comment 9 Brendan Zagaeski (Xamarin Support) 2017-09-20 18:01:44 UTC
## One possible temporary workaround

Create the outlet code in the .h file by hand first, and then drag a connection from the control in the interface builder to that line of code.

(From https://forums.xamarin.com/discussion/comment/297528/#Comment_297528.)




## Bookkeeping note

I have removed the phrase "for watchOS project" from the bug summary (title) based on Comment 3.
Comment 10 Vincent Dondain [MSFT] 2017-09-20 18:10:57 UTC
*** Bug 59616 has been marked as a duplicate of this bug. ***
Comment 11 Vincent Dondain [MSFT] 2017-09-20 18:12:48 UTC
An other workaround here is to use Xcode 8.

Marking this bug as confirmed as I could confirm this issue with the following environment: https://gist.github.com/VincentDondain/24198e83f20d360665c1aa651418d38c

I created a new iOS project, opened the storyboard in Xcode, added a button, and tried to link it to the ViewController.h file (outlet) and got "Could not insert new outlet connection: Could not find any information for the class named XXX"
Comment 12 Jeffrey Stedfast 2017-09-20 18:15:17 UTC
Following the directions in bug #59616 I was able to reproduce the bug in Xcode.

Unfortunately, I don't know what we can do about it if there even *is* anything we can do about it.

See https://stackoverflow.com/a/34082979/87117 for work-arounds while in Xcode (apparently users get this problem who are doing all of the development in Xcode, not just exporting from Visual Studio for Mac).
Comment 13 Brendan Zagaeski (Xamarin Support) 2017-09-20 18:24:44 UTC
It seems the issue with the Xamarin-generated projects behaves a bit differently compared to the indexing issue described on Stack Overflow by users working purely in Xcode.  To make one guess, maybe there is a setting that needs to be changed or added (perhaps in the *.xcodeproj/*.pbxproj file) to allow Xcode 9 to treat the .h files as expected?
Comment 14 Vincent Dondain [MSFT] 2017-09-20 18:28:13 UTC
Yea could be it, maybe what we generate in obj/Xcode *.xcodeproj/*.pbxproj aren't valid anymore with Xcode 9
Comment 15 Jeffrey Stedfast 2017-09-20 20:45:53 UTC
https://github.com/xamarin/md-addins/pull/2466

That PR is a running list of changes to try and throw darts at a dart board in pitch blackness in an attempt to hit the bullseye to solve this bug.
Comment 16 Sebastien Pouliot 2017-09-21 13:24:12 UTC
*** Bug 59632 has been marked as a duplicate of this bug. ***
Comment 18 Brendan Zagaeski (Xamarin Support) 2017-09-21 20:15:42 UTC
## Tallying additional user reports

- 3 users: https://forums.xamarin.com/discussion/103643/designer-outlet-no-connection/p1 (2017-09-21)
- 2 users: https://forums.xamarin.com/discussion/103674/missing-h-files-in-assistant-editor-with-xcode-h-files-are-shown-but-cant-sync/p1 (2017-09-21)
Comment 19 Brendan Zagaeski (Xamarin Support) 2017-09-21 20:24:29 UTC
## Updating test build download link and marking old download link in Comment 17 as non-public

Update to the comment from Jeffrey Stedfast from comment #17:

Here's a build that someone can test: https://dl.xamarin.com/uploads/jxmrflbk1ag/VisualStudioForMac-Preview-7.4.0.45.dmg

I have no idea if it's fixed or not because it worked fine for me when trying to repro with Larry's test case (multiple times) but failed for me when trying a different test case.

It seems to always work for me now, but it might just be pure random luck. Vincent says it still doesn't work for him.

I don't know what to conclude :(
Comment 20 Larry O'Brien 2017-09-21 21:02:37 UTC
Using the 7.4.0.45.dmg above, I no longer see the issue. I checked four different projects where I saw the issue previously. 

The following are what my versions _were_, and then what my versions _are_ subsequent to installing 7.4.0.45:

PRIOR TO WOMM:

Versions:

=== Visual Studio Community 2017 for Mac (Preview) ===

Version 7.1 Preview (7.1 build 1267)
Installation UUID: 6b94f136-026d-4a5a-bf6d-af2c0d8dc019
Runtime:
	Mono 5.2.0.196 (2017-04/478c04a) (64-bit)
	GTK+ 2.24.23 (Raleigh theme)

	Package version: 502000196

=== NuGet ===

Version: 4.3.0.2418

=== .NET Core ===

Runtime: Not installed
SDK: Not installed
MSBuild SDKs: /Library/Frameworks/Mono.framework/Versions/5.2.0/lib/mono/msbuild/15.0/bin/Sdks

=== Xamarin.Profiler ===

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

=== Apple Developer Tools ===

Xcode 9.0 (13247)
Build 9A235

=== Xamarin.iOS ===

Version: 10.99.8.54 (Visual Studio Community)
Hash: 27b15fae
Branch: xcode9
Build date: 2017-09-13 13:34:51-1000

=== Xamarin.Android ===

Version: 7.3.1.2 (Visual Studio Community)
Android SDK: /Users/larryobrien/Library/Developer/Xamarin/android-sdk-macosx
	Supported Android versions:
		2.3   (API level 10)
		4.0.3 (API level 15)
		4.4   (API level 19)
		5.0   (API level 21)
		5.1   (API level 22)
		6.0   (API level 23)

SDK Tools Version: 25.2.5
SDK Platform Tools Version: 25.0.5
SDK Build Tools Version: 25.0.3

Java SDK: /usr
java version "1.8.0_144"
Java(TM) SE Runtime Environment (build 1.8.0_144-b01)
Java HotSpot(TM) 64-Bit Server VM (build 25.144-b01, mixed mode)

Android Designer EPL code available here:
https://github.com/xamarin/AndroidDesigner.EPL

=== Xamarin.Mac ===

Version: 3.99.8.54 (Visual Studio Community)

=== Xamarin Inspector ===

Version: 1.3.0
Hash: 8c298a5
Branch: 1.3-release
Build date: Thu, 14 Sep 2017 21:21:26 GMT
Client compatibility: 1

=== Build Information ===

Release ID: 701001267
Git revision: 342f47be42098b95880cf4c6d957719b5fef53e3
Build date: 2017-07-12 17:43:22-04
Xamarin addins: e513cc1830b4daa75f67c608e2c722e811b23ab2
Build lane: monodevelop-lion-d15-3-xcode9

=== Operating System ===

Mac OS X 10.12.6
Darwin 16.7.0 Darwin Kernel Version 16.7.0
    Thu Jun 15 17:36:27 PDT 2017
    root:xnu-3789.70.16~2/RELEASE_X86_64 x86_64




NEW VERSIONS THAT MAKE IT WOMM:

=== Visual Studio Community 2017 for Mac (Preview) ===

Version 7.4 Preview (7.4 build 45)
Installation UUID: 6b94f136-026d-4a5a-bf6d-af2c0d8dc019
Runtime:
	Mono 5.2.0.196 (2017-04/478c04a) (64-bit)
	GTK+ 2.24.23 (Raleigh theme)

	Package version: 502000196

=== NuGet ===

Version: 4.3.1.4445

=== .NET Core ===

Runtime: Not installed
SDK: Not installed
MSBuild SDKs: /Library/Frameworks/Mono.framework/Versions/5.2.0/lib/mono/msbuild/15.0/bin/Sdks

=== Xamarin.Profiler ===

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

=== Apple Developer Tools ===

Xcode 9.0 (13247)
Build 9A235

=== Xamarin.iOS ===

Version: 10.99.8.54 (Visual Studio Community)
Hash: 27b15fae
Branch: xcode9
Build date: 2017-09-13 13:34:51-1000

=== Xamarin.Android ===

Version: 7.3.1.2 (Visual Studio Community)
Android SDK: /Users/larryobrien/Library/Developer/Xamarin/android-sdk-macosx
	Supported Android versions:
		2.3   (API level 10)
		4.0.3 (API level 15)
		4.4   (API level 19)
		5.0   (API level 21)
		5.1   (API level 22)
		6.0   (API level 23)

SDK Tools Version: 25.2.5
SDK Platform Tools Version: 25.0.5
SDK Build Tools Version: 25.0.3

Java SDK: /usr
java version "1.8.0_144"
Java(TM) SE Runtime Environment (build 1.8.0_144-b01)
Java HotSpot(TM) 64-Bit Server VM (build 25.144-b01, mixed mode)

Android Designer EPL code available here:
https://github.com/xamarin/AndroidDesigner.EPL

=== Xamarin Inspector ===

Version: 1.3.0
Hash: 8c298a5
Branch: 1.3-release
Build date: Thu, 14 Sep 2017 21:21:26 GMT
Client compatibility: 1

=== Xamarin.Mac ===

Version: 3.99.8.54 (Visual Studio Community)

=== Build Information ===

Release ID: 704000045
Git revision: 489a2f776811a93a926f16f3409a7d82806dd391
Build date: 2017-09-21 13:04:52-04
Xamarin addins: 95666ed5003ac406eea308d87f4e2acb2a31b7c6
Build lane: monodevelop-lion-jstedfast-xcode9-sync

=== Operating System ===

Mac OS X 10.12.6
Darwin 16.7.0 Darwin Kernel Version 16.7.0
    Thu Jun 15 17:36:27 PDT 2017
    root:xnu-3789.70.16~2/RELEASE_X86_64 x86_64
Comment 21 Brendan Zagaeski (Xamarin Support) 2017-09-21 22:39:41 UTC
To add one more verification testing data point for the candidate fixes, the 7.4.0.45.dmg is working well for me too in my quick tests with Single View template projects (where I had previously hit the error on every attempt).

I also quickly checked backwards-compatibility with Xcode 8.3.3, and the "Open with Xcode Interface Builder" worked well for me there too.

(As expected, due to the updated `compatibilityVersion = "Xcode 8.0"` setting in the generated .pbxproj, the generated Xcode project is not backwards-compatible wth Xcode 7.3.  Xcode 7.3 shows an error alert "Failed to load project ... incompatible project version." when attempting to open the project.  But in fact, the Single View project templates in Visual Studio for Mac 7.1.5.2 were already using Xcode 8.0 storyboards, so they had already dropped backwards-compatibility with Xcode 7.3.)
Comment 22 Christophe C 2017-09-22 06:58:04 UTC
Hey guys, 

I confirmed it's working with the build 7.4.0.45 of Visual Studio for Mac that @Brendan Zagaeski sent.
Comment 24 Jock Findlay 2017-09-23 00:28:17 UTC
Hi,

Confirmed fixed in build Version 7.4 Preview (7.4 build 45).

Thanks Brendan!
Comment 25 Brendan Zagaeski (Xamarin Support) 2017-09-23 00:51:12 UTC
*** Bug 59645 has been marked as a duplicate of this bug. ***
Comment 26 Brendan Zagaeski (Xamarin Support) 2017-09-25 06:43:25 UTC
Happy to have helped surface the information about the candidate build!  My thanks in turn to Jeff for the quick work on preparing the fixes and the candidate build!
Comment 27 Vincent Dondain [MSFT] 2017-09-25 19:44:19 UTC
I can also confirm it's fixed for me.

Somehow in my Xcode.app's `Preferences > Locations > Command line tool`, I didn’t have anything selected. Changing this to Xcode 9.0 fixed it (only with the updated VSMac version referenced above).

https://www.dropbox.com/s/1i9tqiz652dt4l3/Screenshot%202017-09-25%2015.30.09.png?dl=0
Comment 28 David Messina 2017-09-27 19:17:00 UTC
The preview build only fixed it for me when loading a solution that is stored directly on the Mac. If I am loading a solution via a Windows shared folder (either regular SMB or AFP using Acronis Files Connect), even a brand new one created solely for testing this, the problem persists. This was working without issue prior to the iOS 11 Visual Studio and Xcode updates. I have been struggling with this for days now and don't know what else to do.
Comment 29 Brendan Zagaeski (Xamarin Support) 2017-09-27 19:23:05 UTC
> loading a solution via a Windows shared folder

To be on the safe side, it might be best if you get a chance to file a new bug report for that scenario so that fixes for the shared folder scenario will have a clean starting point for investigation.  You can comment back on this bug report with the new bug number to make sure the relation between the two bug reports is recorded.  Thanks in advance!
Comment 30 David Messina 2017-09-27 20:30:10 UTC
Created bug 59800
Comment 31 Jelle 2017-09-28 14:11:00 UTC
I can also confirm it's fixed for me.
Comment 34 Brendan Zagaeski (Xamarin Support) 2017-09-29 17:15:44 UTC
*** Bug 59791 has been marked as a duplicate of this bug. ***
Comment 35 softlion 2017-09-30 08:39:40 UTC
Is this beta version "go live" ?
Comment 36 softlion 2017-09-30 08:45:52 UTC
dl.xamarin.com and release.xamarin.com are currently offline/broken.
Comment 37 Seifer 2017-10-02 18:11:17 UTC
Any ETA when this fix can be available from the Stable/Beta channels?
Comment 38 Brendan Zagaeski (Xamarin Support) 2017-10-02 21:40:02 UTC
The candidate fix for this issue has now been added to today's Visual Studio 2017 for Mac version 15.4.0 Preview 4 (7.2.0.634 cab57de), now available on the Beta updater channel (https://docs.microsoft.com/visualstudio/mac/update).

I have locally double-checked that this new Visual Studio for Mac preview version matches the behavior of the earlier experimental build from Comment 19, so I will mark the bug as verified accordingly.

(Note that investigation will continue on Bug 59800 about the additional behavior involving projects on Windows file shares.)


## Verification status

GOOD: Visual Studio 2017 for Mac (7.2.0.634 cab57de)
BAD:  Visual Studio 2017 for Mac (7.2.0.617 f857140)
BAD:  Visual Studio 2017 for Mac (7.1.5.2   7afedca)
Comment 39 Jock Findlay 2017-10-06 18:24:48 UTC
I am unable to add outlets or actions when editing in interface builder.
Beta channel build 7.2 Preview (7.2 build 634)
I also can't add an action to my UIButton subclass in iOS Designer.
:pcrage:
Comment 40 softlion 2017-10-18 11:47:30 UTC
@Jock: if your project is on a windows share (smb or cifs), it won't work because of https://bugzilla.xamarin.com/show_bug.cgi?id=59800 which seems to have been forgotten, even in 7.3 on beta channel.
Comment 41 Jock Findlay 2017-10-18 16:31:17 UTC
@softlion: Apologies, this is fixed for me now in Version 7.3 Preview (7.3 build 692). I'm not using a windows share.

Note You need to log in before you can comment on or make changes to this bug.