TobiasHennig / nativescript-toast

A NativeScript Toast Plugin for Android and iOS apps.
MIT License
67 stars 19 forks source link

Build failed with Xcode 12 #49

Open OPADA-Eng opened 4 years ago

OPADA-Eng commented 4 years ago

Hi, I noticed that the plugin has some compatibility issues with Xcode 12 and it's causing build errors:

Users/aldurracompany/Documents/projects.nosync/my_app/platforms/ios/Pods/SBToaster/Sources/ToastView.swift:44:5: error: switch must be exhaustive
    switch UIDevice.current.userInterfaceIdiom {
    ^
/Users/username/Documents/projects.nosync/my_app/platforms/ios/Pods/SBToaster/Sources/ToastView.swift:44:5: note: do you want to add missing cases?
    switch UIDevice.current.userInterfaceIdiom {
    ^
/Users/username/Documents/projects.nosync/my_app/platforms/ios/Pods/SBToaster/Sources/ToastView.swift:55:5: error: switch must be exhaustive
    switch UIDevice.current.userInterfaceIdiom {
    ^
/Users/username/Documents/projects.nosync/my_app/platforms/ios/Pods/SBToaster/Sources/ToastView.swift:55:5: note: do you want to add missing cases?
    switch UIDevice.current.userInterfaceIdiom {
    ^
/Users/username/Documents/projects.nosync/my_app/platforms/ios/Pods/SBToaster/Sources/ToastView.swift:79:7: error: switch must be exhaustive
      switch UIDevice.current.userInterfaceIdiom {
      ^
/Users/username/Documents/projects.nosync/my_app/platforms/ios/Pods/SBToaster/Sources/ToastView.swift:79:7: note: do you want to add missing cases?
      switch UIDevice.current.userInterfaceIdiom {
      ^
/Users/username/Documents/projects.nosync/my_app/platforms/ios/Pods/SBToaster/Sources/ToastView.swift:44:5: error: switch must be exhaustive
    switch UIDevice.current.userInterfaceIdiom {
    ^
/Users/username/Documents/projects.nosync/my_app/platforms/ios/Pods/SBToaster/Sources/ToastView.swift:44:5: note: do you want to add missing cases?
    switch UIDevice.current.userInterfaceIdiom {
    ^
/Users/username/Documents/projects.nosync/my_app/platforms/ios/Pods/SBToaster/Sources/ToastView.swift:55:5: error: switch must be exhaustive
    switch UIDevice.current.userInterfaceIdiom {
    ^
/Users/username/Documents/projects.nosync/my_app/platforms/ios/Pods/SBToaster/Sources/ToastView.swift:55:5: note: do you want to add missing cases?
    switch UIDevice.current.userInterfaceIdiom {
    ^
/Users/username/Documents/projects.nosync/my_app/platforms/ios/Pods/SBToaster/Sources/ToastView.swift:79:7: error: switch must be exhaustive
      switch UIDevice.current.userInterfaceIdiom {
      ^
/Users/username/Documents/projects.nosync/my_app/platforms/ios/Pods/SBToaster/Sources/ToastView.swift:79:7: note: do you want to add missing cases?
      switch UIDevice.current.userInterfaceIdiom {
      ^
Command CompileSwift failed with a nonzero exit code
/Users/username/Documents/projects.nosync/my_app/platforms/ios/Pods/SBToaster/Sources/ToastView.swift:44:5: error: switch must be exhaustive
    switch UIDevice.current.userInterfaceIdiom {
    ^
/Users/username/Documents/projects.nosync/my_app/platforms/ios/Pods/SBToaster/Sources/ToastView.swift:44:5: note: do you want to add missing cases?
    switch UIDevice.current.userInterfaceIdiom {
    ^
/Users/username/Documents/projects.nosync/my_app/platforms/ios/Pods/SBToaster/Sources/ToastView.swift:55:5: error: switch must be exhaustive
    switch UIDevice.current.userInterfaceIdiom {
    ^
/Users/username/Documents/projects.nosync/my_app/platforms/ios/Pods/SBToaster/Sources/ToastView.swift:55:5: note: do you want to add missing cases?
    switch UIDevice.current.userInterfaceIdiom {
    ^
/Users/username/Documents/projects.nosync/my_app/platforms/ios/Pods/SBToaster/Sources/ToastView.swift:79:7: error: switch must be exhaustive
      switch UIDevice.current.userInterfaceIdiom {
      ^
/Users/username/Documents/projects.nosync/my_app/platforms/ios/Pods/SBToaster/Sources/ToastView.swift:79:7: note: do you want to add missing cases?
      switch UIDevice.current.userInterfaceIdiom {
      ^
Command CompileSwift failed with a nonzero exit code
note: Using new build system
note: Building targets in parallel
note: Using codesigning identity override: 
note: Planning build
note: Constructing build description
warning: MobileCoreServices has been renamed. Use CoreServices instead. (in target 'FLAnimatedImage' from project 'Pods')
** BUILD FAILED **

Unable to apply changes on device: 85BA4DC4-F1EA-4DEB-9909-A60F0CB7D2CA. Error is: Command xcodebuild failed with exit code 65.

I think the reason is from this switch:

    case .unspecified: return 30
    case .phone: return 30
    case .pad: return 60
    case .tv: return 90
    case .carPlay: return 30
    **case .mac:
        return 90**
    }

it must support mac as well as it's now supported in the app store. I hope you fix it asap. Thanks

terranc-gich commented 4 years ago

@OPADA-Eng I managed to get it compiled by:

  1. Downgrade to nativescript-toast@1.4.6
  2. Modify content of node_modules/nativescript-toast/platform/ios/Podfile to:

pod 'Toaster', :git => 'https://github.com/devxoul/Toaster.git', :branch => 'master'

nativescript-toast@2.0.0 uses SBToaster while 1.4.6 uses Toaster. The master branch of Toaster was updated to provide the default cases but unfortunately, it is not yet released. So you need to modify the Podfile to get it from the repository.

It will still get some warnings but not build errors. We need to use 1.4.6 until SBToaster is fixed.

Hope this help.

Reference: (https://github.com/devxoul/Toaster/issues/193)

saibbyweb commented 3 years ago

Having the same issue.

felicks commented 3 years ago

Same. Is there a solution yet?

victorpandolfe commented 3 years ago

Same error here, any workaround possible besides downgrading?