React Native Navigation React/RCTRootView.h file not found - react-native

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

Related

Build fails for React Native in iOS due to RNSVG

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

React Native iOS build failing due to glog and React Logger

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-16 11:27:07.190 xcodebuild[10406:767829] [MT] IDEFileReferenceDebug: [Load] <IDESwiftPackageCore.IDESwiftPackageSpecialFolderFileReference, 0x7f95f65afc30: 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:
CompileC /Users/shubhagarwal/Library/Developer/Xcode/DerivedData/weedlemobiledapptraining-cngaloxjuncutwengkgnppfnmbtd/Build/Intermediates.noindex/Pods.build/Debug-iphonesimulator/React-logger.build/Objects-normal/x86_64/react_native_log.o /Users/shubhagarwal/Desktop/metawork/portal-react-native/node_modules/react-native/ReactCommon/logger/react_native_log.cpp normal x86_64 c++ com.apple.compilers.llvm.clang.1_0.compiler (in target 'React-logger' from project 'Pods')
(1 failure)
If I try to build it via XCode, this is what the error looks like
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

in react native camera onGoogleVisionBarcodesDetected not working on IOS

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

Cannot read property 'getCurrentAccessToken' of undefined

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'

Build error integrating Clevertap to a Reactnative Application

I'm trying to integrate clevertap with native react and when I include "use_frameworks!" in cocoa pods to be able to use
#import <CleverTapReact / CleverTapReactManager.h>
a compilation error is generated in UMLCore
Already make the link of the application with clevertap
Install all the package throught "yarn install"
Install the pods throught "pod install"
This is my podfile:
//----
target 'discovery' do
pod 'React', :path => '../node_modules/react-native', :subspecs => [
'Core',
'CxxBridge',
'DevSupport',
'RCTText',
'RCTNetwork',
'RCTWebSocket',
'RCTAnimation',
'RCTImage',
]
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 'Google-Mobile-Ads-SDK'
pod 'CleverTap-iOS-SDK'
pod "Segment-CleverTap"
use_unimodules!
use_frameworks!
target 'discoveryTests' do
inherit! :search_paths
end
end
//----
I expect a good compilation for the app, and instead im getting a compilation error
this is the error code:
//----
info Undefined symbols for architecture x86_64:
"_UMLogError", referenced from:
+[UMUtilities NSDate:] in UMUtilities.o
-[UMViewManager updateProp:withValue:onView:] in UMViewManager.o
info "_UMLogInfo", referenced from:
+[UMUtilities UIColor:] in UMUtilities.o
info "_UMLogWarn", referenced from:
-[UMModuleRegistry registerExportedModule:] in UMModuleRegistry.o
-[UMModuleRegistry registerViewManager:] in UMModuleRegistry.o
-[UMModuleRegistry registerSingletonModule:] in UMModuleRegistry.o
-[UMModuleRegistryProvider moduleRegistryForExperienceId:] in UMModuleRegistryProvider.o
-[UMViewManager updateProp:withValue:onView:] in UMViewManager.o
ld: symbol(s) not found for architecture x86_64
info clang: error: linker command failed with exit code 1 (use -v to see invocation)
//----
It seems like you're integrating CleverTap React Native using Cocoapods for your iOS Application and in my understanding issue is that you're unable to find the CleverTapReactManager.h class.
I would suggest adding pod 'clevertap-react-native', :path => '../node_modules/clevertap-react-native' as a dependency in your ios/Podfile instead of pod 'CleverTap-iOS-SDK'
This local clevertap-react-native Podspec integrate the React Native iOS bridge via Cocoapods.
Helping link to install the same: https://github.com/CleverTap/clevertap-react-native/blob/master/docs/install.md#installing-clevertap-react-native
Hope this helps. For further questions, you can post on https://community.clevertap.com/
or while importing in Appdelegate file , instead of
#import <<CleverTapReact/CleverTap.h>
#import <CleverTapReact/CleverTapReactManager.h>
use
#import <CleverTapReactManager.h>
#import <CleverTap.h>