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.49k stars 515 forks source link

Error: Cannot find protocol declaration for NSFileProviderItemDecorating or NSFileProviderItemFlags (Xcode 12, Xamarin.iOS 14.0.0.0) #9657

Closed beeradmoore closed 4 years ago

beeradmoore commented 4 years ago

Steps to Reproduce

Unsure how to publicly reproduce. If I delete bin/obj directories, open my closed source Xamarin.Forms app and try to debug on my iPhone running iOS 14 GM I get build errors. Builds and deploys fine to iPhone Simulator running iOS 14.

Expected Behavior

App deploys and runs fine.

Actual Behavior

App fails to build.

Environment

Visual Studio Community 2019 for Mac (Preview)
Version 8.8 Preview (8.8 build 2120)
Installation UUID: a496e6b4-dbc5-49d6-b47f-21a6f65c4f37
    GTK+ 2.24.23 (Raleigh theme)
    Xamarin.Mac 6.18.0.23 (d16-6 / 088c73638)

    Package version: 612000093

Mono Framework MDK
Runtime:
    Mono 6.12.0.93 (2020-02/620cf538206) (64-bit)
    Package version: 612000093

Roslyn (Language Service)
3.8.0-2.20414.4+beada51586dedc46a7fe5ca381ffb10e2b177070

NuGet
Version: 5.8.0.6783

.NET Core SDK
SDK: /usr/local/share/dotnet/sdk/3.1.402/Sdks
SDK Versions:
    3.1.402
    3.1.401
    3.1.302
    3.1.301
    3.1.300
    3.1.202
    2.1.806
MSBuild SDKs: /Applications/Visual Studio.app/Contents/Resources/lib/monodevelop/bin/MSBuild/Current/bin/Sdks

.NET Core Runtime
Runtime: /usr/local/share/dotnet/dotnet
Runtime Versions:
    3.1.8
    3.1.7
    3.1.6
    3.1.5
    3.1.4
    3.0.3
    2.1.22
    2.1.21
    2.1.20
    2.1.19
    2.1.18

.NET Core 2.1 SDK
SDK: 2.1.806

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

Updater
Version: 11

Xamarin.Android
Version: 11.1.0.3 (Visual Studio Community)
Commit: xamarin-android/d16-8/b352be8
Android SDK: /Users/bradmoore/Library/Developer/Xamarin/android-sdk-macosx
    Supported Android versions:
        8.0 (API level 26)

SDK Tools Version: 26.1.1
SDK Platform Tools Version: 30.0.4
SDK Build Tools Version: 30.0.2

Build Information: 
Mono: 83105ba
Java.Interop: xamarin/java.interop/d16-8@a807961
ProGuard: Guardsquare/proguard/proguard6.2.2@ebe9000
SQLite: xamarin/sqlite/3.32.1@1a3276b
Xamarin.Android Tools: xamarin/xamarin-android-tools/d16-8@2fb1cbc

Microsoft OpenJDK for Mobile
Java SDK: /Users/bradmoore/Library/Developer/Xamarin/jdk/microsoft_dist_openjdk_1.8.0.25
1.8.0-25
Android Designer EPL code available here:
https://github.com/xamarin/AndroidDesigner.EPL

Android SDK Manager
Version: 16.8.0.20
Hash: fdef874
Branch: remotes/origin/master
Build date: 2020-09-03 22:22:24 UTC

Android Device Manager
Version: 16.8.0.28
Hash: 8522e27
Branch: remotes/origin/master
Build date: 2020-09-03 22:22:50 UTC

Apple Developer Tools
Xcode 12.0 (17219)
Build 12A7209

Xamarin.Mac
Version: 6.22.1.23 (Visual Studio Community)
Hash: 8318026f1
Branch: d16-8
Build date: 2020-09-01 14:15:21-0400

Xamarin.iOS
Version: 13.22.1.23 (Visual Studio Community)
Hash: 8318026f1
Branch: d16-8
Build date: 2020-09-01 14:15:22-0400

Xamarin Designer
Version: 16.8.0.471
Hash: ce5800ecd
Branch: remotes/origin/d16-8
Build date: 2020-09-02 19:21:16 UTC

Build Information
Release ID: 808002120
Git revision: 3925df4356a7f10b6951f10e0f88ceecb8e66a23
Build date: 2020-09-09 08:15:50-04
Build branch: release-8.8
Xamarin extensions: 3925df4356a7f10b6951f10e0f88ceecb8e66a23

Operating System
Mac OS X 10.15.6
Darwin 19.6.0 Darwin Kernel Version 19.6.0
    Thu Jun 18 20:49:00 PDT 2020
    root:xnu-6153.141.1~1/RELEASE_X86_64 x86_64

Enabled user installed extensions
MFractor 4.3.2

It probably mentions it in all of the above, but I am using Xamarin.iOS 14.0.0.0 from here which I found via #8931, and using the Xcode 12 GM seed which was download ~4 hours ago so I shouldn't have been hit with the Xcode GM seed cache issue which others were reporting online.

Build Logs

This is a partial build log,

Target _CompileToNative:
    /Library/Frameworks/Xamarin.iOS.framework/Versions/Current/bin/mtouch @/Users/bradmoore/git/SomeProject/SomeProject/Software/SomeProject.Forms/SomeProject.iOS/obj/iPhone/Debug/device-builds/iphone12.5-14.0/response-file.rsp --optimize=experimental-xforms-product-type 
    Xamarin.iOS 13.22.1.23 (d16-8: 8318026f1 using framework: /Applications/Xcode-12.0.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS14.0.sdk
    MTOUCH : warning MT0109: The assembly 'System.Security.Cryptography.Cng.dll' was loaded from a different path than the provided path (provided path: /Users/bradmoore/.nuget/packages/system.security.cryptography.cng/4.5.0/runtimes/win/lib/netstandard1.6/System.Security.Cryptography.Cng.dll, actual path: /Library/Frameworks/Xamarin.iOS.framework/Versions/13.22.1.23/lib/mono/Xamarin.iOS/Facades/System.Security.Cryptography.Cng.dll).

    MTOUCH : warning MT2003: Option '--optimize=experimental-xforms-product-type' will be ignored since linking is disabled

    MTOUCH : warning MT0127: Incremental builds have been disabled because this version of Xamarin.iOS does not support incremental builds in projects that include more than one third-party binding libraries.

    Compilation failed with code 1, command:
    /Applications/Xcode-12.0.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang++ -Wno-receiver-forward-class -Wno-objc-missing-super-calls -Wno-unguarded-availability-new -stdlib=libc++ -gdwarf-2 -std=c++14 -I/Library/Frameworks/Xamarin.iOS.framework/Versions/13.22.1.23/SDKs/MonoTouch.iphoneos.sdk/include -isysroot /Applications/Xcode-12.0.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS14.0.sdk -Qunused-arguments -miphoneos-version-min=9.0 -arch arm64 -c -o /Users/bradmoore/git/SomeProject/SomeProject/Software/SomeProject.Forms/SomeProject.iOS/obj/iPhone/Debug/device-builds/iphone12.5-14.0/mtouch-cache/arm64/registrar.o -x objective-c++ -D DEBUG /Users/bradmoore/git/SomeProject/SomeProject/Software/SomeProject.Forms/SomeProject.iOS/obj/iPhone/Debug/device-builds/iphone12.5-14.0/mtouch-cache/registrar.m
    /Users/bradmoore/git/SomeProject/SomeProject/Software/SomeProject.Forms/SomeProject.iOS/obj/iPhone/Debug/device-builds/iphone12.5-14.0/mtouch-cache/registrar.m(64198,4): error GBDAA8BF8: cannot find protocol declaration for 'NSFileProviderItemDecorating'
                    @protocol (NSFileProviderItemDecorating), /* FileProvider.INSFileProviderItemDecorating */
                     ^
    /Users/bradmoore/git/SomeProject/SomeProject/Software/SomeProject.Forms/SomeProject.iOS/obj/iPhone/Debug/device-builds/iphone12.5-14.0/mtouch-cache/registrar.m(64199,4): error GBDAA8BF8: cannot find protocol declaration for 'NSFileProviderItemFlags'
                    @protocol (NSFileProviderItemFlags), /* FileProvider.INSFileProviderItemFlags */
                     ^
    2 errors generated.
    MTOUCH : error MT4109: Failed to compile the generated registrar code. Please file a bug report at https://github.com/xamarin/xamarin-macios/issues/new
Done building target "_CompileToNative" in project "SomeProject.iOS.csproj" -- FAILED.

This is the main bit about the warnings, I can send entire build log (built with -v -v -v -v) to a Xamarin/MS staffer as I would rather not post it publicly.

Example Project (If Possible)

I am not able to provide an example project. I don't know what NSFileProviderItemDecorating or NSFileProviderItemFlags are as they do not exist in the source. If anyone has any pointers as to what they may be relating to I can try reproduce in a standalone project. The closest I can think of is our usage of PHPhoto or the native iOS share dialog.

beeradmoore commented 4 years ago

So turns out this was user error and not reading the manual.

From the instructions on #8931

To install, make sure you have latest Stable builds, and then select the Xcode 12 Previews channel in the Visual Studio for Mac updater. Note that you have to log in in Visual Studio for Mac for the Xcode 12 Preview channel to show up.

I was not using Xcode 12 Previews, just the Preview. I was not logged in and did not see it.

Nothing to see here gif