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

how to use the third party module that don't support cocoapods #21365

Closed
EternalChildren opened this issue Sep 27, 2018 · 4 comments
Closed

how to use the third party module that don't support cocoapods #21365

EternalChildren opened this issue Sep 27, 2018 · 4 comments
Labels
Ran Commands One of our bots successfully processed a command. Resolution: Locked This issue was locked by the bot. Type: Question Issues that are actually questions and not bug reports.

Comments

@EternalChildren
Copy link

EternalChildren commented Sep 27, 2018

Environment:

React Native Environment Info:
System:
OS: macOS High Sierra 10.13.6
CPU: x64 Intel(R) Core(TM) i5-7360U CPU @ 2.30GHz
Memory: 198.28 MB / 8.00 GB
Shell: 3.2.57 - /bin/bash
Binaries:
Node: 10.1.0 - ~/.nvm/versions/node/v10.1.0/bin/node
npm: 6.4.0 - ~/.nvm/versions/node/v10.1.0/bin/npm
Watchman: 4.9.0 - /usr/local/bin/watchman
SDKs:
iOS SDK:
Platforms: iOS 12.0, macOS 10.14, tvOS 12.0, watchOS 5.0
IDEs:
Xcode: 10.0/10A255 - /usr/bin/xcodebuild
npmPackages:
react: ^16.5.0 => 16.5.2
react-native: ^0.57.1 => 0.57.1
npmGlobalPackages:
create-react-native-app: 1.0.0
react-native-cli: 2.0.1

Problem:

  1. integration react-native with Existing Apps like doc
    (tip:This method uses cocoapods to integrate react)
  2. increase a third party module, example react-native-qq, a third party module don't support cocoapods
  3. so, i have to drop the RCTQQAPI.xcodeproj into my project like this
  4. now, build it. i'll get a wrong. 'React/RCTViewManager.h' file not found
    (tip: this wrong target in react-native-qq)

so who can tell me how to resolve it. i want to enjoy to manager my react-native by cocoapods.
i don't want to drop the react.xcodeproj to my project

package.json:

{
"name": "react-native-template",
"version": "1.0.0",
"description": "",
"main": "index.js",
"scripts": {
"start": "node node_modules/react-native/local-cli/cli.js start"
},
"dependencies": {
"react": "^16.5.0",
"react-native": "^0.57.1",
"react-native-qq": "^2.0.5",
}
}

Podfile:

platform :ios, '9.0'
use_frameworks!
target 'react-native-template' do
pod 'React', :path => '../node_modules/react-native', :subspecs => [
'Core',
'CxxBridge', # Include this for RN >= 0.47
'DevSupport', # Include this to enable In-App Devmenu if RN >= 0.43
'RCTText',
'RCTNetwork',
'RCTWebSocket', # needed for debugging
]
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'
end

Template:

i provide a template to help u reproduce the problem. (https://github.com/EternalChildren/react-native-template)
because the module above needs some extrate configs. So i use a third party module named react-native-linear-gradient. I know it support pods. but i want to use it by the way in this demo

  1. clone the demo
  2. into the dir and npm install it
  3. then cd ios/ && pod install
  4. now it can reproduce the problem when u build it.

This problem has plagued me for many days. well i need help!

Thank you !!

@hramos hramos added the Type: Question Issues that are actually questions and not bug reports. label Sep 27, 2018
@react-native-bot
Copy link
Collaborator

We are using GitHub issues exclusively to track bugs in React Native. GitHub may not be the ideal place to ask a question, but you can try asking over on Stack Overflow, or on Reactiflux. You may also use discuss.reactjs.org/ to discuss best practices.

@react-native-bot react-native-bot added the Ran Commands One of our bots successfully processed a command. label Sep 27, 2018
@waqas19921
Copy link

waqas19921 commented Nov 8, 2018

@hramos i am also getting following error

'React/RCTBridge.h' file not found

after using https://github.com/prscX/react-native-file-selector as dependency, as it does not support pods integration i am unable to get it working.
So kindly mention anything that we need to do for third party libs that do not support pods integration.

@waqas19921
Copy link

@EternalChildren Just remove the Linear gradient package from your project by using remove reference only option.
Then run

react-native link
cd ios
pod install

Hopefully it will run.

@waqas19921
Copy link

Anyone wondering for third party dependency that do not support pods and you are using react from pods than add following line to that third party header search paths in build settings.
$(SRCROOT)/../node_modules/react-native-file-selector/ios

you can read more about that at
https://forums.expo.io/t/how-do-i-manually-add-pods-headers-public-to-the-header-search-paths-configuration/2427/6

@facebook facebook locked as resolved and limited conversation to collaborators Sep 27, 2019
@react-native-bot react-native-bot added the Resolution: Locked This issue was locked by the bot. label Sep 27, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Ran Commands One of our bots successfully processed a command. Resolution: Locked This issue was locked by the bot. Type: Question Issues that are actually questions and not bug reports.
Projects
None yet
Development

No branches or pull requests

4 participants