Giphy / giphy-react-native-sdk

GIPHY React Native SDK
https://developers.giphy.com
Apache License 2.0
67 stars 25 forks source link

The Swift pod `giphy-react-native-sdk` depends upon `glog`, which does not define modules #161

Closed luutruong closed 8 months ago

luutruong commented 8 months ago

🐛 Bug Report

I try to upgrade to react-native 0.73.1 and get this error

[!] The following Swift pods cannot yet be integrated as static libraries:

The Swift pod giphy-react-native-sdk depends upon glog, which does not define modules. To opt into those targets generating module maps (which is necessary to import them from Swift when building as static libraries), you may set use_modular_headers! globally in your Podfile, or specify :modular_headers => true for particular dependencies.

I also added this line to Podfile

pod 'glog', :podspec => '../node_modules/react-native/third-party-podspecs/glog.podspec', :modular_headers => true

The error gone but It fails to build app

Cannot find interface declaration for 'GPHContent'
Cannot find interface declaration for 'GiphyViewController';

Note: I also tried with yarn cache clean and pod cache clean --all

To Reproduce

(Write your steps here:)

  1. Step 1...
  2. Step 2...
  3. Step 3...

Expected behavior

(Write what you thought would happen.)

Actual Behavior

(Write what happened. Add screenshots, if applicable.)

Your Environment

Reproducible Demo

ALexanderLonsky commented 8 months ago

@luutruong Hey, thanks for flagging this! Indeed, I can reproduce the issue on this RN version. So far, I can't determine the root cause, but it might be related to some dependencies. However, it works for me when I use the new RN architecture. I removed the Podfile.lock and Pods directory, then executed pod cache clean --all followed by RCT_NEW_ARCH_ENABLED=1 pod install

Please let me know if this works for you.

ALexanderLonsky commented 8 months ago

It seems I have found the root cause of the error:

Cannot find interface declaration for 'GPHContent'
Cannot find interface declaration for 'GiphyViewController'

For some reason, starting with RN version 0.73.0, it adds redundant elements to the generated bridging header. I'll need to release a new version to fix this, but you can also try the change locally. You need to remove the public modifier from the following:

public class RTNGiphyTheme
public extension GPHContent
public extension GiphyViewController

This should resolve the issue.

purplereborn commented 8 months ago

same issue :)

ALexanderLonsky commented 7 months ago

We've released a fix in v3.2.2. Please check it when you get a chance. If the problem persists, please reopen this issue or create a new one