'React/RCTDefines.h' file not found. In react native push notification integration - xcode

I am integrating push notification in my app. After following instructions 2 times (from here) again I am stuck in errors.
Podfile
# Uncomment the next line to define a global platform for your project
platform :ios, '9.0'
target 'placementScript' do
# Uncomment the next line if you're using Swift or would like to use dynamic frameworks
use_frameworks!
# Pods for placementScript
pod 'Firebase'
pod 'Firebase/Core'
pod 'Firebase/Messaging'
target 'placementScript-tvOSTests' do
#inherit! :search_paths
# Pods for testing
pod 'react-native-fcm', :path => '../node_modules/react-native-fcm'
pod 'RNReactNativeDocViewer', :path => '../node_modules/react-native-doc-viewer'
pod 'RNFS', :path => '../node_modules/react-native-fs'
pod 'BVLinearGradient', :path => '../node_modules/react-native-linear-gradient'
pod 'RNViewShot', :path => '../node_modules/react-native-view-shot'
end
target 'placementScriptTests' do
inherit! :search_paths
# Pods for testing
end
end
target 'placementScript-tvOS' do
# Uncomment the next line if you're using Swift or would like to use dynamic frameworks
# use_frameworks!
# Pods for placementScript-tvOS
#target 'placementScript-tvOSTests' do
# inherit! :search_paths
# Pods for testing
#end
end
When i build .xcodeproj
- Errors are
and when i build using .xcworkspace
Can anybody help? Any reference to video/blog will also be helpful.

I think you should set the search path to recursive. Click on your project in Xcode and follow this please:
build Settings > header search path > double click on it and click on + sign,
then add the following path to it:
$(SRCROOT)/../../../ios/Pods
Also keep in mind that you have to make your push notification toggle on in capabilities in the Xcode.
finally close your terminals, clear(command+k) and rebuild it(command+R).
Here are some sources:
https://medium.com/yale-sandbox/react-native-push-notifications-with-https://medium.com/yale-sandbox/react-native-push-notifications-with-firebase-cloud-functions-74b832d45386
https://ilirhushi.me/reactnative-push-notifications-firebase-ios/
I hope I could help. :)

Related

No podspec found for `FBReactNativeSpec` in `../node_modules/react-native/Libraries/FBReactNativeSpec`

I have upgrade react-native to 0.64 and I'm getting this error after I run pod install.
No podspec found for `FBReactNativeSpec` in `../node_modules/react-native/Libraries/FBReactNativeSpec`
I have tried to remove the node_module, remove the pod file, deintegrate, but still got this issue.
Any help?
The newer version of ReactNative (starting from 0.64) store FBReactNativeSpec in another folder.
You will need to replace the legacy FBReactNativeSpec path with the new one in the Pod declaration.
Open your Podfile and find this line :
pod 'FBReactNativeSpec', :path => "./node_modules/react-native/Libraries/FBReactNativeSpec"
And fix the path by replacing with this one :
pod 'FBReactNativeSpec', :path => "../node_modules/react-native/React/FBReactNativeSpec"
While I am updating to the new react-native version 0.64.1,then I got the above-mentioned error when I tried pod install.I have fixed the issue by replacing the content on my podfile like the following
https://raw.githubusercontent.com/react-native-community/rn-diff-purge/release/0.64.1/RnDiffApp/ios/Podfile
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 'RnDiffApp' do
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
)
target 'RnDiffAppTests' 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!()
post_install do |installer|
react_native_post_install(installer)
end
end
I changed my podfile like the above.Then I tried pod install on my terminal.Its working fine.
Try npx react-native-clean-project
Input 'Y' for all the prompts asked.
I had the same question these days and found out it was because of the command npm audit fix i ran. It automatically updated react native version, which made podfile somehow confused. Downgrade your rn package or reset your version control should work

'RCTVersion.h' file not found

I'm facing this issue 'RCTVersion.h' file not found. I started getting this error after by mistakenly linking manually while I have a pod file. Before doing this, it was building successfully.
What I've tried so far:
cd ios/
rm -rf Podfile.lock
rm -rf Pods/
pod install --repo-update
Clean, Rebuild, close and open again - did couple of times
still no luck
React and Firebase versions:
"react": "16.0.0-beta.5",
"react-native": "0.49.3",
"#react-native-firebase/app": "^7.3.1",
"#react-native-firebase/crashlytics": "^7.1.7",
# Uncomment the next line to define a global platform for your project
# platform :ios, '9.0'
target 'SomeApp' do
# Comment the next line if you don't want to use dynamic frameworks
#use_frameworks!
# Pods for SomeApp
# add the Firebase pod for Google Analytics
pod 'Firebase/Analytics'
# add pods for any other desired Firebase products
# https://firebase.google.com/docs/ios/setup#available-pods
pod 'Firebase/Crashlytics'
target 'SomeAppTests' do
inherit! :search_paths
# Pods for testing
end
end
target 'SomeApp-tvOS' do
# Comment the next line if you don't want to use dynamic frameworks
#use_frameworks!
# Pods for SomeApp-tvOS
target 'SomeApp-tvOSTests' do
inherit! :search_paths
# Pods for testing
end
end
I'm new to this, any help will be highly appreciated.
Thanks in advance!

Adding Mongodb to ios project

I am currently adding monogodb to my ios project. Just after following the instruction stitch mongodb offered, I am stuck at when pod installing StitchCoreSDK. It supposed to create a xcworkspace file, but it didn't. Instead, I got the following message.
enter image description here
The podfile I create is like following
# Uncomment the next line to define a global platform for your project
platform :ios, '11.4'
source 'https://github.com/CocoaPods/Specs.git'
use_frameworks!
target 'paotuaniOS' do
# Comment the next line if you're not using Swift and don't want to use dynamic frameworks
# Pods for paotuaniOS
pod 'Nexmo-Stitch'
pod 'StitchSDK', '~> 4.0.5'
target 'paotuaniOSTests' do
inherit! :search_paths
# Pods for testing
end
target 'paotuaniOSUITests' do
inherit! :search_paths
# Pods for testing
end
end
Can any one help me with this issue?
Thanks!!!
I had this issue before. The repo had problems. The repo has been updated. Please use
pod 'StitchSDK', '~> 4.1.1'

Can't import Web3. swift in Xcode project

Hey I was able to instal the web3swift pod using pod install but afterwards I can't import it in the project, so I can't start using it. Any tips?
Here is the Podfile code
# Uncomment the next line to define a global platform for your project
# platform :ios, '9.0'
target 'Hello' do
# Comment the next line if you're not using Swift and don't want to use dynamic frameworks
use_frameworks!
pod 'web3swift', '~> 0.8.0'
# Pods for Hello
target 'HelloTests' do
inherit! :search_paths
# Pods for testing
end
target 'HelloUITests' do
inherit! :search_paths
# Pods for testing
end
end
Here is what my Xcode looks like
I have managed to fix it myself, deleted everything, started from scratch. Then I have build the project and somehow everything works now..

libGoogleAnalytics.a missing file

I'll make it short.
I added Firebase to my app via cocoa pods and now I get this warning.
I've tried everything on the net please help.
file:///Users/.../Desktop/game/Pods/GoogleAnalytics/Libraries/libGoogleAnalytics.a: warning: Missing file: /Users/.../Desktop/game/Pods/GoogleAnalytics/Libraries/libGoogleAnalytics.a is missing from working copy
This is my pod file code
platform :ios, '10.0'
target 'game' do
# Comment the next line if you're not using Swift and don't want to use dynamic frameworks
use_frameworks!
#Pods for game
pod 'Firebase/Core'
pod 'Firebase/AdMob'
pod 'Firebase/Messaging'
pod 'Firebase/Crash'
pod 'GoogleToolboxForMac/Logger'
target 'gameTests' do
inherit! :search_paths
# Pods for testing
end
target 'gameUITests' do
inherit! :search_paths
# Pods for testing
end
end
solved it by creating a new project and copying all the files to there.

Resources