I have a react native app which is working fine on android but when i try to run npx react-native run-ios I'm getting the following error
2023-02-15 17:23:36.048 xcodebuild[81512:522416] [MT] IDEFileReferenceDebug: [Load] <IDESwiftPackageCore.IDESwiftPackageSpecialFolderFileReference, 0x7fd3caff3490: name:Docs.docc path:group:Docs.docc> Failed to load container at path: /Users/shubhagarwal/Library/Developer/Xcode/DerivedData/weedlemobiledapptraining-cngaloxjuncutwengkgnppfnmbtd/SourcePackages/checkouts/swift-protobuf/Sources/protoc-gen-swift/Docs.docc, Error: Error Domain=com.apple.dt.IDEContainerErrorDomain Code=6 "Cannot open "Docs.docc" as a "Swift Package Folder" because it is already open as a "Folder"." UserInfo={NSLocalizedDescription=Cannot open "Docs.docc" as a "Swift Package Folder" because it is already open as a "Folder".}
** BUILD FAILED **
The following build commands failed:
Ld /Users/shubhagarwal/Library/Developer/Xcode/DerivedData/weedlemobiledapptraining-cngaloxjuncutwengkgnppfnmbtd/Build/Products/Debug-iphonesimulator/RNSVG/RNSVG.framework/RNSVG normal (in target 'RNSVG' from project 'Pods')
(1 failure)
This is how my Podfile looks like
require File.join(File.dirname(`node --print "require.resolve('expo/package.json')"`), "scripts/autolinking")
require File.join(File.dirname(`node --print "require.resolve('react-native/package.json')"`), "scripts/react_native_pods")
require File.join(File.dirname(`node --print "require.resolve('#react-native-community/cli-platform-ios/package.json')"`), "native_modules")
require 'json'
podfile_properties = JSON.parse(File.read(File.join(__dir__, 'Podfile.properties.json'))) rescue {}
$RNFirebaseAsStaticFramework = true
platform :ios, podfile_properties['ios.deploymentTarget'] || '12.0'
install! 'cocoapods',
:deterministic_uuids => false
target 'weedlemobiledapptraining' do
use_expo_modules!
use_modular_headers!
# use_frameworks!
config = use_native_modules!
# use_frameworks! :linkage => podfile_properties['ios.useFrameworks'].to_sym if podfile_properties['ios.useFrameworks']
# Flags change depending on the env values.
flags = get_default_flags()
use_react_native!(
:path => config[:reactNativePath],
:hermes_enabled => flags[:hermes_enabled] || podfile_properties['expo.jsEngine'] == 'hermes',
:fabric_enabled => flags[:fabric_enabled],
# An absolute path to your application root.
:app_path => "#{Dir.pwd}/.."
)
# Uncomment to opt-in to using Flipper
# Note that if you have use_frameworks! enabled, Flipper will not work
#
# if !ENV['CI']
# use_flipper!()
# end
post_install do |installer|
react_native_post_install(installer)
__apply_Xcode_12_5_M1_post_install_workaround(installer)
end
post_integrate do |installer|
begin
expo_patch_react_imports!(installer)
rescue => e
Pod::UI.warn e
end
end
end
Versions :
node : 14.21.2
React : 17.0.2
React Native : 0.68.2
XCode : 12.1
I've tried everything that I could find on the internet.
Reinstalled Node Modules and Pods several times
Tried to make the build without use_frameworks! or use_modular_headers!
Adding glog to the podfile
You need to run
pod install --project-directory=ios --repo-update
command to install pod dependencies
in react native camera I am using onGoogleVisionBarcodesDetected
does not triggered on IOS
work on android but not ios
in the installation requirements I should add this in pod file
pod 'react-native-camera', path: '../node_modules/react-native-camera', subspecs: [
'BarcodeDetectorMLKit'
]
but when i try to pod install this error happened
require_relative '../node_modules/#react-native-community/cli-platform-ios/native_modules'
require_relative '../node_modules/react-native/scripts/react_native_pods'
platform :ios, '10.0'
target 'megatel' do
config = use_native_modules!
use_react_native!(:path => config["reactNativePath"])
# react-native-maps dependencies
rn_maps_path = '../node_modules/react-native-maps'
pod 'react-native-google-maps', :path => rn_maps_path
pod 'GoogleMaps'
pod 'Google-Maps-iOS-Utils'
pod 'GoogleMLKit/BarcodeScanning'
permissions_path = '../node_modules/react-native-permissions/ios'
pod 'Permission-Camera', :path => "#{permissions_path}/Camera.podspec"
pod 'Permission-LocationAlways', :path => "#{permissions_path}/LocationAlways.podspec"
pod 'Permission-PhotoLibrary', :path => "#{permissions_path}/PhotoLibrary.podspec"
pod 'GoogleMLKit/BarcodeScanning'
pod 'react-native-camera', path: '../node_modules/react-native-camera', subspecs: [
'BarcodeDetectorMLKit'
]
# Enables Flipper.
#
# Note that if you have use_frameworks! enabled, Flipper will not work and
# you should disable these next few lines.
use_flipper!
post_install do |installer|
flipper_post_install(installer)
end
end
target 'megatel-tvOS' do
# Pods for megatel-tvOS
target 'megatel-tvOSTests' do
inherit! :search_paths
# Pods for testing
end
end
"react": "16.9.0",
"react-native": "^0.63.3",
"react-native-camera": "^3.40.0",
I was able to get it to work yesterday on a Mac.
Scanning is so much faster using onGoogleVisionBarcodesDetected.
I just added the snipped to the Podfile like you did:
pod 'react-native-camera', path: '../node_modules/react-native-camera', subspecs: [
'BarcodeDetectorMLKit'
]
and then ran pod update.
Used versions are:
CocoaPods 1.10.1
react 17.0.2
react-native 0.64.2
react-native-camera 4.1.1
GoogleMLKit 2.3.0
MLImage 1.0.0-beta1
MLKitBarcodeScanning 1.4.0
MLKitCommon 3.1.0
MLKitVision 1.3.0
It seems like AccessToken is undefined in my code
import {AccessToken} from 'react-native-fbsdk';
AccessToken.getCurrentAccessToken().then(
(data) => {....}).catch(e => {
console.log('fb could not connect because: ' + e);
})
catch is being invoked.
I am using "react-native-fbsdk": "^1.0.1"
my device : iOS simulator - iphone62 - iOS 12
my Podfile:
pod 'FBSDKCoreKit'
pod 'FBSDKLoginKit'
pod 'FBSDKShareKit'
pod 'Bolts'
When I try to compile the library folders cannot be found.
Occurs both via npm and xcode.
I initialised a new project with rn 0.60.0, added my Podfile and Deps. Also I added the workaround for Firebase via react-native.config.js
What I tried to fix was:
Pod deintegrate / setup / install
Delete node_modues / npm install
Delete all caches, clean Xcode, delete DerivedData
Check Library Search Path (is $(inherited))
Remove/add Libraries
Follow: ‘ld: warning: directory not found for option’, library not found for -lDoubleConversion ,
Error: ld: library not found for -lPods with CocoaPods
Podfile:
platform :ios, '9.0'
require_relative '../node_modules/#react-native-community/cli-platform-ios/native_modules'
target 'pasioapp' do
# Pods for pasioapp
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'
pod 'Firebase/Core'
pod 'Firebase/Auth'
pod 'Firebase/Database'
pod 'Firebase/Storage'
pod 'FirebaseAnalytics'
pod 'Firebase/Invites'
#use_frameworks!
use_native_modules!
end
package.json:
{
"name": "pasioapp",
"version": "0.1.10",
"private": true,
"scripts": {
"start": "react-native start",
"test": "jest",
"list": "eslint.",
"ios": "react-native run-ios",
"i": "react-native run-ios",
"android": "react-native run-android",
"a": "react-native run-android"
},
"dependencies": {
"#firebase/app-types": "^0.4.0",
"#firebase/util": "^0.2.20",
"#fortawesome/fontawesome-svg-core": "^1.2.19",
"#fortawesome/free-regular-svg-icons": "^5.9.0",
"#fortawesome/free-solid-svg-icons": "^5.9.0",
"#fortawesome/react-fontawesome": "^0.1.4",
"#react-native-community/async-storage": "^1.5.0",
"AsyncStorage": "^0.1.5",
"acorn": "^6.1.1",
"core-js": "3",
"events": "^3.0.0",
"firebase": "^6.2.4",
"firebase-admin": "^7.4.0",
"firebase-functions": "^2.3.1",
"hashmap": "^2.3.0",
"npm": "^6.9.2",
"prop-types": "^15.5.10",
"react": "^16.8.6",
"react-native": "^0.60.0",
"react-native-device-info": "^2.1.3",
"react-native-elements": "^1.1.0",
"react-native-firebase": "^5.5.3",
"react-native-htmlview": "^0.14.0",
"react-native-image-picker": "^0.28.1",
"react-native-keychain": "^3.1.3",
"react-native-markdown-renderer": "^3.2.8",
"react-native-navigation": "^2.22.3",
"react-native-parsed-text": "0.0.21",
"react-native-rss-parser": "^1.3.0",
"react-native-snap-carousel": "^3.8.0",
"react-native-tag-input": "0.0.21",
"react-native-testfairy": "^2.18.2",
"react-native-vector-icons": "^6.5.0",
"react-native-webview": "^5.12.0",
"react-redux": "^6.0.1",
"redux": "^4.0.1",
"redux-thunk": "^2.3.0",
"tslint": "^5.18.0",
"typescript": "^3.5.2"
},
"devDependencies": {
"#babel/core": "^7.4.5",
"#babel/runtime": "^7.4.5",
"#react-native-community/eslint-config": "^0.0.3",
"babel-jest": "^24.8.0",
"eslint": "^5.15.3",
"jest": "^24.8.0",
"metro-react-native-babel-preset": "^0.53.1",
"react-test-renderer": "16.8.6"
},
"jest": {
"preset": "react-native"
}
}
Result:
ld: warning: directory not found for option '-L/Users/nerdy/Workspace/pasioRN60/pasioapp/ios/build/pasioapp/Build/Products/Debug-iphonesimulator/DoubleConversion'
ld: warning: directory not found for option '-L/Users/nerdy/Workspace/pasioRN60/pasioapp/ios/build/pasioapp/Build/Products/Debug-iphonesimulator/FirebaseAuth'
ld: warning: directory not found for option '-L/Users/nerdy/Workspace/pasioRN60/pasioapp/ios/build/pasioapp/Build/Products/Debug-iphonesimulator/FirebaseCore'
ld: warning: directory not found for option '-L/Users/nerdy/Workspace/pasioRN60/pasioapp/ios/build/pasioapp/Build/Products/Debug-iphonesimulator/FirebaseDatabase'
ld: warning: directory not found for option '-L/Users/nerdy/Workspace/pasioRN60/pasioapp/ios/build/pasioapp/Build/Products/Debug-iphonesimulator/FirebaseDynamicLinks'
ld: warning: directory not found for option '-L/Users/nerdy/Workspace/pasioRN60/pasioapp/ios/build/pasioapp/Build/Products/Debug-iphonesimulator/FirebaseInstanceID'
ld: warning: directory not found for option '-L/Users/nerdy/Workspace/pasioRN60/pasioapp/ios/build/pasioapp/Build/Products/Debug-iphonesimulator/FirebaseStorage'
ld: warning: directory not found for option '-L/Users/nerdy/Workspace/pasioRN60/pasioapp/ios/build/pasioapp/Build/Products/Debug-iphonesimulator/Folly'
ld: warning: directory not found for option '-L/Users/nerdy/Workspace/pasioRN60/pasioapp/ios/build/pasioapp/Build/Products/Debug-iphonesimulator/GTMOAuth2'
ld: warning: directory not found for option '-L/Users/nerdy/Workspace/pasioRN60/pasioapp/ios/build/pasioapp/Build/Products/Debug-iphonesimulator/GTMSessionFetcher'
ld: warning: directory not found for option '-L/Users/nerdy/Workspace/pasioRN60/pasioapp/ios/build/pasioapp/Build/Products/Debug-iphonesimulator/GoogleAPIClientForREST'
ld: warning: directory not found for option '-L/Users/nerdy/Workspace/pasioRN60/pasioapp/ios/build/pasioapp/Build/Products/Debug-iphonesimulator/GoogleToolboxForMac'
ld: warning: directory not found for option '-L/Users/nerdy/Workspace/pasioRN60/pasioapp/ios/build/pasioapp/Build/Products/Debug-iphonesimulator/GoogleUtilities'
ld: warning: directory not found for option '-L/Users/nerdy/Workspace/pasioRN60/pasioapp/ios/build/pasioapp/Build/Products/Debug-iphonesimulator/Protobuf'
ld: warning: directory not found for option '-L/Users/nerdy/Workspace/pasioRN60/pasioapp/ios/build/pasioapp/Build/Products/Debug-iphonesimulator/RNCAsyncStorage'
ld: warning: directory not found for option '-L/Users/nerdy/Workspace/pasioRN60/pasioapp/ios/build/pasioapp/Build/Products/Debug-iphonesimulator/RNDeviceInfo'
ld: warning: directory not found for option '-L/Users/nerdy/Workspace/pasioRN60/pasioapp/ios/build/pasioapp/Build/Products/Debug-iphonesimulator/RNFirebase'
ld: warning: directory not found for option '-L/Users/nerdy/Workspace/pasioRN60/pasioapp/ios/build/pasioapp/Build/Products/Debug-iphonesimulator/RNKeychain'
ld: warning: directory not found for option '-L/Users/nerdy/Workspace/pasioRN60/pasioapp/ios/build/pasioapp/Build/Products/Debug-iphonesimulator/RNVectorIcons'
ld: warning: directory not found for option '-L/Users/nerdy/Workspace/pasioRN60/pasioapp/ios/build/pasioapp/Build/Products/Debug-iphonesimulator/React-Core'
ld: warning: directory not found for option '-L/Users/nerdy/Workspace/pasioRN60/pasioapp/ios/build/pasioapp/Build/Products/Debug-iphonesimulator/React-DevSupport'
ld: warning: directory not found for option '-L/Users/nerdy/Workspace/pasioRN60/pasioapp/ios/build/pasioapp/Build/Products/Debug-iphonesimulator/React-RCTActionSheet'
ld: warning: directory not found for option '-L/Users/nerdy/Workspace/pasioRN60/pasioapp/ios/build/pasioapp/Build/Products/Debug-iphonesimulator/React-RCTAnimation'
ld: warning: directory not found for option '-L/Users/nerdy/Workspace/pasioRN60/pasioapp/ios/build/pasioapp/Build/Products/Debug-iphonesimulator/React-RCTBlob'
ld: warning: directory not found for option '-L/Users/nerdy/Workspace/pasioRN60/pasioapp/ios/build/pasioapp/Build/Products/Debug-iphonesimulator/React-RCTImage'
ld: warning: directory not found for option '-L/Users/nerdy/Workspace/pasioRN60/pasioapp/ios/build/pasioapp/Build/Products/Debug-iphonesimulator/React-RCTLinking'
ld: warning: directory not found for option '-L/Users/nerdy/Workspace/pasioRN60/pasioapp/ios/build/pasioapp/Build/Products/Debug-iphonesimulator/React-RCTNetwork'
ld: warning: directory not found for option '-L/Users/nerdy/Workspace/pasioRN60/pasioapp/ios/build/pasioapp/Build/Products/Debug-iphonesimulator/React-RCTSettings'
ld: warning: directory not found for option '-L/Users/nerdy/Workspace/pasioRN60/pasioapp/ios/build/pasioapp/Build/Products/Debug-iphonesimulator/React-RCTText'
ld: warning: directory not found for option '-L/Users/nerdy/Workspace/pasioRN60/pasioapp/ios/build/pasioapp/Build/Products/Debug-iphonesimulator/React-RCTVibration'
ld: warning: directory not found for option '-L/Users/nerdy/Workspace/pasioRN60/pasioapp/ios/build/pasioapp/Build/Products/Debug-iphonesimulator/React-RCTWebSocket'
ld: warning: directory not found for option '-L/Users/nerdy/Workspace/pasioRN60/pasioapp/ios/build/pasioapp/Build/Products/Debug-iphonesimulator/React-cxxreact'
ld: warning: directory not found for option '-L/Users/nerdy/Workspace/pasioRN60/pasioapp/ios/build/pasioapp/Build/Products/Debug-iphonesimulator/React-fishhook'
ld: warning: directory not found for option '-L/Users/nerdy/Workspace/pasioRN60/pasioapp/ios/build/pasioapp/Build/Products/Debug-iphonesimulator/React-jsi'
ld: warning: directory not found for option '-L/Users/nerdy/Workspace/pasioRN60/pasioapp/ios/build/pasioapp/Build/Products/Debug-iphonesimulator/React-jsiexecutor'
ld: warning: directory not found for option '-L/Users/nerdy/Workspace/pasioRN60/pasioapp/ios/build/pasioapp/Build/Products/Debug-iphonesimulator/React-jsinspector'
ld: warning: directory not found for option '-L/Users/nerdy/Workspace/pasioRN60/pasioapp/ios/build/pasioapp/Build/Products/Debug-iphonesimulator/ReactNativeNavigation'
ld: warning: directory not found for option '-L/Users/nerdy/Workspace/pasioRN60/pasioapp/ios/build/pasioapp/Build/Products/Debug-iphonesimulator/glog'
ld: warning: directory not found for option '-L/Users/nerdy/Workspace/pasioRN60/pasioapp/ios/build/pasioapp/Build/Products/Debug-iphonesimulator/leveldb-library'
ld: warning: directory not found for option '-L/Users/nerdy/Workspace/pasioRN60/pasioapp/ios/build/pasioapp/Build/Products/Debug-iphonesimulator/nanopb'
ld: warning: directory not found for option '-L/Users/nerdy/Workspace/pasioRN60/pasioapp/ios/build/pasioapp/Build/Products/Debug-iphonesimulator/react-native-image-picker'
ld: warning: directory not found for option '-L/Users/nerdy/Workspace/pasioRN60/pasioapp/ios/build/pasioapp/Build/Products/Debug-iphonesimulator/react-native-webview'
ld: warning: directory not found for option '-L/Users/nerdy/Workspace/pasioRN60/pasioapp/ios/build/pasioapp/Build/Products/Debug-iphonesimulator/yoga'
ld: library not found for -lDoubleConversion
clang: error: linker command failed with exit code 1 (use -v to see invocation)
** BUILD FAILED **
The following build commands failed:
Ld /Users/nerdy/Workspace/pasioRN60/pasioapp/ios/build/pasioapp/Build/Intermediates.noindex/pasioapp.build/Debug-iphonesimulator/pasioapp.build/Objects-normal/x86_64/pasioapp normal x86_64
Ld /Users/nerdy/Workspace/pasioRN60/pasioapp/ios/build/pasioapp/Build/Intermediates.noindex/pasioapp.build/Debug-iphonesimulator/pasioapp.build/Objects-normal/i386/pasioapp normal i386
(2 failures)
thanks for your help!
Please check the supporting iOS SDK version with the firebase and set the minimum deployment target to that supporting version.
I'm try to use React Native Navigation refer to this instruction
https://wix.github.io/react-native-navigation/#/installation-ios
I stuck at step 3 when I link the libReactNativeNavigation.a Xcode show error and I don't know how to fix this issue!
Here my package.json
"dependencies": {
"react": "~16.2.0",
"react-native": "~0.51.0",
"react-native-navigation" : "1.1.428"
}
My Pod file
source 'https://github.com/CocoaPods/Specs.git'
platform :ios, '10.0'
target 'MyApp' do
# Comment the next line if you're not using Swift and don't want to use dynamic frameworks
use_frameworks!
# Pods for React
pod 'React', :path => '../js/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
'RCTImage',
'RCTNetwork',
'RCTText',
'RCTWebSocket',
]
# Explicitly include Yoga if you are using RN >= 0.42.0
pod "yoga", :path => "../js/node_modules/react-native/ReactCommon/yoga"
# Third party deps podspec link
pod 'DoubleConversion', :podspec => '../js/node_modules/react-native/third-party-podspecs/DoubleConversion.podspec'
pod 'GLog', :podspec => '../js/node_modules/react-native/third-party-podspecs/GLog.podspec'
pod 'Folly', :podspec => '../js/node_modules/react-native/third-party-podspecs/Folly.podspec'
It's because that React-Native-Navigation is a subproject of your project, and it has dependency with React which you added to your project via cocoapods.
Try add ${BUILT_PRODUCTS_DIR} recursive to Build Settings -> FRAMEWORK_SEARCH_PATHS in ReactNativeNavigation.xcodeproj