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.42k stars 507 forks source link

[Xcode 11] Communication with Xcode 11 broken (Interface Builder) #6808

Open joeisapro opened 4 years ago

joeisapro commented 4 years ago

Steps to Reproduce

  1. Open Xamarin.iOS project in Visual Studio Mac
  2. Add new Image Set to asset catalog and assign images
  3. Right-click Main.Storyboard and open with Xcode Interface Builder

Expected Behavior

Xcode should open and allow me to edit the Storyboard

Actual Behavior

Communication between Xcode 11 and Visual Studio Mac breaks because Xcode quits unexpectedly.

Environment

=== Visual Studio Enterprise 2019 for Mac ===

Version 8.2.2 (build 44)
Installation UUID: 709d1b72-7ce4-44ca-9125-64a2852b3fef
    GTK+ 2.24.23 (Raleigh theme)
    Xamarin.Mac 5.14.0.85 (d16-2-fix-mac-updates / 86973979)

    Package version: 600000319

=== Mono Framework MDK ===

Runtime:
    Mono 6.0.0.319 (2019-02/52203786470) (64-bit)
    Package version: 600000319

=== NuGet ===

Version: 5.1.0.6013

=== .NET Core ===

Runtime: /usr/local/share/dotnet/dotnet
Runtime Versions:
    2.1.12
    2.1.9
SDK: /usr/local/share/dotnet/sdk/2.1.701/Sdks
SDK Versions:
    2.1.701
    2.1.505
MSBuild SDKs: /Library/Frameworks/Mono.framework/Versions/6.0.0/lib/mono/msbuild/Current/bin/Sdks

=== Xamarin.Profiler ===

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

=== Updater ===

Version: 11

=== Xamarin Designer ===

Version: 16.2.0.401
Hash: a8111869d
Branch: remotes/origin/d16-2-xcode11
Build date: 2019-08-05 20:44:10 UTC

=== Apple Developer Tools ===

Xcode 11.0 (14908.4)
Build 11M382q

=== Xamarin.Mac ===

Version: 5.99.2.40 (Visual Studio Enterprise)
Hash: d883febf
Branch: xcode11
Build date: 2019-08-06 08:33:41-0400

=== Xamarin.Android ===

Not Installed

=== Microsoft Mobile OpenJDK ===

Java SDK: Not Found

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

=== Android Device Manager ===

Version: 1.2.0.58
Hash: d03e3ea
Branch: remotes/origin/d16-2~1
Build date: 2019-08-05 20:08:02 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.iOS ===

Version: 12.99.2.40 (Visual Studio Enterprise)
Hash: d883febf
Branch: xcode11
Build date: 2019-08-06 08:33:40-0400

=== Build Information ===

Release ID: 802020044
Git revision: 2be0fd83c12d2bf1d60b2e5413d8517b8779bb74
Build date: 2019-08-07 07:47:32+00
Build branch: release-8.2-xcode11
Xamarin extensions: 559d23bf0f48ccb83b732417a122fc66e0a2640a

=== Operating System ===

Mac OS X 10.14.6
Darwin 18.7.0 Darwin Kernel Version 18.7.0
    Thu Jun 20 18:42:21 PDT 2019
    root:xnu-4903.270.47~4/RELEASE_X86_64 x86_64

Build Logs

build.log

Example Project (If Possible)

TestImageAssets2.zip

Xcode4Sync.2019-08-20__13-19-28.log

Contents_json.zip

VS bug #969946

joeisapro commented 4 years ago

Looking at the build logs, it's obvious something is wrong since the project doesn't even compile. This is an empty project with 0 lines of code.

If I create an empty project in Xcode 11, add a new Image Set to Assets.xcassets and add the same images - everything compiles fine and runs fine.

joeisapro commented 4 years ago

The Contents.json file in the Xamarin solution looks really different from the one in the Xcode solution.

They both have the same 2 files under Universal, 1x and 2x.

I copied the file from the Xcode solution over the Xamarin one and the solution now builds and I can also open Storyboards with Xcode Interface Builder.

rolfbjarne commented 4 years ago

I can reproduce this with the attached solution. The problem isn't that the project doesn't build (actool crashes, which is an Apple bug), but how the project became unbuildable.

@joeisapro exactly how did you create this project?

joeisapro commented 4 years ago

I created a new single view app from Visual Studio for Mac, then added a new Image Set and 2 images.

Did the exact same thing when creating the Xcode version - which worked fine.

joeisapro commented 4 years ago

It also crashes with an empty Image Set

joeisapro commented 4 years ago

I've added a zip file with the Contents.json file found under Image.imageset, from the Visual Studio solution and the Xcode solution - for reference. As I said, using the one generated by Xcode, in the Visual Studio solution, seems to fix the issue.

rolfbjarne commented 4 years ago

Thanks, I've passed this along to the team responsible for the Xcode integration.