'React/RCTDevSettings.h' file not found - react-native

I try for del/install pod and node_module folder but the same issue occurred in xcode
error Could not find the following native modules: RNCMaskedView, RNReanimated, RNScreens. Did you forget to run pod install ?

Make sure these 2 pods are included in your PodFile
pod 'React-RCTSettings', :path => '../node_modules/react-native/Libraries/Settings'
pod 'React-CoreModules', :path => '../node_modules/react-native/React/CoreModules'
Then run pod install --repo-update
I got this working using React-native 0.62

In my case adding
pod 'React-CoreModules', :path => '../node_modules/react-native/React/CoreModules'
solved the problem.

Related

Build failed while opening a react-native project from github

I have downloaded react-native project from github. The link is here
I did npm install. everything is fine till now.when I run react-native run-ios I get following error
User defaults from command line:
IDEDerivedDataPathOverride = /Users/sriram/Desktop/FirebaseAuth-master/ios/build/Auth
note: Using new build system
note: Planning build
note: Constructing build description
Build system information
error: /Users/sriram/Desktop/FirebaseAuth-master/ios/Pods/Target Support Files/Pods-Auth/Pods-Auth.debug.xcconfig: unable to open file (in target "Auth" in project "Auth") (in target 'Auth')
Build system information
error: /Users/sriram/Desktop/FirebaseAuth-master/ios/Pods/Target Support Files/Pods-Auth/Pods-Auth.debug.xcconfig: unable to open file (in target "Auth" in project "Auth") (in target 'Auth')
Build system information
error: /Users/sriram/Desktop/FirebaseAuth-master/ios/Pods/Target Support Files/Pods-Auth/Pods-Auth.debug.xcconfig: unable to open file (in target "Auth" in project "Auth") (in target 'Auth')
Build system information
error: /Users/sriram/Desktop/FirebaseAuth-master/ios/Pods/Target Support Files/Pods-Auth/Pods-Auth.debug.xcconfig: unable to open file (in target "Auth" in project "Auth") (in target 'Auth')
Build system information
error: /Users/sriram/Desktop/FirebaseAuth-master/ios/Pods/Target Support Files/Pods-AuthTests/Pods-AuthTests.debug.xcconfig: unable to open file (in target "AuthTests" in project "Auth") (in target 'AuthTests')
Build system information
error: /Users/sriram/Desktop/FirebaseAuth-master/ios/Pods/Target Support Files/Pods-AuthTests/Pods-AuthTests.debug.xcconfig: unable to open file (in target "AuthTests" in project "Auth") (in target 'AuthTests')
Build system information
error: /Users/sriram/Desktop/FirebaseAuth-master/ios/Pods/Target Support Files/Pods-AuthTests/Pods-AuthTests.debug.xcconfig: unable to open file (in target "AuthTests" in project "Auth") (in target 'AuthTests')
Build system information
error: /Users/sriram/Desktop/FirebaseAuth-master/ios/Pods/Target Support Files/Pods-AuthTests/Pods-AuthTests.debug.xcconfig: unable to open file (in target "AuthTests" in project "Auth") (in target 'AuthTests')
** BUILD FAILED **
Later I tried cd ios && pod install
After that I tried react-native run-ios,
I get following error:
The following build commands failed:
CompileC /Users/sriram/Desktop/Auth/ios/build/Auth/Build/Intermediates.noindex/Pods.build/Debug-iphonesimulator/DoubleConversion.build/Objects-normal/x86_64/DoubleConversion-dummy.o Target\ Support\ Files/DoubleConversion/DoubleConversion-dummy.m normal x86_64 objective-c com.apple.compilers.llvm.clang.1_0.compiler
(1 failure)
This is my PodFile:
platform :ios, '9.0'
require_relative '../node_modules/#react-native-community/cli-platform-ios/native_modules'
target 'Auth' do
# Pods for Auth
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'
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 'AuthTests' do
inherit! :search_paths
# Pods for testing
end
use_native_modules!
end
target 'Auth-tvOS' do
# Pods for Auth-tvOS
target 'Auth-tvOSTests' do
inherit! :search_paths
# Pods for testing
end
end
Follow these steps:
Open Auth.xcworkspace.
On the left side, you will find Pods folder. Delete it.
Now in terminal, go into your project dir, cd into ios and do rm -rf Pods Podfile.lock.
Do pod install.
This solution worked for me!!!
Delete the Pods folder in IOS folder.
Then go to main project directory and run command:
npx pod-install
the pods folder will be recreated.

Podfile - specify sub dependency version

Is there a way to force a sub dependency version for a Pod dependency? I have this Pod dependency;
Podfile
...
pod 'Folly', :podspec => '../node_modules/react-native/third-party-podspecs/Folly.podspec'
It has a subdependncy on boost-for-react-native without specifying a version which results in 1.57.0 being installed.
Podfile.lock
...
- Folly (2016.09.26.00):
- boost-for-react-native
I need version 1.63.0. If I specify that in the parent Podfile I still end up with 1.57.0.
Podfile
...
pod 'boost-for-react-native', '~> 1.63.0'
I believe I need to specify it on the Folly file itself.

React Native 0.57 + CocoaPods - Failure to locate linked libraries only in CI Environment

I am hitting a brick wall at the moment trying to get my app to build in VS AppCenter. It's a react-native project, with some dependencies brought in via cocoapods.
Everything builds locally fine (clean clone on clean vm)
In the CI Environment in AppCenter though I get the following errors:
ld: warning: directory not found for option '-L/Users/vsts/Library/Developer/Xcode/DerivedData/projectname-adroxiklvgljuicvfqowylcdxjrt/Build/Intermediates.noindex/ArchiveIntermediates/unisafe/BuildProductsPath/Release-iphoneos/BVLinearGradient'
ld: library not found for -lGoogle-Maps-iOS-Utils
clang: error: linker command failed with exit code 1 (use -v to see invocation)
Archive Failed
I get the first warning a number of times for each pod.
Here is my Podfile
# Uncomment the next line to define a global platform for your project
# platform :ios, '9.0'
project './projectname.xcproj'
target 'projectname' do
# Uncomment the next line if you're using Swift or would like to use dynamic frameworks
# use_frameworks!
# Pods for projectname
pod 'AppCenter/Push', '~> 1.10.0'
pod 'AppCenter/Crashes', '~> 1.10.0'
pod 'AppCenter/Analytics', '~> 1.10.0'
pod 'AppCenterReactNativeShared'
rn_path = '../node_modules/react-native'
rn_maps_path = '../node_modules/react-native-maps'
pod 'yoga', path: "#{rn_path}/ReactCommon/yoga/yoga.podspec"
pod 'React', path: rn_path, subspecs: [
'ART',
'Core',
'RCTActionSheet',
'RCTAnimation',
'RCTGeolocation',
'RCTImage',
'RCTLinkingIOS',
'RCTNetwork',
'RCTSettings',
'RCTText',
'RCTVibration',
'RCTWebSocket',
]
pod 'react-native-maps', path: rn_maps_path
pod 'react-native-google-maps', path: rn_maps_path # Remove this line if you don't want to support Google Maps on iOS
pod 'GoogleMaps' # Remove this line if you don't want to support Google Maps on iOS
pod 'Google-Maps-iOS-Utils' # Remove this line if you don't want to support GoogleMaps on iOS
pod 'BVLinearGradient', :path => '../node_modules/react-native-linear-gradient'
pod 'react-native-background-timer', :path => '../node_modules/react-native-background-timer'
pod 'ReactNativePermissions', :path => '../node_modules/react-native-permissions'
pod 'lottie-ios', :path => '../node_modules/lottie-ios'
pod 'lottie-react-native', :path => '../node_modules/lottie-react-native'
pod 'TouchID', :path => '../node_modules/react-native-touch-id'
pod 'RNVectorIcons', :path => '../node_modules/react-native-vector-icons'
platform :ios, '11.0'
# target 'projectnameTests' do
# inherit! :search_paths
# # Pods for testing
# end
end
post_install do |installer|
installer.pods_project.targets.each do |target|
if target.name == 'react-native-google-maps'
target.build_configurations.each do |config|
config.build_settings['CLANG_ENABLE_MODULES'] = 'No'
end
end
if target.name == "React"
target.remove_from_project
end
end
end
In my library search paths i have:
$(inherited)
$(BUILD_DIR)/${CONFIGURATION}$(EFFECTIVE_PLATFORM_NAME)
"${PODS_ROOT}"
Any ideas would be greatly appreciated. Thanks.
Not a perfect solution...but resolved this by removing and re-adding everything under 'Linked Frameworks and Libraries' in XCode build settings.
I'll close this, but if anyone else has this issue, reply here or PM - happy to help.

XCode 9.1 Command /bin/sh failed with exit code 1

After updating xcode to version 9.1, I can't compile my projects, always have the same error Command /bin/sh failed with exit code 1. I tried to create empty project, install all pods I need, and the result is the same. Here is my podfile
source 'https://github.com/CocoaPods/Specs.git'
platform :ios, '8.0'
use_frameworks!
target 'xcode9.1' do
pod 'RMStore'
pod 'GoogleMaps'
pod 'RMMapper'
pod 'FacebookCore'
pod 'FacebookLogin'
pod 'FacebookShare'
pod 'VK-ios-sdk'
pod 'TwitterKit'
pod 'GoogleSignIn'
pod 'Flurry-iOS-SDK/FlurrySDK'
pod 'TWSReleaseNotesView'
pod 'GoogleAnalytics'
pod 'GoogleTagManager','~> 3.15.0'
pod 'SBJson'
pod 'Fabric'
pod 'Crashlytics'
pod 'APOfflineReverseGeocoding'
pod 'AFNetworking'
pod 'Realm'
end
This problem repeats in all my projects, can anybody explain me how to fix it?
Here is the screen of full error
The solution is very simple. In your pods target, Build settings, I changed valid architectures list. Also Build architectures only flag change to No can resolve the problem.

React native, pod install doesn't install subspecs

RN tutorial github project looks like this,
whereas mine only has Core
I tried rm -rf Pods && rm -rf "${HOME}/Library/Caches/CocoaPods" and pod install
I was able to get the subspecs installed from a fresh swift project by following the React Native guide https://facebook.github.io/react-native/docs/integration-with-existing-apps.html with a pod file like this:
target 'testpods' do
# Your 'node_modules' directory is probably in the root of your project,
# but if not, adjust the `:path` accordingly
pod 'React', :path => './node_modules/react-native', :subspecs => [
'Core',
'DevSupport', # Include this to enable In-App Devmenu if RN >= 0.43
'RCTText',
'RCTNetwork',
'RCTWebSocket', # needed for debugging
# Add any other subspecs you want to use in your project
]
# Explicitly include Yoga if you are using RN >= 0.42.0
pod "Yoga", :path => "./node_modules/react-native/ReactCommon/yoga"
end