react-native-photo-editor
react-native-photo-editor copied to clipboard
I can't install the library on iOS React Native 0.64.0
I have tried to go through the library installation steps but can't get it to work on iOS. Now I am getting the error: Multiple commands produce '/Users/xxx/Library/Developer/Xcode/DerivedData/myApp-adubuhkkqoeyktbpefmzjdnrepxa/Build/Products/Debug-iphonesimulator/myApp.app/LaunchScreen.storyboardc':
- Target 'myApp' (project 'myApp'): LinkStoryboards
- That command depends on command in Target 'myApp' (project 'myApp'): script phase “[CP] Copy Pods Resources”
pod file: require_relative '../node_modules/react-native/scripts/react_native_pods' require_relative '../node_modules/@react-native-community/cli-platform-ios/native_modules'
platform :ios, '10.0'
target 'myApp' do pod 'Google-Mobile-Ads-SDK', '~> 7.8' pod 'react-native-ffmpeg/full-gpl-lts', :podspec => '../node_modules/react-native-ffmpeg/react-native-ffmpeg.podspec' config = use_native_modules!
use_react_native!(
:path => config[:reactNativePath],
# to enable hermes on iOS, change false
to true
and then install pods
:hermes_enabled => false
)
pod 'RNPhotoEditor', :path => '../node_modules/react-native-photo-editor/ios'
use_frameworks! :linkage => :static
pod 'iOSPhotoEditor', :git => 'https://github.com/prscX/photo-editor', :branch => 'master'
pod 'react-native-camera', :path => '../node_modules/react-native-camera'
target 'myAppTests' do inherit! :complete # Pods for testing end
Enables Flipper.
Note that if you have use_frameworks! enabled, Flipper will not work and
you should disable the next line.
use_flipper!({ 'Flipper' => '0.74.0' })
post_install do |installer| react_native_post_install(installer) installer.pods_project.targets.each do |target| if target.name.include?('iOSPhotoEditor') target.build_configurations.each do |config| config.build_settings['SWIFT_VERSION'] = '5' end end end end
Follow Flipper iOS Setup Guidelines
This is required because iOSPhotoEditor is implemented using Swift and we have to use use_frameworks! in Podfile
$static_framework = ['FlipperKit', 'Flipper', 'Flipper-Folly', 'CocoaAsyncSocket', 'ComponentKit', 'Flipper-DoubleConversion', 'Flipper-Glog', 'Flipper-PeerTalk', 'Flipper-RSocket', 'Yoga', 'YogaKit', 'CocoaLibEvent', 'OpenSSL-Universal', 'boost-for-react-native']
pre_install do |installer| Pod::Installer::Xcode::TargetValidator.send(:define_method, :verify_no_static_framework_transitive_dependencies) {} installer.pod_targets.each do |pod| if $static_framework.include?(pod.name) def pod.build_type; Pod::BuildType.static_library end end end end end
System Info: OS: macOS 11.3 CPU: (4) x64 Intel(R) Core(TM) i5-4278U CPU @ 2.60GHz Memory: 421.41 MB / 8.00 GB Shell: 5.8 - /bin/zsh Binaries: Node: 15.11.0 - /usr/local/bin/node Yarn: Not Found npm: 7.8.0 - /usr/local/bin/npm Watchman: 4.9.0 - /usr/local/bin/watchman Managers: CocoaPods: 1.10.1 - /usr/local/bin/pod SDKs: iOS SDK: Platforms: iOS 14.5, DriverKit 20.4, macOS 11.3, tvOS 14.5, watchOS 7.4 Android SDK: API Levels: 23, 24, 25, 26, 27, 28, 29, 8 Build Tools: 26.0.2, 27.0.2, 27.0.3, 28.0.3, 29.0.2, 29.0.3, 30.0.3 System Images: android-23 | Google APIs Intel x86 Atom, android-29 | Google APIs Intel x86 Atom, android-30 | Google APIs Intel x86 Atom Android NDK: 22.0.7026061 IDEs: Android Studio: 4.1 AI-201.8743.12.41.7042882 Xcode: 12.5/12E262 - /usr/bin/xcodebuild Languages: Java: 1.8.0_282 - /usr/bin/javac npmPackages: @react-native-community/cli: Not Found react: 17.0.1 => 17.0.1 react-native: 0.64.0 => 0.64.0 react-native-macos: Not Found
In RN 0.64.0 I added the following:
use_flipper!({ 'Flipper-Folly' => '2.5.3', 'Flipper' => '0.87.0', 'Flipper-RSocket' => '1.3.1' })
$static_framework = ['FlipperKit', 'Flipper', 'Flipper-Folly',
'CocoaAsyncSocket', 'ComponentKit', 'Flipper-DoubleConversion',
'Flipper-Glog', 'Flipper-PeerTalk', 'Flipper-RSocket', 'Flipper-Folly', 'YogaKit',
'libevent', 'OpenSSL-Universal', 'boost-for-react-native']
pre_install do |installer|
Pod::Installer::Xcode::TargetValidator.send(:define_method, :verify_no_static_framework_transitive_dependencies) {}
installer.pod_targets.each do |pod|
if $static_framework.include?(pod.name)
def pod.build_type;
Pod::BuildType.static_library
end
end
end
end
@DeniferSantiago Thanks for your help, But still no luck. And I still get the error like this: error: Multiple commands produce '/Users/XXX/Library/Developer/Xcode/DerivedData/XXX-adubuhkkqoeyktbpefmzjdnrepxa/Build/Products/Debug-iphonesimulator/XXX.app/LaunchScreen.storyboardc':
- Target 'XXX' (project 'XXX'): LinkStoryboards
- That command depends on command in Target 'XXX' (project 'XXX'): script phase “[CP] Copy Pods Resources”
And I can't find the item "$ {TARGET_BUILD_DIR} / $ {UNLOCALIZED_RESOURCES_FOLDER_PATH} /LauchScreen.storyboard from Build phases -> [CP] Copy Pods Resources -> Output files .
Any help would be appreciated!
yes its a bug, fix it alternatively by renaming your launch screen. In my case I changed it from LaunchScreen.storyboardc
to SplashScreen.storyboardc
@DeniferSantiago please help to solve this issue
Cycle inside FBReactNativeSpec; building could produce unreliable results. This usually can be resolved by moving the shell script phase '[CP-User] Generate Specs' so that it runs before the build phase that depends on its outputs. Cycle details: → Target 'FBReactNativeSpec': Libtool /Users/sumangautam/Library/Developer/Xcode/DerivedData/photoeditios-fqrnxofklyxdqyhdjoorsyyqltew/Build/Products/Debug-iphonesimulator/FBReactNativeSpec/FBReactNativeSpec.framework/FBReactNativeSpec normal ○ Target 'FBReactNativeSpec' has compile command with input '/Users/sumangautam/brightapp/brightios/photoeditios/ios/Pods/Target Support Files/FBReactNativeSpec/FBReactNativeSpec-dummy.m' ○ That command depends on command in Target 'FBReactNativeSpec': script phase “[CP-User] Generate Specs” ○ Target 'FBReactNativeSpec' has copy command from '/Users/sumangautam/brightapp/brightios/photoeditios/node_modules/react-native/React/FBReactNativeSpec/FBReactNativeSpec/FBReactNativeSpec.h' to '/Users/sumangautam/Library/Developer/Xcode/DerivedData/photoeditios-fqrnxofklyxdqyhdjoorsyyqltew/Build/Products/Debug-iphonesimulator/FBReactNativeSpec/FBReactNativeSpec.framework/Headers/FBReactNativeSpec.h' ○ That command depends on command in Target 'FBReactNativeSpec': script phase “[CP-User] Generate Specs”
Try using this: react-native issue
In RN 0.64.0 I added the following:
use_flipper!({ 'Flipper-Folly' => '2.5.3', 'Flipper' => '0.87.0', 'Flipper-RSocket' => '1.3.1' }) $static_framework = ['FlipperKit', 'Flipper', 'Flipper-Folly', 'CocoaAsyncSocket', 'ComponentKit', 'Flipper-DoubleConversion', 'Flipper-Glog', 'Flipper-PeerTalk', 'Flipper-RSocket', 'Flipper-Folly', 'YogaKit', 'libevent', 'OpenSSL-Universal', 'boost-for-react-native'] pre_install do |installer| Pod::Installer::Xcode::TargetValidator.send(:define_method, :verify_no_static_framework_transitive_dependencies) {} installer.pod_targets.each do |pod| if $static_framework.include?(pod.name) def pod.build_type; Pod::BuildType.static_library end end end end
Thanks @DeniferSantiago This helped a lot