gitn00b1337 / expo-widgets

Bringing widget functionality to expo!
148 stars 12 forks source link

Expo SDK 51 support #20

Closed ythomop closed 4 months ago

ythomop commented 4 months ago

Reproduction Repository

Description

In a project using Expo SDK 51, the iOS app cannot be built (locally at least, I haven't tried on the eas servers). A flipper-related error is shown, but I believe that the actual problem is the version of @expo/config-plugins required by expo-widgets. Expo-doctor was complaining about @expo/config-plugins, so I overrode its version in package.json, but the error remains anyway.

Most likely, the solution is to update the @expo/config-plugins version in order to support SDK 51.

Error

[INSTALL_PODS] Auto-linking React Native modules for target `widgetsWidgetExtension`: RNGestureHandler, RNReanimated, RNScreens, and react-native-safe-area-context
[INSTALL_PODS] [!] Invalid `Podfile` file: undefined local variable or method `flipper_config' for #<Pod::Podfile:0x000000013b8a75f0>
[INSTALL_PODS] Did you mean?  find_config.
[INSTALL_PODS]  #  from /private/var/folders/yc/06r61y4953j7_kc43wtf87l80000gn/T/eas-build-local-nodejs/e9852825-5f34-438e-9b7f-1e7ccd9b3820/build/ios/Podfile:35
[INSTALL_PODS]  #  -------------------------------------------
[INSTALL_PODS]  #      # Note that if you have use_frameworks! enabled, Flipper will not work if enabled
[INSTALL_PODS]  >      :flipper_configuration => flipper_config
[INSTALL_PODS]  #    )
[INSTALL_PODS]  #  -------------------------------------------
[INSTALL_PODS] 
gitn00b1337 commented 4 months ago

Hi, did you try this suggestion with the example project?

ythomop commented 4 months ago

No, I haven't.

novemberkilo commented 4 months ago

I've also run into this (on expo 51). I think that the issue is here https://github.com/gitn00b1337/expo-widgets/blob/main/plugin/src/ios/withPodfile.ts#L32-L33 -- this introduces flipper_config to the generated ios/Podfile and afaik flipper is not supported in expo 51.

Manually commenting it out of the generated Podfile results in a clean prebuild.

gitn00b1337 commented 4 months ago

Does the build also produce widgets? I'll try take a look tonight but it would be great to hear whether that just causes other issues or not

novemberkilo commented 4 months ago

I meant that I got to a clean npx expo prebuild

I didn't get to a clean build after all. I'm currently stuck with

> npx expo run:ios

⚠️  Something went wrong running `pod install` in the `ios` directory.
Command `pod install` failed.
└─ Cause: An error occurred while processing the post-install hook of the Podfile.

[Xcodeproj] Consistency issue: no parent for object `Attributes.swift`: `SourcesBuildPhase`, `SourcesBuildPhase`

/Library/Ruby/Gems/2.6.0/gems/xcodeproj-1.22.0/lib/xcodeproj/project/object/helpers/groupable_helper.rb:19:in `parent'
/Library/Ruby/Gems/2.6.0/gems/xcodeproj-1.22.0/lib/xcodeproj/project/object/build_file.rb:77:in `ascii_plist_annotation'
/Library/Ruby/Gems/2.6.0/gems/xcodeproj-1.22.0/lib/xcodeproj/project.rb:297:in `block in to_ascii_plist'
/Library/Ruby/Gems/2.6.0/gems/xcodeproj-1.22.0/lib/xcodeproj/project.rb:296:in `each'
/Library/Ruby/Gems/2.6.0/gems/xcodeproj-1.22.0/lib/xcodeproj/project.rb:296:in `to_ascii_plist'
/Library/Ruby/Gems/2.6.0/gems/xcodeproj-1.22.0/lib/xcodeproj/project.rb:365:in `block in save'
/Library/Ruby/Gems/2.6.0/gems/atomos-0.1.3/lib/atomos.rb:21:in `block in atomic_write'
/System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/tempfile.rb:295:in `open'
/Library/Ruby/Gems/2.6.0/gems/atomos-0.1.3/lib/atomos.rb:17:in `atomic_write'
/Library/Ruby/Gems/2.6.0/gems/xcodeproj-1.22.0/lib/xcodeproj/project.rb:364:in `save'
<snip>
gitn00b1337 commented 4 months ago

I've taken a look today and updated the example project with the latest expo version. The data transfer is not working yet for some reason I need to figure out, but the widget renders and you can design them and get data via api requests. I'll continue figuring out what's broken for expo51 when I can, hopefully at the weekend. For now, there's a beta release - npm i @bittingz/expo-widgets@beta

Anyone that wants to help, see branch expo-51. Cheers

gitn00b1337 commented 4 months ago

V2 is now available with full support for expo 51. :)