Closed kylea3 closed 1 month ago
Same problem here. On android it works just fine but in iOS in throws this same error log: 'ChargebeeReactNative-Swift.h' file not found
Hey @kylea3 This could be caused because the library is set as dynamic. can you try by changing it into static?
@cb-haripriyan I have tried setting it to static, but I still get the same error. I've spent the last couple of weeks trying to solve for this issue but haven't found anything. I figured it had to be something with my build settings, but everything seems to be in order.
@kylea3 Seems to be an issue when linking the SDK as a static framework rather than a static library.
Hi!, something like that in your podfile can help you to fix the error as well.
pre_install do |installer|
$dynamic_frameworks = [
'ChargebeeReactNative',
]
installer.pod_targets.each do |pod|
if $dynamic_frameworks.include?(pod.name)
puts "Overriding the build_type method for #{pod.name}"
def pod.build_type;
# NOTE: This syntax only works in cocoapods >= v1.11. Pre 1.11 BuildType was
# a simple single value.
BuildType.new(:linkage => :static)
end
end
end
end
target 'YourProject' do ....
Hi, I added "@chargebee/react-native-chargebee": "^2.4.5" to my project and now all builds fail with the the following error:
node_modules/@chargebee/react-native-chargebee/ios/ChargebeeReactNative.mm:2:9)
1 | #import "ChargebeeReactNative.h"
Adding @chargebee/react-native-chargebee to a new project doesn't cause and failed builds, so I am wondering if this has to do with another library that I imported for my project. One of the other libraries I am using (@react-native-firebase/app) uses static frameworks. Here is the implementation instructions from that package:
Open the file ./ios/Podfile and add this line inside your targets (right before the use_react_native line in current react-native releases that calls the react native Podfile function to get the native modules config):
use_frameworks! :linkage => :static To use Static Frameworks on iOS, you also need to manually enable this for the project with the following global to your /ios/Podfile file:
right after
use_frameworks! :linkage => :static
$RNFirebaseAsStaticFramework = true
Would static frameworks be causing the compatibility issues? If not, have you ran into this problem in any other scenarios?