sparrowcode / AlertKit

Native alert from Apple Music & Feedback. Contains Done, Heart & Message and other presets.

Home Page:https://sparrowcode.io/frameworks

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Build failures: Likely regression in recent commit

nahn20 opened this issue · comments

Hello from React Native land! I'm crawling up from a distant dependency on this package (see initial author post in #45 ) which recently seems to have broken due to a change in AlertKit.

I found this issue while trying to build using Expo, which is a React Native build service for anyone not familiar. Specifically, in the step in which it runs Fastlane. The issue started around Oct 14, 2023 5:16 PM EST, which seems to line up with the timing and contents of 0bc23a5.

The full error message refers to AlertAppleMusic16View.swift and AlertAppleMusic17View.swift.

❌  (/Users/expo/workingdir/build/react-native-app/ios/Pods/SPAlert/Sources/AlertKit/Views/AlertAppleMusic16View.swift:19:5)

  17 |         default: UIColor(red: 88 / 255, green: 87 / 255, blue: 88 / 255, alpha: 1)
  18 |         }
> 19 |     }
     |     ^ missing return in closure expected to return 'UIColor'
  20 |     
  21 |     fileprivate weak var viewForPresent: UIView?
  22 |     fileprivate var presentDismissDuration: TimeInterval = 0.2

❌  (/Users/expo/workingdir/build/react-native-app/ios/Pods/SPAlert/Sources/AlertKit/Views/AlertAppleMusic17View.swift:19:5)

  17 |         default: UIColor(red: 88 / 255, green: 87 / 255, blue: 88 / 255, alpha: 1)
  18 |         }
> 19 |     }
     |     ^ missing return in closure expected to return 'UIColor'
  20 |     
  21 |     fileprivate weak var viewForPresent: UIView?
  22 |     fileprivate var presentDismissDuration: TimeInterval = 0.2

Removing the package resolves the build issues. Unfortunately I'm not familiar enough with Swift build systems to debug with any more granularity.

If it helps, the build was run using XCode 14.13.1, fastlane 2.213.0, CocoaPods 1.12.1, and Ruby 2.7.

We are experiencing the same issue, with the same timing.

@nahn20 Hey! Did you just end up removing the entire burnt dep?

Hi, I'm having the same issue - however, I actually am using burnt, so I can't just delete it.
would appreciate your help 💪🏻
Thanks!

We are experiencing the same issue, with the same timing.

@nahn20 Hey! Did you just end up removing the entire burnt dep?

Yep, not as a long-term fix, but more so to demonstrate that it was causing the issues (and so that I could continue with dev builds).

If anyone wants a quick fix for this, building locally using the --local flag with EAS Build works for me.

Another note: on my machine I'm on macOS Sonoma with Xcode 15.0.

I don't know much about native iOS development so I'm not sure if it's my Xcode version or the --local flag that is allowing me to build properly, but I hope this helps someone.

If anyone wants a quick fix for this, building locally using the --local flag with EAS Build works for me.

Another note: on my machine I'm on macOS Sonoma with Xcode 15.0.

I don't know much about native iOS development so I'm not sure if it's my Xcode version or the --local flag that is allowing me to build properly, but I hope this helps someone.

Yeah, that only works because you have the previous version of SPAlert(AlertKit) cached. (check your machine's ~/Library/Caches/CocoaPods/Pods/Release. If you clear that, you'll get the fresh broken version.

I am not sure if that would work, but we could maybe do a patch package of Burnt (if you are using yarn or pnpm), to change its podfile's s.dependecy to include the previous version.

Patching it to 4.2.0 has done the trick for me - I think the previous version (5.0.1) wasn't published since I couldn't install it.

diff --git a/node_modules/burnt/ios/Burnt.podspec b/node_modules/burnt/ios/Burnt.podspec
index 678869f..21a93c3 100644
--- a/node_modules/burnt/ios/Burnt.podspec
+++ b/node_modules/burnt/ios/Burnt.podspec
@@ -15,7 +15,7 @@ Pod::Spec.new do |s|
   s.source         = { git: 'https://github.com/nandorojo/burnt' }
   s.static_framework = true
   s.dependency 'SPIndicator'
-  s.dependency 'SPAlert'
+  s.dependency 'SPAlert', '4.2.0'
 
   s.dependency 'ExpoModulesCore'

Hello here!
Sorry I am long away of React Native but if you need any help or I can fix some I ready to do it. let me know please

I made release 5.1.2 with fix, maybe it help. Can somebody try?

Thanks @ivanvorobei
I tried 5.1.2 with burnt and it did not work.
It worked with 4.2.0.

I'm also seeing this error, how ever the error seems to be in Burnt:

/Users/expo/workingdir/build/node_modules/burnt/ios/BurntModule.swift:13:64: error: cannot find type 'SPAlertIconPreset' in scope
  func toSPAlertIconPreset(_ options: AlertOptions?) throws -> SPAlertIconPreset {
                                                               ^~~~~~~~~~~~~~~~~
/Users/expo/workingdir/build/node_modules/burnt/ios/BurntModule.swift:39:29: error: cannot find type 'SPAlertHaptic' in scope
  func toSPAlertHaptic() -> SPAlertHaptic {
                            ^~~~~~~~~~~~~
/Users/expo/workingdir/build/node_modules/burnt/ios/BurntModule.swift:245:18: error: cannot find 'SPAlertView' in scope
      let view = SPAlertView(
                 ^~~~~~~~~~~

@hiroingk can you check reason why it failed? maybe you have it

I think reason its compatibility with visionOS + conditions.

Sorry, error message is here.

❌  (../../node_modules/burnt/ios/BurntModule.swift:13:64)

  11 |   case custom
  12 |   
> 13 |   func toSPAlertIconPreset(_ options: AlertOptions?) throws -> SPAlertIconPreset {
     |                                                                ^ cannot find type 'SPAlertIconPreset' in scope
  14 |     switch self {
  15 |       case .done:
  16 |         return .done


❌  (../../node_modules/burnt/ios/BurntModule.swift:39:29)

  37 |   case none
  38 |   
> 39 |   func toSPAlertHaptic() -> SPAlertHaptic {
     |                             ^ cannot find type 'SPAlertHaptic' in scope
  40 |     switch self {
  41 |       case .success:
  42 |         return .success


❌  (../../node_modules/burnt/ios/BurntModule.swift:245:18)

  243 |       }
  244 |       
> 245 |       let view = SPAlertView(
      |                  ^ cannot find 'SPAlertView' in scope
  246 |         title: options.title,
  247 |         message: options.message,
  248 |         preset: preset ?? .done)

Same error here using Tamagui Toast that has Burnt as dependency....
Any quickfix for this?

  (node_modules/burnt/ios/BurntModule.swift:13:64)

  11 |   case custom
  12 |   
> 13 |   func toSPAlertIconPreset(_ options: AlertOptions?) throws -> SPAlertIconPreset {
     |                                                                ^ cannot find type 'SPAlertIconPreset' in scope
  14 |     switch self {
  15 |       case .done:
  16 |         return .done


  (node_modules/burnt/ios/BurntModule.swift:39:29)

  37 |   case none
  38 |   
> 39 |   func toSPAlertHaptic() -> SPAlertHaptic {
     |                             ^ cannot find type 'SPAlertHaptic' in scope
  40 |     switch self {
  41 |       case .success:
  42 |         return .success


  (node_modules/burnt/ios/BurntModule.swift:245:18)

  243 |       }
  244 |       
> 245 |       let view = SPAlertView(
      |                  ^ cannot find 'SPAlertView' in scope
  246 |         title: options.title,
  247 |         message: options.message,
  248 |         preset: preset ?? .done)```

I think it's related to #if macros using now. I used it because added vision OS support. Maybe its not work well with react.

The Burnt library wasn't pinned to 4.2 and started breaking due to the 5.0 changes. There is now a new version which pins the version so 4.2, so its fixed. nandorojo/burnt#27

@anirudhsama you can propose them upgrade to 5x version. Of course 4x and 5x has changes in API lol, its major changes.