Closed Doko-Demo-Doa closed 4 years ago
Found the solution: Add following code to the Podfile
:
dynamic_frameworks = ['BRYXBanner', 'RSSelectionMenu']
# Make all the other frameworks into static frameworks by overriding the static_framework? function to return true
pre_install do |installer|
installer.pod_targets.each do |pod|
if !dynamic_frameworks.include?(pod.name)
def pod.static_framework?;
true
end
def pod.build_type;
Pod::BuildType.static_library
end
end
end
end
It should look like this as a whole:
add_flipper_pods!
post_install do |installer|
flipper_post_install(installer)
installer.pods_project.targets.each do |target|
if target.name.include?('BRYXBanner')
target.build_configurations.each do |config|
config.build_settings['SWIFT_VERSION'] = '4.2'
end
end
if target.name.include?('RSSelectionMenu')
target.build_configurations.each do |config|
config.build_settings['SWIFT_VERSION'] = '4.2'
end
end
end
end
dynamic_frameworks = ['BRYXBanner', 'RSSelectionMenu']
# Make all the other frameworks into static frameworks by overriding the static_framework? function to return true
pre_install do |installer|
installer.pod_targets.each do |pod|
if !dynamic_frameworks.include?(pod.name)
def pod.static_framework?;
true
end
def pod.build_type;
Pod::BuildType.static_library
end
end
end
end
Many Thanks @Doko-Demo-Doa for sharing the fix. You have saved my day 😄, I was actually planning to look into this issue.
I have updated README
with the installation steps and will update the same at other libraries as well.
Thanks </ Pranav >
@prscX I think you should add a more detailed description for this kind of issue. For example, two libraries I use are react-native-notification-banner
and react-native-selection-menu
. To use them at once, first we need to config the Swift version for each:
post_install do |installer|
flipper_post_install(installer)
# This one is for react-native-notification-banner
installer.pods_project.targets.each do |target|
if target.name.include?('BRYXBanner')
target.build_configurations.each do |config|
config.build_settings['SWIFT_VERSION'] = '4.2'
end
end
# This one is for react-native-selection-menu
if target.name.include?('RSSelectionMenu')
target.build_configurations.each do |config|
config.build_settings['SWIFT_VERSION'] = '4.1'
end
end
end
end
At the last block, we have to make other frameworks into static framework, excluding above libs, so dynamic_frameworks
will be declared as array:
dynamic_frameworks = ['BRYXBanner', 'RSSelectionMenu'] # << Here, add the lib name.
# Make all the other frameworks into static frameworks by overriding the static_framework? function to return true
pre_install do |installer|
installer.pod_targets.each do |pod|
if !dynamic_frameworks.include?(pod.name)
def pod.static_framework?;
true
end
def pod.build_type;
Pod::BuildType.static_library
end
end
end
end
It will be easier to understand.
This is part of my
Podfile
:I use two libraries of yours: notification banner and selection menu. And the issue is:
What could be wrong?