prscX/react-native-photo-editor

react-native-photo-editor can't work with react-native-firebase on ios

nameslessjin opened this issue ยท 9 comments

I tried stand alone of react-native-photo-editor and react-native-firebase. They both worked fine. But When I install both dependencies and run react-native run-ios, it will return linker error and fail to build. It doesn't happen in Android.
React-native: 0.61.2

To reproduce the error.

Just download the Example provided in this repository then use "yarn add @react-native-firebase/app",
add the following below target 'Example' do:
pre_install do |installer|
Pod::Installer::Xcode::TargetValidator.send(:define_method, :verify_no_static_framework_transitive_dependencies) {}
end
then 'pod update' & 'react-native run-ios'

Pods

target 'Example' do
pre_install do |installer|
Pod::Installer::Xcode::TargetValidator.send(:define_method, :verify_no_static_framework_transitive_dependencies) {}
end
pod 'FBLazyVector', :path => "../node_modules/react-native/Libraries/FBLazyVector"
pod 'FBReactNativeSpec', :path => "../node_modules/react-native/Libraries/FBReactNativeSpec"
pod 'RCTRequired', :path => "../node_modules/react-native/Libraries/RCTRequired"
pod 'RCTTypeSafety', :path => "../node_modules/react-native/Libraries/TypeSafety"
pod 'React', :path => '../node_modules/react-native/'
pod 'React-Core', :path => '../node_modules/react-native/'
pod 'React-CoreModules', :path => '../node_modules/react-native/React/CoreModules'
pod 'React-Core/DevSupport', :path => '../node_modules/react-native/'
pod 'React-RCTActionSheet', :path => '../node_modules/react-native/Libraries/ActionSheetIOS'
pod 'React-RCTAnimation', :path => '../node_modules/react-native/Libraries/NativeAnimation'
pod 'React-RCTBlob', :path => '../node_modules/react-native/Libraries/Blob'
pod 'React-RCTImage', :path => '../node_modules/react-native/Libraries/Image'
pod 'React-RCTLinking', :path => '../node_modules/react-native/Libraries/LinkingIOS'
pod 'React-RCTNetwork', :path => '../node_modules/react-native/Libraries/Network'
pod 'React-RCTSettings', :path => '../node_modules/react-native/Libraries/Settings'
pod 'React-RCTText', :path => '../node_modules/react-native/Libraries/Text'
pod 'React-RCTVibration', :path => '../node_modules/react-native/Libraries/Vibration'
pod 'React-Core/RCTWebSocket', :path => '../node_modules/react-native/'

pod 'React-cxxreact', :path => '../node_modules/react-native/ReactCommon/cxxreact'
pod 'React-jsi', :path => '../node_modules/react-native/ReactCommon/jsi'
pod 'React-jsiexecutor', :path => '../node_modules/react-native/ReactCommon/jsiexecutor'
pod 'React-jsinspector', :path => '../node_modules/react-native/ReactCommon/jsinspector'
pod 'ReactCommon/jscallinvoker', :path => "../node_modules/react-native/ReactCommon"
pod 'ReactCommon/turbomodule/core', :path => "../node_modules/react-native/ReactCommon"
pod 'Yoga', :path => '../node_modules/react-native/ReactCommon/yoga'

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

target 'ExampleTests' do
inherit! :search_paths
# Pods for testing
end

use_native_modules!

pod 'RNPhotoEditor', :path => '../node_modules/react-native-photo-editor/ios'
pod 'rn-fetch-blob', :path => '../node_modules/rn-fetch-blob'
pod 'RNFS', :path => '../node_modules/react-native-fs'

use_frameworks!

pod 'iOSPhotoEditor', :git => 'https://github.com/prscX/photo-editor', :branch => 'master'

post_install do |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
end

Error

info Found Xcode workspace "Example.xcworkspace"
info Building (using "xcodebuild -workspace Example.xcworkspace -configuration Debug -scheme Example -destination id=516ECA7E-1FE0-4B39-BD28-A09215B1EB43 -derivedDataPath build/Example")
.......................
error Failed to build iOS project. We ran "xcodebuild" command but it exited with error code 65. To debug build logs further, consider building your app with Xcode.app, by opening Example.xcworkspace. Run CLI with --verbose flag for more details.
User defaults from command line:
IDEDerivedDataPathOverride = /Users/jinsenwu/Desktop/Try_out_some_libraries/react-native-photo-editor-master 2/Example/ios/build/Example

note: Using new build system
note: Planning build
note: Using build description from disk
Ld /Users/jinsenwu/Desktop/Try_out_some_libraries/react-native-photo-editor-master\ 2/Example/ios/build/Example/Build/Products/Debug-iphonesimulator/RNFBApp/RNFBApp.framework/RNFBApp normal x86_64 (in target 'RNFBApp' from project 'Pods')
cd /Users/jinsenwu/Desktop/Try_out_some_libraries/react-native-photo-editor-master\ 2/Example/ios/Pods
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang -target x86_64-apple-ios9.0-simulator -dynamiclib -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk -L/Users/jinsenwu/Desktop/Try_out_some_libraries/react-native-photo-editor-master\ 2/Example/ios/build/Example/Build/Products/Debug-iphonesimulator/RNFBApp -F/Users/jinsenwu/Desktop/Try_out_some_libraries/react-native-photo-editor-master\ 2/Example/ios/build/Example/Build/Products/Debug-iphonesimulator/RNFBApp -F/Users/jinsenwu/Desktop/Try_out_some_libraries/react-native-photo-editor-master\ 2/Example/ios/build/Example/Build/Products/Debug-iphonesimulator/DoubleConversion -F/Users/jinsenwu/Desktop/Try_out_some_libraries/react-native-photo-editor-master\ 2/Example/ios/build/Example/Build/Products/Debug-iphonesimulator/FirebaseCore -F/Users/jinsenwu/Desktop/Try_out_some_libraries/react-native-photo-editor-master\ 2/Example/ios/build/Example/Build/Products/Debug-iphonesimulator/FirebaseCoreDiagnostics -F/Users/jinsenwu/Desktop/Try_out_some_libraries/react-native-photo-editor-master\ 2/Example/ios/build/Example/Build/Products/Debug-iphonesimulator/FirebaseInstanceID -F/Users/jinsenwu/Desktop/Try_out_some_libraries/react-native-photo-editor-master\ 2/Example/ios/build/Example/Build/Products/Debug-iphonesimulator/Folly -F/Users/jinsenwu/Desktop/Try_out_some_libraries/react-native-photo-editor-master\ 2/Example/ios/build/Example/Build/Products/Debug-iphonesimulator/GoogleDataTransport -F/Users/jinsenwu/Desktop/Try_out_some_libraries/react-native-photo-editor-master\ 2/Example/ios/build/Example/Build/Products/Debug-iphonesimulator/GoogleDataTransportCCTSupport -F/Users/jinsenwu/Desktop/Try_out_some_libraries/react-native-photo-editor-master\ 2/Example/ios/build/Example/Build/Products/Debug-iphonesimulator/GoogleUtilities -F/Users/jinsenwu/Desktop/Try_out_some_libraries/react-native-photo-editor-master\ 2/Example/ios/build/Example/Build/Products/Debug-iphonesimulator/React-Core -F/Users/jinsenwu/Desktop/Try_out_some_libraries/react-native-photo-editor-master\ 2/Example/ios/build/Example/Build/Products/Debug-iphonesimulator/React-RCTActionSheet -F/Users/jinsenwu/Desktop/Try_out_some_libraries/react-native-photo-editor-master\ 2/Example/ios/build/Example/Build/Products/Debug-iphonesimulator/React-RCTAnimation -F/Users/jinsenwu/Desktop/Try_out_some_libraries/react-native-photo-editor-master\ 2/Example/ios/build/Example/Build/Products/Debug-iphonesimulator/React-RCTBlob -F/Users/jinsenwu/Desktop/Try_out_some_libraries/react-native-photo-editor-master\ 2/Example/ios/build/Example/Build/Products/Debug-iphonesimulator/React-RCTImage -F/Users/jinsenwu/Desktop/Try_out_some_libraries/react-native-photo-editor-master\ 2/Example/ios/build/Example/Build/Products/Debug-iphonesimulator/React-RCTLinking -F/Users/jinsenwu/Desktop/Try_out_some_libraries/react-native-photo-editor-master\ 2/Example/ios/build/Example/Build/Products/Debug-iphonesimulator/React-RCTNetwork -F/Users/jinsenwu/Desktop/Try_out_some_libraries/react-native-photo-editor-master\ 2/Example/ios/build/Example/Build/Products/Debug-iphonesimulator/React-RCTSettings -F/Users/jinsenwu/Desktop/Try_out_some_libraries/react-native-photo-editor-master\ 2/Example/ios/build/Example/Build/Products/Debug-iphonesimulator/React-RCTText -F/Users/jinsenwu/Desktop/Try_out_some_libraries/react-native-photo-editor-master\ 2/Example/ios/build/Example/Build/Products/Debug-iphonesimulator/React-RCTVibration -F/Users/jinsenwu/Desktop/Try_out_some_libraries/react-native-photo-editor-master\ 2/Example/ios/build/Example/Build/Products/Debug-iphonesimulator/React-cxxreact -F/Users/jinsenwu/Desktop/Try_out_some_libraries/react-native-photo-editor-master\ 2/Example/ios/build/Example/Build/Products/Debug-iphonesimulator/React-jsi -F/Users/jinsenwu/Desktop/Try_out_some_libraries/react-native-photo-editor-master\ 2/Example/ios/build/Example/Build/Products/Debug-iphonesimulator/React-jsiexecutor -F/Users/jinsenwu/Desktop/Try_out_some_libraries/react-native-photo-editor-master\ 2/Example/ios/build/Example/Build/Products/Debug-iphonesimulator/React-jsinspector -F/Users/jinsenwu/Desktop/Try_out_some_libraries/react-native-photo-editor-master\ 2/Example/ios/build/Example/Build/Products/Debug-iphonesimulator/Yoga -F/Users/jinsenwu/Desktop/Try_out_some_libraries/react-native-photo-editor-master\ 2/Example/ios/build/Example/Build/Products/Debug-iphonesimulator/glog -F/Users/jinsenwu/Desktop/Try_out_some_libraries/react-native-photo-editor-master\ 2/Example/ios/build/Example/Build/Products/Debug-iphonesimulator/nanopb -F/Users/jinsenwu/Desktop/Try_out_some_libraries/react-native-photo-editor-master\ 2/Example/ios/Pods/FirebaseAnalytics/Frameworks -F/Users/jinsenwu/Desktop/Try_out_some_libraries/react-native-photo-editor-master\ 2/Example/ios/Pods/GoogleAppMeasurement/Frameworks -filelist /Users/jinsenwu/Desktop/Try_out_some_libraries/react-native-photo-editor-master\ 2/Example/ios/build/Example/Build/Intermediates.noindex/Pods.build/Debug-iphonesimulator/RNFBApp.build/Objects-normal/x86_64/RNFBApp.LinkFileList -install_name @rpath/RNFBApp.framework/RNFBApp -Xlinker -rpath -Xlinker @executable_path/Frameworks -Xlinker -rpath -Xlinker @loader_path/Frameworks -dead_strip -Xlinker -object_path_lto -Xlinker /Users/jinsenwu/Desktop/Try_out_some_libraries/react-native-photo-editor-master\ 2/Example/ios/build/Example/Build/Intermediates.noindex/Pods.build/Debug-iphonesimulator/RNFBApp.build/Objects-normal/x86_64/RNFBApp_lto.o -Xlinker -export_dynamic -Xlinker -no_deduplicate -Xlinker -objc_abi_version -Xlinker 2 -fobjc-arc -fobjc-link-runtime -framework StoreKit -framework Foundation -compatibility_version 1 -current_version 1 -Xlinker -dependency_info -Xlinker /Users/jinsenwu/Desktop/Try_out_some_libraries/react-native-photo-editor-master\ 2/Example/ios/build/Example/Build/Intermediates.noindex/Pods.build/Debug-iphonesimulator/RNFBApp.build/Objects-normal/x86_64/RNFBApp_dependency_info.dat -o /Users/jinsenwu/Desktop/Try_out_some_libraries/react-native-photo-editor-master\ 2/Example/ios/build/Example/Build/Products/Debug-iphonesimulator/RNFBApp/RNFBApp.framework/RNFBApp
Undefined symbols for architecture x86_64:
"OBJC_CLASS$_GULAppEnvironmentUtil", referenced from:
objc-class-ref in FirebaseCore(FIRBundleUtil.o)
"_GULResetLogger", referenced from:
_FIRResetLogger in FirebaseCore(FIRLogger.o)
"_GULLoggerRegisterVersion", referenced from:
___FIRLoggerInitializeASL_block_invoke in FirebaseCore(FIRLogger.o)
"_GULLoggerInitializeASL", referenced from:
___FIRLoggerInitializeASL_block_invoke in FirebaseCore(FIRLogger.o)
"_GULLogBasic", referenced from:
_FIRLogBasic in FirebaseCore(FIRLogger.o)
"_GULLoggerEnableSTDERR", referenced from:
___FIRLoggerInitializeASL_block_invoke in FirebaseCore(FIRLogger.o)
"_GULIsLoggableLevel", referenced from:
_FIRIsLoggableLevel in FirebaseCore(FIRLogger.o)
"_GULSetLoggerLevel", referenced from:
_FIRSetLoggerLevel in FirebaseCore(FIRLogger.o)
"_GULLoggerForceDebug", referenced from:
___FIRLoggerInitializeASL_block_invoke in FirebaseCore(FIRLogger.o)
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)

** BUILD FAILED **

The following build commands failed:
Ld /Users/jinsenwu/Desktop/Try_out_some_libraries/react-native-photo-editor-master\ 2/Example/ios/build/Example/Build/Products/Debug-iphonesimulator/RNFBApp/RNFBApp.framework/RNFBApp normal x86_64
(1 failure)

Hey, has there anyway I can fix the linking issue?

I also couldn't get it to work with react-native-firebase v6. Any solution to this @prscX?

I also encountered this issue and a pretty hacky temporary workaround:

Open .podspec in node_modules/@react-native-firebase/app, auth, firestore (and any other @react-native-firebase libraries you're using), and manually change s.static_framework = false to s.static_framework = true.

My suspicions is that use_frameworks! isn't playing nicely. @prscX wondering if there's a possible workaround by not having to require the use of use_frameworks!?

Wow! Thanks @mickeywu, this works perfectly. @prscX please how do you get to add this to the doc? Because I didn't have to make any other hacks or fixes asides following the installation steps and this, thus making it clean and straight to the point.

prscX commented

Thanks @mickeywu for sharing the workaround. use_framework is needed since the native photo editor library is in Swift and as per my understanding the only way to add is define it in Podfile under use_framework, I have also tried by adding to library podsepc but it did not worked because we are not able to specify git path and branch we only can add name of dependency lib name.

I will this to know issues on README.

Hi guys,

Just look around and found this guy's solution, work as well for me, you should take a look
here

Hi guys,

Just look around and found this guy's solution, work as well for me, you should take a look
here

Solves the problem even easier. Thanks @hieupaul and please @prscX add this to the ReadMe doc, say under troubleshooting. And I can do a PR if that helps

prscX commented

@nwaughachukwuma: Thanks for extending help. It would be very helpful if you can share a PR for the same. Will definitely merge it on priority.

@nwaughachukwuma: Thanks for extending help. It would be very helpful if you can share a PR for the same. Will definitely merge it on priority.

Alright @prscX. PR now done and can be found at #115