Jobeso / react-native-story-share

Share your images to instagram and snapchat stories with react native.
107 stars 54 forks source link

🚑 Fix build failure due to UIImagePNGRepresentation #40

Closed franznkemaka closed 3 years ago

franznkemaka commented 4 years ago

I was unable to build using React Native 0.63.1, due to a couple of issues.

  1. UIImagePNGRepresention issues as explained in the commit comment below.
  2. Fixes this issue: dyld: Library not loaded: @rpath/PINCache.framework/PINCache Referenced from: /Users/.../Library/Developer/CoreSimulator/Devices/A67AEA68-7434-4B77-B259-CEF24F8D2F04/data/Containers/Bundle/Application/B09D6537-A239-4252-8EEE-05B8949C4FC0/Example.app/Frameworks/SCSDKBitmojiKit.framework/SCSDKBitmojiKit Reason: image not found

Definitely fixes https://github.com/Jobeso/react-native-story-share/issues/13 as mentioned here: https://github.com/react-native-community/react-native-share/pull/575#issuecomment-540821396

I'm not 100% sure it will work on other Swift versions, but it definitely works for me. Meanwhile, I'm currently my forked in my package.json.

Thanks, Franz

Jobeso commented 4 years ago

Great that you investigated. https://github.com/jobeso/react-native-story-share/commit/457542b0fb5f967e49a4659a44cb977f44205ad2 was merged to fix an issue, reverting could break this again. Did you check that? Thanks for you help here.

franznkemaka commented 4 years ago

Great that you investigated. 457542b was merged to fix an issue, reverting could break this again. Did you check that? Thanks for you help here.

Hi @Jobeso, it looks like it depends on the Swift version. I'm currently using React Native 0.63.1 with Swift 5 that's why it is not working. What is the Swift support version for the library?

franznkemaka commented 3 years ago

Hi @Jobeso , any update?

Jobeso commented 3 years ago

If I understood correctly, this PR supports Swift 5 and the current code a different version of Swift. I'm not sure which is the best to support then.

franznkemaka commented 3 years ago

If I understood correctly, this PR supports Swift 5 and the current code a different version of Swift. I'm not sure which is the best to support then.

Hello @Jobeso, thanks for replying, exactly. The old version that this without this PR won't work with react native 0.62+ (at least on my own end). Here is what it does in a nutshell

kyleclegg commented 3 years ago

Nice change here. Looks like you're using the latest (Swift 5) UIImage PNG API and that's probably best. So long as the Podfile updates from this PR are preserved I think it's fine to move forward in this direction.