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

I can't install the library on iOS React Native 0.64.0 #183

Open
Terry-Jiang-A opened this issue May 10, 2021 · 6 comments
Open

I can't install the library on iOS React Native 0.64.0 #183

Terry-Jiang-A opened this issue May 10, 2021 · 6 comments

Comments

@Terry-Jiang-A
Copy link

Terry-Jiang-A commented May 10, 2021

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':

  1. Target 'myApp' (project 'myApp'): LinkStoryboards
  2. 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

@Terry-Jiang-A Terry-Jiang-A changed the title I can't install the library on iOS React Native 0.63.4 I can't install the library on iOS React Native 0.64.0 May 10, 2021
@DeniferSantiago
Copy link

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

@Terry-Jiang-A
Copy link
Author

Terry-Jiang-A commented May 25, 2021

@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':

  1. Target 'XXX' (project 'XXX'): LinkStoryboards
  2. 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 .
image
Any help would be appreciated!

@DeniferSantiago
Copy link

DeniferSantiago commented May 25, 2021

yes its a bug, fix it alternatively by renaming your launch screen. In my case I changed it from LaunchScreen.storyboardc to SplashScreen.storyboardc

@sumangautam38
Copy link

@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”

@DeniferSantiago
Copy link

Try using this: react-native issue

@varunkamanibosc
Copy link

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

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

4 participants