aboutyou / dart_packages

Dart and Flutter plugins maintained and used by @ABOUTYOU
222 stars 153 forks source link

[sign_in_with_apple] [iOS15] Build error: @available #213

Closed abegehr closed 3 years ago

abegehr commented 3 years ago

I'm getting a build error when trying to run a flutter app on iOS 15 developer beta from Xcode 13.0.

The error is as follows as shows a few times:

    /Users/anton/development/flutter/.pub-cache/hosted/pub.dartlang.org/sign_in_with_apple-3.0.0/ios/Classes/SignInWithAppleError.swift:26:6: error: enum cases with associated values cannot be marked potentially unavailable with '@available'
        @available(iOS 13.0, macOS 10.15, *)

Flutter doctor:

➜  linksaver git:(main) ✗ flutter doctor
Doctor summary (to see all details, run flutter doctor -v):
[✓] Flutter (Channel dev, 2.3.0-16.0.pre, on macOS 12.0 21A5248p darwin-x64, locale en-DE)
[✓] Android toolchain - develop for Android devices (Android SDK version 30.0.3)
[✓] Xcode - develop for iOS and macOS
[✓] Chrome - develop for the web
[✓] Android Studio (version 4.1)
[✓] VS Code (version 1.57.0)
[✓] Connected device (3 available)
    ! Error: Anton’s iPhone is busy: Making the device ready for development. Xcode will continue when Anton’s iPhone is finished. (code -10)

• No issues found!

Full flutter build log:

Launching lib/main.dart on Anton’s iPhone in debug mode...
lib/main.dart:1
Automatically signing iOS for device deployment using specified development team in Xcode project: BFJ9VFLXQW
Xcode build done.                                           11.7s
Failed to build iOS app
Error output from Xcode build:
↳
    2021-06-19 09:35:58.978 xcodebuild[7524:43433] [MT] DVTPlugInManager: Required plug-in compatibility UUID 42E1F17B-27B3-4DE8-92A8-DC76BA4F5921 for DVTCoreGlyphs.framework (com.apple.dt.DVTCoreGlyphs) not present
    --- xcodebuild: WARNING: Using the first of multiple matching destinations:
    { platform:iOS, id:dvtdevice-DVTiPhonePlaceholder-iphoneos:placeholder, name:Any iOS Device }
    { platform:iOS, id:00008101-0002249636B8001E, name:Anton’s iPhone }
    { platform:iOS Simulator, id:dvtdevice-DVTiOSDeviceSimulatorPlaceholder-iphonesimulator:placeholder, name:Any iOS Simulator Device }
    { platform:iOS Simulator, id:C7858895-E13A-43C4-A117-C97E57D0E276, OS:15.0, name:iPad Air (4th generation) }
    { platform:iOS Simulator, id:5170ACD0-20DD-487B-B9F5-8BB1B1EC8FE0, OS:15.0, name:iPad Pro (9.7-inch) }
    { platform:iOS Simulator, id:23AF575C-865B-447F-B40C-14A134647F13, OS:15.0, name:iPad Pro (11-inch) (3rd generation) }
    { platform:iOS Simulator, id:1D1DB32A-6810-4D4E-8C3A-10E4605C40F8, OS:15.0, name:iPad Pro (12.9-inch) (5th generation) }
    { platform:iOS Simulator, id:3E72571F-9D09-4BE4-AD3F-2BEEBF40F11A, OS:15.0, name:iPhone 8 }
    { platform:iOS Simulator, id:24F6C625-FAEA-43BD-B73B-B35C14ED04FD, OS:15.0, name:iPhone 8 Plus }
    { platform:iOS Simulator, id:947927A0-F693-404C-945A-39F7BC98CCF4, OS:15.0, name:iPhone 11 }
    { platform:iOS Simulator, id:E796657F-DAD1-4B86-8FFA-5377582100EB, OS:15.0, name:iPhone 11 Pro }
    { platform:iOS Simulator, id:D66DBA38-539F-4D26-89C4-1C68C89860E5, OS:15.0, name:iPhone 11 Pro Max }
    { platform:iOS Simulator, id:7390EFAE-6E32-4307-AC43-A0ADE990CF7A, OS:15.0, name:iPhone 12 }
    { platform:iOS Simulator, id:48CE9C7D-268D-49AF-9601-B865943624EC, OS:15.0, name:iPhone 12 Pro }
    { platform:iOS Simulator, id:35556A35-F8F2-4A8A-9CFE-D33A38E1BF19, OS:15.0, name:iPhone 12 Pro Max }
    { platform:iOS Simulator, id:A586EC13-BB16-45AF-BB14-935AEA781BF7, OS:15.0, name:iPhone 12 mini }
    { platform:iOS Simulator, id:CD89425E-E853-4B10-9010-C902A17F4BB2, OS:15.0, name:iPhone SE (2nd generation) }
    { platform:iOS Simulator, id:9E873D92-CAE0-4D2D-8D7F-0E93D2F056A1, OS:15.0, name:iPod touch (7th generation) }
    ** BUILD FAILED **
Xcode's output:
↳
    /Users/anton/development/flutter/.pub-cache/hosted/pub.dartlang.org/image_picker-0.6.7+22/ios/Classes/FLTImagePickerPlugin.m:149:20: warning: 'UIAlertView' is deprecated: first deprecated in iOS 9.0 - UIAlertView is deprecated. Use UIAlertController with a preferredStyle of UIAlertControllerStyleAlert instead [-Wdeprecated-declarations]
        [[[UIAlertView alloc] initWithTitle:NSLocalizedString(@"Error", nil)
                       ^
    In module 'UIKit' imported from /Users/anton/local/repos/linksaver/ios/Pods/Target Support Files/image_picker/image_picker-prefix.pch:2:
    /Applications/Xcode-beta.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS15.0.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIAlertView.h:27:12: note: 'UIAlertView' has been explicitly marked deprecated here
    @interface UIAlertView : UIView
               ^
    1 warning generated.
    /Users/anton/development/flutter/.pub-cache/hosted/pub.dartlang.org/sign_in_with_apple-3.0.0/ios/Classes/SignInWithAppleError.swift:26:6: error: enum cases with associated values cannot be marked potentially unavailable with '@available'
        @available(iOS 13.0, macOS 10.15, *)
         ^
    /Users/anton/development/flutter/.pub-cache/hosted/pub.dartlang.org/sign_in_with_apple-3.0.0/ios/Classes/SignInWithAppleError.swift:30:6: error: enum cases with associated values cannot be marked potentially unavailable with '@available'
        @available(iOS 13.0, macOS 10.15, *)
         ^
    /Users/anton/development/flutter/.pub-cache/hosted/pub.dartlang.org/sign_in_with_apple-3.0.0/ios/Classes/SignInWithAppleError.swift:36:6: error: enum cases with associated values cannot be marked potentially unavailable with '@available'
        @available(iOS 13.0, macOS 10.15, *)
         ^
    /Users/anton/development/flutter/.pub-cache/hosted/pub.dartlang.org/sign_in_with_apple-3.0.0/ios/Classes/SignInWithAppleError.swift:42:6: error: enum cases with associated values cannot be marked potentially unavailable with '@available'
        @available(iOS 13.0, macOS 10.15, *)
         ^
    /Users/anton/development/flutter/.pub-cache/hosted/pub.dartlang.org/sign_in_with_apple-3.0.0/ios/Classes/SignInWithAppleError.swift:82:13: warning: switch must be exhaustive
                switch code {
                ^
    /Users/anton/development/flutter/.pub-cache/hosted/pub.dartlang.org/sign_in_with_apple-3.0.0/ios/Classes/SignInWithAppleError.swift:82:13: note: do you want to add missing cases?
                switch code {
                ^
    note: Using new build system
    note: Planning
    note: Build preparation complete
    note: Building targets in parallel
    note: Removed stale file '/Users/anton/Library/Developer/Xcode/DerivedData/Runner-esfwfkymdmxhtdalabpbqeuqwoip/Build/Products/Debug-iphoneos/Runner.app'
    note: Removed stale file '/Users/anton/Library/Developer/Xcode/DerivedData/Runner-esfwfkymdmxhtdalabpbqeuqwoip/Build/Products/Debug-iphoneos/Pods_Runner.framework'
    note: Removed stale file '/Users/anton/Library/Developer/Xcode/DerivedData/Runner-esfwfkymdmxhtdalabpbqeuqwoip/Build/Products/Debug-iphoneos/firebase_auth/firebase_auth.framework'
    note: Removed stale file '/Users/anton/Library/Developer/Xcode/DerivedData/Runner-esfwfkymdmxhtdalabpbqeuqwoip/Build/Products/Debug-iphoneos/sqflite/sqflite.framework'
    note: Removed stale file '/Users/anton/Library/Developer/Xcode/DerivedData/Runner-esfwfkymdmxhtdalabpbqeuqwoip/Build/Products/Debug-iphoneos/google_sign_in/google_sign_in.framework'
    note: Removed stale file '/Users/anton/Library/Developer/Xcode/DerivedData/Runner-esfwfkymdmxhtdalabpbqeuqwoip/Build/Products/Debug-iphoneos/firebase_core/firebase_core.framework'
    note: Removed stale file '/Users/anton/Library/Developer/Xcode/DerivedData/Runner-esfwfkymdmxhtdalabpbqeuqwoip/Build/Products/Debug-iphoneos/firebase_storage/firebase_storage.framework'
    note: Removed stale file '/Users/anton/Library/Developer/Xcode/DerivedData/Runner-esfwfkymdmxhtdalabpbqeuqwoip/Build/Products/Debug-iphoneos/cloud_firestore/cloud_firestore.framework'
    note: Removed stale file '/Users/anton/Library/Developer/Xcode/DerivedData/Runner-esfwfkymdmxhtdalabpbqeuqwoip/Build/Products/Debug-iphoneos/GoogleDataTransport/GoogleDataTransport.framework'
    note: Removed stale file '/Users/anton/Library/Developer/Xcode/DerivedData/Runner-esfwfkymdmxhtdalabpbqeuqwoip/Build/Products/Debug-iphoneos/FirebaseCoreDiagnostics/FirebaseCoreDiagnostics.framework'
    note: Removed stale file '/Users/anton/Library/Developer/Xcode/DerivedData/Runner-esfwfkymdmxhtdalabpbqeuqwoip/Build/Products/Debug-iphoneos/GTMAppAuth/GTMAppAuth.framework'
    note: Removed stale file '/Users/anton/Library/Developer/Xcode/DerivedData/Runner-esfwfkymdmxhtdalabpbqeuqwoip/Build/Products/Debug-iphoneos/FirebaseStorage/FirebaseStorage.framework'
    note: Removed stale file '/Users/anton/Library/Developer/Xcode/DerivedData/Runner-esfwfkymdmxhtdalabpbqeuqwoip/Build/Products/Debug-iphoneos/GoogleUtilities/GoogleUtilities.framework'
    note: Removed stale file '/Users/anton/Library/Developer/Xcode/DerivedData/Runner-esfwfkymdmxhtdalabpbqeuqwoip/Build/Products/Debug-iphoneos/FirebaseCore/FirebaseCore.framework'
    note: Removed stale file '/Users/anton/Library/Developer/Xcode/DerivedData/Runner-esfwfkymdmxhtdalabpbqeuqwoip/Build/Products/Debug-iphoneos/FirebaseAuth/FirebaseAuth.framework'
    note: Removed stale file '/Users/anton/Library/Developer/Xcode/DerivedData/Runner-esfwfkymdmxhtdalabpbqeuqwoip/Build/Products/Debug-iphoneos/XCFrameworkIntermediates/BoringSSL-GRPC'
    note: Removed stale file '/Users/anton/Library/Developer/Xcode/DerivedData/Runner-esfwfkymdmxhtdalabpbqeuqwoip/Build/Products/Debug-iphoneos/XCFrameworkIntermediates/FirebaseFirestore'
    note: Removed stale file '/Users/anton/Library/Developer/Xcode/DerivedData/Runner-esfwfkymdmxhtdalabpbqeuqwoip/Build/Products/Debug-iphoneos/url_launcher/url_launcher.framework'
    note: Removed stale file '/Users/anton/Library/Developer/Xcode/DerivedData/Runner-esfwfkymdmxhtdalabpbqeuqwoip/Build/Products/Debug-iphoneos/GTMSessionFetcher/GTMSessionFetcher.framework'
    note: Removed stale file '/Users/anton/Library/Developer/Xcode/DerivedData/Runner-esfwfkymdmxhtdalabpbqeuqwoip/Build/Products/Debug-iphoneos/path_provider/path_provider.framework'
    note: Removed stale file '/Users/anton/Library/Developer/Xcode/DerivedData/Runner-esfwfkymdmxhtdalabpbqeuqwoip/Build/Products/Debug-iphoneos/nanopb/nanopb.framework'
    note: Removed stale file '/Users/anton/Library/Developer/Xcode/DerivedData/Runner-esfwfkymdmxhtdalabpbqeuqwoip/Build/Products/Debug-iphoneos/image_picker/image_picker.framework'
    note: Removed stale file '/Users/anton/Library/Developer/Xcode/DerivedData/Runner-esfwfkymdmxhtdalabpbqeuqwoip/Build/Products/Debug-iphoneos/sign_in_with_apple/sign_in_with_apple.framework'
    note: Removed stale file '/Users/anton/Library/Developer/Xcode/DerivedData/Runner-esfwfkymdmxhtdalabpbqeuqwoip/Build/Products/Debug-iphoneos/FMDB/FMDB.framework'
    note: Removed stale file '/Users/anton/Library/Developer/Xcode/DerivedData/Runner-esfwfkymdmxhtdalabpbqeuqwoip/Build/Products/Debug-iphoneos/PromisesObjC/FBLPromises.framework'
    note: Removed stale file '/Users/anton/Library/Developer/Xcode/DerivedData/Runner-esfwfkymdmxhtdalabpbqeuqwoip/Build/Products/Debug-iphoneos/AppAuth/AppAuth.framework'
    note: Removed stale file '/Users/anton/Library/Developer/Xcode/DerivedData/Runner-esfwfkymdmxhtdalabpbqeuqwoip/Build/Products/Debug-iphoneos/XCFrameworkIntermediates/abseil'
    note: Removed stale file '/Users/anton/Library/Developer/Xcode/DerivedData/Runner-esfwfkymdmxhtdalabpbqeuqwoip/Build/Products/Debug-iphoneos/XCFrameworkIntermediates/gRPC-C++'
    /Users/anton/local/repos/linksaver/ios/Pods/Pods.xcodeproj: warning: The iOS deployment target 'IPHONEOS_DEPLOYMENT_TARGET' is set to 8.0, but the range of supported deployment target versions is 9.0 to 15.0.99. (in target 'FMDB' from project 'Pods')
    /Users/anton/local/repos/linksaver/ios/Pods/Pods.xcodeproj: warning: The iOS deployment target 'IPHONEOS_DEPLOYMENT_TARGET' is set to 8.0, but the range of supported deployment target versions is 9.0 to 15.0.99. (in target 'AppAuth' from project 'Pods')
    note: Removed stale file '/Users/anton/Library/Developer/Xcode/DerivedData/Runner-esfwfkymdmxhtdalabpbqeuqwoip/Build/Products/Debug-iphoneos/XCFrameworkIntermediates/gRPC-Core'
    note: Removed stale file '/Users/anton/Library/Developer/Xcode/DerivedData/Runner-esfwfkymdmxhtdalabpbqeuqwoip/Build/Products/Debug-iphoneos/XCFrameworkIntermediates/leveldb-library'
    /Users/anton/local/repos/linksaver/ios/Pods/Pods.xcodeproj: warning: The iOS deployment target 'IPHONEOS_DEPLOYMENT_TARGET' is set to 8.0, but the range of supported deployment target versions is 9.0 to 15.0.99. (in target 'FirebaseFirestore' from project 'Pods')
    /Users/anton/local/repos/linksaver/ios/Pods/Pods.xcodeproj: warning: The iOS deployment target 'IPHONEOS_DEPLOYMENT_TARGET' is set to 8.0, but the range of supported deployment target versions is 9.0 to 15.0.99. (in target 'GoogleSignIn' from project 'Pods')
    /Users/anton/local/repos/linksaver/ios/Pods/Pods.xcodeproj: warning: The iOS deployment target 'IPHONEOS_DEPLOYMENT_TARGET' is set to 8.0, but the range of supported deployment target versions is 9.0 to 15.0.99. (in target 'Flutter' from project 'Pods')
Could not build the precompiled application for the device.

Error launching application on Anton’s iPhone.
Exited (sigterm)
HenriBeck commented 3 years ago

@abegehr, thanks for the report.

I can see the same report about this bug in this apple thread.

As it's currently still very early in the iOS and XCode betas, we would wait and see if this is just an initial bug in the first betas or is something we actually need to change before iOS 15 is officially released.

while-loop commented 3 years ago

Seems like a Swift 5.5 error. https://bugs.swift.org/browse/SR-14539

juliansteenbakker commented 3 years ago

I have created a workaround in #221 for this problem by splitting the enum into 2 parts, and annotate the whole enum instead of a single item.

Seems like a Swift 5.5 error. https://bugs.swift.org/browse/SR-14539

Keep in mind that this probably isn't a bug, but a new "feature".

This is intentional. The ABI of enum cases with payloads that are potentially unavailable is not well-defined. That this worked in the past was by coincidence of your application not requiring the (potentially unavailable) type metadata for the payload. Please either increase your deployment target or mark Foo itself as available as the least-available case. (Source)

Please see the pull-request that introduced this behavior: https://github.com/apple/swift/pull/36327

cpboyd commented 3 years ago

This is still present in the XCode 13 RC, so any builds with the RC will currently fail.

bangfika commented 3 years ago

iOS 15 and XCode 13 is released. Any update guys? I saw a PR #221 but not reviewed yet.

sakyoyuto commented 3 years ago

This makes it impossible to build with Xcode13.

HenriBeck commented 3 years ago

I will have a look today

xmany commented 3 years ago

Same error under Xcode 13.0, Flutter 2.5

Shakle commented 3 years ago

Agree, no way to build after upgrading to xcode 13

KristianBalaj commented 3 years ago

The same problem here.

HenriBeck commented 3 years ago

As said previously, we will look into this with high priority.

For now, I will lock the thread and we will give an update once we have released a fix.

Either please downgrade to a 12.x version of XCode for now or use the branch from the open PR (on your own risk):

sign_in_with_apple:
  git:
    url: git://github.com/aboutyou/dart_packages.git
    ref: 3d2633761b8cdb04d2816a5f079be765bdcb7603
    path: packages/sign_in_with_apple
HenriBeck commented 3 years ago

Ah, the branch was force pushed, so the commit isn't there anymore; here is the new commit:

sign_in_with_apple:
  git:
    url: git://github.com/aboutyou/dart_packages.git
    ref: f38e0503e19d90daa2c2d69d444b38c4974a8fe5
    path: packages/sign_in_with_apple
HenriBeck commented 3 years ago

The fix looks good and we will release the new version tomorrow morning.

HenriBeck commented 3 years ago

I just released version 3.1.0 with XCode 13 Support

risdeit commented 3 years ago

If anyone not yet on null-safety, you can use this one:

sign_in_with_apple:
    git:
      url: https://github.com/risdeit/dart_packages.git
      path: packages/sign_in_with_apple
      ref: 4d39321