bndkt / react-native-app-clip

Easily add an App Clip for iOS apps built with React Native
https://bndkt.com/blog/2022/react-native-app-clip
446 stars 19 forks source link

Issues running in development & notes about app clip size #20

Closed kzlar closed 3 weeks ago

kzlar commented 9 months ago

Hi!

Appreciate all your work on this library, it's amazing! I was able to use it to publish my App Clip on testflight, had the obvious issues with size but on iOS 17 it works great! However, I'm having issues running it for development.

I tried running it through expo run:ios --scheme as well as through Expo, on both simulator and physical device. Unfortunately, in all cases I get the following error: Library not loaded: @rpath/OpenSSL.framework/OpenSSL

Any idea what could be the issue?

Thanks!

kzlar commented 9 months ago

After some additional attempts, I have some more notes to share.

I have tried the vanilla expo starter: https://docs.expo.dev/tutorial/create-your-first-app/ It too, does not work for development, but it complains about not finding the Hermes library.

That got me thinking, so I tried disabling Hermes ("jsEngine": "jsc") and it started working! I hope this can help folks who just want to get started, and hopefully help diagnose the issue when debugging.

Additionally, I tried comparing the sizes of the resulting App Clips with and without Hermes. Below are the results for vanilla expo project:

This is very significant, with Hermes you can barely fit anything into the app before blowing past the 10MB limit, while with JSC you have a non-trivial amount left. With that said, I still want my main app to run with Hermes, and by the time iOS17 has larger adoption perhaps these size difference won't matter much. Yet I wonder, is there a way to run just the app clip with JSC while keeping the main app with Hermes?

bndkt commented 9 months ago

Thanks for your details! Is there by chance any code you can share with me? It should work in development mode as well, I'll try to replicate.

Regarding the app size: Yes if you use Hermes, the Hermes runtime will be included in the app b/c it doesn't ship with iOS, that's why the app size is bigger. I've tried the approach you mention to enable Hermes for the full app but not for the App Clip and have not managed to get it working.

Just out of curiosity, would you be able to send me a TestFlight link? Would love to see the App Clip in action.

kzlar commented 9 months ago

Hey, thanks for your reply!

I can try to set up a github with my code but it's quite literally the vanilla expo starter (linked above) + the instructions in this repo's readme. The only issue I had was with TARGETED_DEVICE_FAMILY which I assume is realted to this. I had to make the main app only available on iPhone since the app and clip were mismatched (perhaps the TARGETED_DEVICE_FAMILY needs to be a config option? or somehow inherit it from the main app?).

If you can confirm that the development flow instructions work for you locally I can try to upload my test repo for you to try.

I've tried the approach you mention to enable Hermes for the full app but not for the App Clip and have not managed to get it working

What issues did you have? I tried manually changing the :hermes_enabled line in the podfile but it seems like the clip still compiled with hermes somehow. I tried asking on the expo discord but it's hard to get answers there.

Just out of curiosity, would you be able to send me a TestFlight link? Would love to see the App Clip in action.

Generally I'd love to, but we're not quite ready to share it widely yet. Hopefully soon 🤞 Regardless, even with JSC my app's clip is 20MB so I think we'll have to stick to iOS 17 for now...