Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

react-native-photo-editor giving Linking error while run the project #93

Open
arjundalal opened this issue Nov 12, 2019 · 39 comments
Open
Assignees

Comments

@arjundalal
Copy link

When we install react-native-photo-editor library on IOS react native it will give linking error please help me to solve it. the error is as follows
Screenshot 2019-11-12 at 2 54 59 PM
please help me tp solve this error.

@DarkbaronHUST
Copy link

+1 same issue! is there any way to install library on IOS with cocoapods ?
I'm using RN 0.60.
If we have to link library manual, please tell me know exact steps? the instruction seem not work for me :(
Thanks all !

@DarkbaronHUST
Copy link

DarkbaronHUST commented Nov 14, 2019

When we install react-native-photo-editor library on IOS react native it will give linking error please help me to solve it. the error is as follows
Screenshot 2019-11-12 at 2 54 59 PM
please help me tp solve this error.

Did U find how to slove this issue. It's work fine on Android, but I can not make its work on iOS ! pls help !

@arjundalal
Copy link
Author

arjundalal commented Nov 14, 2019 via email

@DarkbaronHUST
Copy link

DarkbaronHUST commented Nov 14, 2019

i'm able to get throw this error by adding :

pod 'RNPhotoEditor', :path => '../node_modules/react-native-photo-editor/ios'
use_frameworks!
pod 'iOSPhotoEditor', :git => 'https://github.com/prscX/photo-editor', :branch => 'master'

to Podfile, then run pod update

(if u get error when run app, its because libraris conflict when use_frameworks! ==> Add s.static_framework = true to podspec to get throw this error)

When APP builded, im going to edit image, but nothing happend, log from xcode show that :

picturemessage_mzo3ql23 e3l

and now, i'm stuck here.

help !

@beobungbu
Copy link

  1. Double check your Pod file and make sure you have removed the "#" sign before "use_frameworks!"
  2. make sure you have added the below code to your pod file.
use_native_modules!

  pod 'RNPhotoEditor', :path => '../node_modules/react-native-photo-editor/ios'

  use_frameworks!

  pod 'iOSPhotoEditor', :git => 'https://github.com/prscX/photo-editor', :branch => 'master'
  1. run pod update
  2. in case of getting error like
    The 'Pods-xxxxx' target has transitive dependencies that include statically linked binaries:
    So you can easily fix it by adding the code below to your xxxxx target in your pod file
pre_install do |installer|
  Pod::Installer::Xcode::TargetValidator.send(:define_method, :verify_no_static_framework_transitive_dependencies) {}
  end

@prscX
Copy link
Owner

prscX commented Dec 1, 2019

Thanks @arjundalal for raising the issue.

I have updated installation steps, could you please try this with RN61, since it has better support for use_frameworks!.

Thanks
</ Pranav >

@arjundalal
Copy link
Author

arjundalal commented Dec 1, 2019 via email

@arjundalal
Copy link
Author

arjundalal commented Dec 2, 2019 via email

@beobungbu
Copy link

beobungbu commented Dec 2, 2019

okay, i fixed it by doing:

  1. if you getting stuck at Google's Libraries like GMap, Firebase, ... just add it manually,
  2. you can replace use_frameworks! by use_modular_headers!
  3. If you can't replace it with use_modular_headers!, then add code bellow right after use_frameworks!
$dynamic_frameworks = ['RxCocoa', 'RxSwift']

pre_install do |installer|
  installer.pod_targets.each do |pod|
    if !$dynamic_frameworks.include?(pod.name)
      puts "Overriding the static_framework? method for #{pod.name}"
      def pod.build_type;
        Pod::Target::BuildType.static_library
      end
    end
  end
end

Hi Team Still i am getting error can you help me to resolve it. Regards, Arjun Dalal

On Sun, 1 Dec 2019 at 10:33, Arjun Dalal @.> wrote: Hiii Pranav and all Till i am getting the same issue can any one help me to solve this issue. Regards, Arjun Dalal. On Sun, 1 Dec 2019, 10:22 am Pranav Raj Singh Chauhan, < @.> wrote: > Thanks @arjundalal https://github.com/arjundalal for raising the issue. > > I have updated installation steps, could you please try this with RN61, > since it has better support for use_frameworks!. > > Thanks > </ Pranav > > > — > You are receiving this because you were mentioned. > Reply to this email directly, view it on GitHub > <#93?email_source=notifications&email_token=AM57WLG53ILRPCY6DP7JDQDQWM7JNA5CNFSM4JMATKHKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEFQ4J6A#issuecomment-560055544>, > or unsubscribe > https://github.com/notifications/unsubscribe-auth/AM57WLCE6QTEHSKTZHOC5RLQWM7JNANCNFSM4JMATKHA > . >

@prscX prscX self-assigned this Dec 2, 2019
@prscX
Copy link
Owner

prscX commented Dec 2, 2019

@arjundalal: Could you please share your app software stack.

Thanks
</ Pranav >

@arjundalal
Copy link
Author

arjundalal commented Dec 2, 2019 via email

@arjundalal
Copy link
Author

arjundalal commented Dec 2, 2019 via email

@arjundalal
Copy link
Author

arjundalal commented Dec 2, 2019 via email

@beobungbu
Copy link

Use xcode 10 instead of xcode 11 please.
Add the swift path to libraries search path in your target

@arjundalal
Copy link
Author

arjundalal commented Dec 3, 2019 via email

@maxmijn
Copy link
Contributor

maxmijn commented Dec 4, 2019

okay, i fixed it by doing:

1. if you getting stuck at Google's Libraries like GMap, Firebase, ... just add it manually,

2. you can replace use_frameworks! by use_modular_headers!

3. If you can't replace it with use_modular_headers!, then add code bellow right after use_frameworks!
$dynamic_frameworks = ['RxCocoa', 'RxSwift']

pre_install do |installer|
  installer.pod_targets.each do |pod|
    if !$dynamic_frameworks.include?(pod.name)
      puts "Overriding the static_framework? method for #{pod.name}"
      def pod.build_type;
        Pod::Target::BuildType.static_library
      end
    end
  end
end

Hi Team Still i am getting error can you help me to resolve it. Regards, Arjun Dalal

On Sun, 1 Dec 2019 at 10:33, Arjun Dalal @.> wrote: Hiii Pranav and all Till i am getting the same issue can any one help me to solve this issue. Regards, Arjun Dalal. On Sun, 1 Dec 2019, 10:22 am Pranav Raj Singh Chauhan, < _@**.**_> wrote: > Thanks @arjundalal https://github.com/arjundalal for raising the issue. > > I have updated installation steps, could you please try this with RN61, > since it has better support for use_frameworks!. > > Thanks > </ Pranav > > > — > You are receiving this because you were mentioned. > Reply to this email directly, view it on GitHub > <#93?email_source=notifications&email_token=AM57WLG53ILRPCY6DP7JDQDQWM7JNA5CNFSM4JMATKHKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEFQ4J6A#issuecomment-560055544>, > or unsubscribe > https://github.com/notifications/unsubscribe-auth/AM57WLCE6QTEHSKTZHOC5RLQWM7JNANCNFSM4JMATKHA > . >

Hi guys,

I also got it to work on Android, but iOS gets me from error to error. After following these steps I get a 100 'undefined symbol' errors. I'm an iOS newby, so can't really make sense of it.

My stack:

  • react-native = 0.60
  • Xcode = 11.2.1
  • Podfile =
# Uncomment the next line to define a global platform for your project
platform :ios, '10.0'
require_relative '../node_modules/@react-native-community/cli-platform-ios/native_modules'

target 'SIWI' do

  pre_install do |installer|
    Pod::Installer::Xcode::TargetValidator.send(:define_method, :verify_no_static_framework_transitive_dependencies) {}
    end
  # Uncomment the next line if you're using Swift or would like to use dynamic frameworks
  # use_frameworks!

  # Pods for SIWI
  pod 'React', :path => '../node_modules/react-native/'
  pod 'React-Core', :path => '../node_modules/react-native/React'
  pod 'React-DevSupport', :path => '../node_modules/react-native/React'
  pod 'React-fishhook', :path => '../node_modules/react-native/Libraries/fishhook'
  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-RCTWebSocket', :path => '../node_modules/react-native/Libraries/WebSocket'

  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 'yoga', :path => '../node_modules/react-native/ReactCommon/yoga'

  # Required by RSKImageCropper
  pod 'RSKImageCropper', :git => 'https://github.com/trivetechnology/RSKImageCropper.git'

  pod 'RNFastImage', :path => '../node_modules/react-native-fast-image'
  pod 'react-native-contacts', :path => '../node_modules/react-native-contacts'

  # Third party deps podspec link
  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 'SIWI-tvOSTests' do
    inherit! :search_paths
    # Pods for testing
    pod 'RNFastImage', :path => '../node_modules/react-native-fast-image'

  end

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

  pod 'RNPhotoEditor', :path => '../node_modules/react-native-photo-editor/ios'

  use_frameworks!
  $dynamic_frameworks = ['RxCocoa', 'RxSwift']

  pre_install do |installer|
    installer.pod_targets.each do |pod|
      if !$dynamic_frameworks.include?(pod.name)
        puts "Overriding the static_framework? method for #{pod.name}"
        def pod.build_type;
          Pod::Target::BuildType.static_library
        end
      end
    end
  end

  
  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

@maxmijn
Copy link
Contributor

maxmijn commented Dec 4, 2019

I fixed the above errors by adding an empty swift file to my project, based on this thread:
https://stackoverflow.com/a/56176956

@arjundalal
Copy link
Author

arjundalal commented Dec 5, 2019 via email

@arjundalal
Copy link
Author

Hello Team,
How can i resolve above error.
please help

@mobilestar0223
Copy link

Hello, @arjundalal
Could you share Podfile if you solve this problem?
Thanks

@mobilestar0223
Copy link

My stack:

  • RN: 0.61.5
  • Xcode: 11.1
  • Cocoapod: 1.8.4

I have checked all above things, but failed to build iOS project.

Please help me!

@arjundalal
Copy link
Author

yes sure
My pod file is as follows:

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'

pod 'RNSketchCanvas', :path => '../node_modules/@terrylinla/react-native-sketch-canvas'

pod 'RNVectorIcons', :path => '../node_modules/react-native-vector-icons'
pod 'Firebase/Messaging'
pod 'Firebase/Core'
pod 'RNFirebase', :path => '../node_modules/react-native-firebase/ios'

use_native_modules!

pod 'RNPhotoEditor', :path => '../node_modules/react-native-photo-editor/ios'

use_frameworks!

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

pod 'react-native-apple-authentication', :path => '../node_modules/react-native-apple-authentication'

post_install do |installer|

rnfirebase = installer.pods_project.targets.find { |target| target.name == 'RNFirebase' }
rnfirebase.build_configurations.each do |config|
  config.build_settings['HEADER_SEARCH_PATHS'] = '$(inherited) ${PODS_ROOT}/Headers/Public/**'
end

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

@arjundalal
Copy link
Author

please check my pod file data

@mobilestar0223
Copy link

Thanks for your reply.

[!] The 'Pods-PikadishApp' target has transitive dependencies that include statically linked binaries: (FirebaseAuth, FirebaseCore, FirebaseCoreDiagnostics, GoogleDataTransportCCTSupport, GoogleDataTransport, FirebaseInstanceID, and FirebaseFirestore)

I got this error during pod install.

@arjundalal
Copy link
Author

have you install this pod manually

@mobilestar0223
Copy link

Yes.
According to installation document, I edited Podfile and run pod install.

@mobilestar0223
Copy link

I copy/paste below code on Podfile from your Podfile, and got above issue.

post_install do |installer|
rnfirebase = installer.pods_project.targets.find { |target| target.name == 'RNFirebase' }
rnfirebase.build_configurations.each do |config|
  config.build_settings['HEADER_SEARCH_PATHS'] = '$(inherited) ${PODS_ROOT}/Headers/Public/**'
end

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

@arjundalal
Copy link
Author

i think this is pod installation issue.
please delete pod folder and re-install it.
in react 0.61.5 pod link automatically by running command pod install

@arjundalal
Copy link
Author

actually i use firebase so i write code like this.
post_install do |installer|
rnfirebase = installer.pods_project.targets.find { |target| target.name == 'RNFirebase' }
rnfirebase.build_configurations.each do |config|
config.build_settings['HEADER_SEARCH_PATHS'] = '$(inherited) ${PODS_ROOT}/Headers/Public/**'
end

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

@arjundalal
Copy link
Author

if you dont use firebase than use only this code
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

@mobilestar0223
Copy link

I also use firebase.

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'

pod 'RNVectorIcons', :path => '../node_modules/react-native-vector-icons'

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

use_native_modules!
pod 'RNPhotoEditor', :path => '../node_modules/react-native-photo-editor/ios'

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

post_install do |installer|
  rnfirebase = installer.pods_project.targets.find { |target| target.name == 'RNFirebase' }
  rnfirebase.build_configurations.each do |config|
    config.build_settings['HEADER_SEARCH_PATHS'] = '$(inherited) ${PODS_ROOT}/Headers/Public/**'
  end

  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

This is my Podfile

@arjundalal
Copy link
Author

than what the issue

@mobilestar0223
Copy link

Error during pod install.
[!] The 'Pods-PikadishApp' target has transitive dependencies that include statically linked binaries: (FirebaseAuth, FirebaseCore, FirebaseCoreDiagnostics, GoogleDataTransportCCTSupport, GoogleDataTransport, FirebaseInstanceID, and FirebaseFirestore)

@arjundalal
Copy link
Author

please follow this documentation for firebase. i think the issue is of firebase
https://rnfirebase.io/docs/v5.x.x/installation/initial-setup

@mobilestar0223
Copy link

Sorry. It's same error after I followed firebase installation.

@nwaughachukwuma
Copy link
Contributor

@prscX is there a standard approach for setting up on iOS?

@nwaughachukwuma
Copy link
Contributor

Use xcode 10 instead of xcode 11 please.
Add the swift path to libraries search path in your target

Please can you be clearer here? A little more details

@nwaughachukwuma
Copy link
Contributor

I fixed the above errors by adding an empty swift file to my project, based on this thread:
https://stackoverflow.com/a/56176956

Please how what did you do in the context of this package? It would help if you specified the steps here

@russelRajitha
Copy link

I fixed the above errors by adding an empty swift file to my project, based on this thread:
https://stackoverflow.com/a/56176956

you saved my day buddy. i was looking for a solution for a week.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

8 participants