nandorojo / burnt

Crunchy toasts for React Native. 🍞
MIT License
1.16k stars 36 forks source link

Expo Fastlane Build Failure - SPAlert #27

Closed mvolonnino closed 10 months ago

mvolonnino commented 10 months ago

Had these alerts hooked up and working which is why this is odd to me but getting fastlane build errors during my eas build phase for my expo 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

❌  (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

To make sure it was this libray, i had to remove burnt. Once i did was able to build again successfully.

"burnt": "^0.11.7",
"expo": "^49.0.0",
"react-native": "0.72.5",

Followed the docs as well to get it working in Expo and like I said had it working and already made builds through EAS just fine.

I do have some code now that updates Appearance manually with Appearance.setColorScheme() -> I need this as my users can set their color mode to match the OS or be light & dark. If they select light or dark and the match os is toggled off, then native components did not update, so i added the Appearance.setColorScheme(light | dark | null) to match which works with things like Alert from RN, it also worked on development builds for your burnt alerts & toasts as well but been running into the error above trying to build new builds through EAS.

mvolonnino commented 10 months ago

https://reactnative-archive-august-2023.netlify.app/docs/appearance#setcolorscheme

Taarna commented 10 months ago

This is caused by SPAlert and it's already reported here.

mvolonnino commented 10 months ago

@Taarna - Ah okay cool! So it sounds like once thats fixed we should be good to add this back? Thanks for the reply!

hiroingk commented 10 months ago

I am also getting the SPAlert error. I share the error message because I got a different message than the Issue author.

❌  (../../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)
jordam1407 commented 10 months ago

Same error here using Tamagui Toast.... But in my case I'm trying to build on eas

Anyone found a fix for this?

image

nandorojo commented 10 months ago

I wonder if this is a versioning issue and they released a new version?

ghost commented 10 months ago

I also encountered an EAS build issue (only for IOS). I first tried to build the app with the default settings (Xcode v14) and when doing that I saw similar error messages as the writer of this issue. Then I changed the image of the IOS builds to "latest" (Xcode v15) and encountered a different error message:

image

Also, I noticed that I am using burnt version 0.11.7, but I do not see this in the releases of the Github repo?

nandorojo commented 10 months ago

Looks like they rewrote the library and broke it all lol. Let me try to peg to the right version

nandorojo commented 10 months ago

Can you try burnt version 0.12 (latest version) and see if that fixes it?

jordam1407 commented 10 months ago

It's working, thanks!

mvolonnino commented 10 months ago

Yup, working for me as well, appreciate it! Already added it back in thats how NASTY these toasts are. Would love to see something close for Android as well!!

branaust commented 10 months ago

Confirmed upgrading to 0.12 fixed this issue

nandorojo commented 10 months ago

Fixes ship in under 24 hours — welcome to open source ⚡️

julian-gargicevich commented 10 months ago

@nandorojo legend!