numandev1 / react-native-compressor

🗜️Compress Image, Video, and Audio same like Whatsapp 🚀✨
MIT License
904 stars 85 forks source link

react-native update from 0.70.6 to 0.71.0, error with RCT-Folly #232

Open Larens94 opened 10 months ago

Larens94 commented 10 months ago

I upgraded react-native from version 070.6 to 0.71.0. When I do the pod install it gives me this error: '[!] The following Swift pods cannot yet be integrated as static libraries:

The Swift pod react-native-compressor depends upon RCT-Folly, 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 tried adding 'pod 'RCT-Folly', :modular_headers => true' as suggested, but it gave me another error '[!] There are multiple dependencies with different sources for RCT-Folly in Podfile:

Even if there is no other declaration for RCT-Folly in my Podfile

Platform

React Native Version 0.71.0

React Native Compressor Version 0.18.15

This is my Podfile

require_relative '../node_modules/react-native/scripts/react_native_pods' require_relative '../node_modules/@react-native-community/cli-platform-ios/native_modules'

platform :ios, '12.4' install! 'cocoapods', :deterministic_uuids => false

If you're using autolinking, this line might not be needed

pod 'WatermelonDB', :path => '../node_modules/@nozbe/watermelondb'

NOTE: Do not remove, needed to keep WatermelonDB compiling:

pod 'React-jsi', :path => '../node_modules/react-native/ReactCommon/jsi', :modular_headers => true

NOTE: This is required as of v0.23

pod 'simdjson', path: '../node_modules/@nozbe/simdjson'

pod 'RNFS', :path => '../node_modules/react-native-fs' pod 'react-native-contacts', :path => '../node_modules/react-native-contacts' pod 'Firebase', :modular_headers => true pod 'FirebaseCore', :modular_headers => true pod 'FirebaseCoreInternal', :modular_headers => true pod 'GoogleUtilities', :modular_headers => true

pod 'JitsiMeetSDK', :git => 'https://github.com/Larens94/jitsi-meet-ios-sdk-releases', :branch => 'ex-04'

target 'Talk' do config = use_native_modules! permissions_path = '../node_modules/react-native-permissions/ios' pod 'Permission-Microphone', :path => "#{permissions_path}/Microphone"

Flags change depending on the env values.

flags = get_default_flags()

use_react_native!( :path => config[:reactNativePath],

Hermes is now enabled by default. Disable by setting this flag to false.

# Upcoming versions of React Native may rely on get_default_flags(), but
# we make it explicit here to aid in the React Native upgrade process.
:hermes_enabled => true,
:fabric_enabled => flags[:fabric_enabled],
# Enables Flipper.
#
# Note that if you have use_frameworks! enabled, Flipper will not work and
# you should disable the next line.
:flipper_configuration => FlipperConfiguration.enabled,
# An absolute path to your application root.
:app_path => "#{Pod::Config.instance.installation_root}/.."

)

target 'TalkTests' do inherit! :complete

Pods for testing

end

post_install do |installer| react_native_post_install( installer,

Set mac_catalyst_enabled to true in order to apply patches

  # necessary for Mac Catalyst builds
  :mac_catalyst_enabled => false
)
__apply_Xcode_12_5_M1_post_install_workaround(installer)

installer.pods_project.targets.each do |target|
  target.build_configurations.each do |config|
    config.build_settings['APPLICATION_EXTENSION_API_ONLY'] = 'NO'
  end
end

end

target 'ShareExtension' do use_react_native!

pod 'RNShareMenu', :path => '../node_modules/react-native-share-menu'
# Manually link packages here to keep your extension bundle size minimal

end end

github-actions[bot] commented 10 months ago

👋 @Larens94 Thanks for opening your issue here! If you find this package useful hit the star🌟!

numandev1 commented 10 months ago

@Larens94 we are already setting use_modular_headers! in our example directory code

https://github.com/numandev1/react-native-compressor/blob/a01c52cf5f3985dd586cb7c74c70136896189389/example/ios/Podfile#L22

can we see it on zoom session?

numandev1 commented 10 months ago

@Larens94 i confirm that modular_headers is also working on my side, pod 'react-native-compressor', :path => '../node_modules/react-native-compressor', :modular_headers => true

ArindamRayMukherjee commented 8 months ago

Facing the same issue here. And people have faced this issue many times in the past it seems, without a proper solution for themselves. https://github.com/numandev1/react-native-compressor/issues/187 https://github.com/numandev1/react-native-compressor/issues/103 https://github.com/numandev1/react-native-compressor/issues/46

(The example project works because it is minimal and uses use_modular_headers! globally , but that does not work for realistic projects that depend on other libs that don't like use_modular_headers)

The following does not work in my case

pod 'react-native-compressor', :path => '../node_modules/react-native-compressor', :modular_headers => true

I still get

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

The Swift pod react-native-compressor depends upon React-Fabric, React-graphics, React-utils, and React->debug, which do 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.

If I use use_modular_headers! I get arbitrary failures at other parts of the build process, like

The following build commands failed: CompileC /Users/arindamray/Library/Developer/Xcode/DerivedData/DanceAway->hagtrhcdkueyucdwmsznhlrslqjs/Build/Intermediates.noindex/Pods.build/Debug-iphonesimulator/React->utils.build/Objects-normal/arm64/ManagedObjectWrapper.o >/Users/arindamray/IdeaProjects/temp/DanceAppCopy/node_modules/react->native/ReactCommon/react/utils/ManagedObjectWrapper.mm normal arm64 objective-c++ >com.apple.compilers.llvm.clang.1_0.compiler (in target 'React-utils' from project 'Pods') PhaseScriptExecution [CP]\ Copy\ XCFrameworks >/Users/arindamray/Library/Developer/Xcode/DerivedData/DanceAway->hagtrhcdkueyucdwmsznhlrslqjs/Build/Intermediates.noindex/Pods.build/Debug->iphonesimulator/FBSDKCoreKit.build/Script-46EB2E00024390.sh (in target 'FBSDKCoreKit' from project 'Pods') (2 failures)