Module 'firebase' does not exist in the Haste module map - ios

When trying to run my react-native project I get the following error.
I think the error might be in the podfile but I cant seem to locate it.
Below I have added the files which I think are important and could be effecting the error
package.json
{
"name": "ExerFit_mobileapp",
"version": "0.0.1",
"private": true,
"scripts": {
"start": "node node_modules/react-native/local-cli/cli.js start",
"test": "jest"
},
"dependencies": {
"bcrypt": "^3.0.7",
"firebase": "^5.5.9",
"moment": "^2.24.0",
"moment-precise-range-plugin": "^1.3.0",
"native-base": "^2.13.8",
"qs": "^6.9.0",
"react": "16.3.1",
"react-native": "0.55.4",
"react-native-custom-tabs": "^0.1.7",
"react-native-datepicker": "^1.7.2",
"react-native-navigation": "^3.7.0",
"react-native-progress": "^4.0.3",
"react-native-progress-circle": "^2.1.0",
"react-native-vector-icons": "^6.6.0",
"react-navigation": "^2.18.2",
"rn-apple-healthkit": "^0.6.5",
"switch-button-react-native": "^1.0.3"
},
"devDependencies": {
"#babel/preset-env": "^7.8.4",
"babel-jest": "23.6.0",
"babel-plugin-transform-runtime": "^6.23.0",
"babel-preset-react-native": "4.0.1",
"detox": "^15.1.4",
"jest": "23.6.0",
"react-test-renderer": "16.3.1"
},
"jest": {
"preset": "react-native",
"transformIgnorePatterns": [
"node_modules/(?!(react-native|static-container|expo|#expo|react-navigation|rn-apple-healthkit|switch-button-react-native|native-base))"
],
"testPathIgnorePatterns": [
"<rootDir>/e2e"
],
"moduleNameMapper": {
"\\.(jpg|ico|jpeg|png|gif|eot|otf|webp|svg|ttf|woff|woff2|mp4|webm|wav|mp3|m4a|aac|oga)$": "<rootDir>/__mocks__/fileMock.js",
"\\.(css|less)$": "<rootDir>/__mocks__/fileMock.js"
}
},
"detox": {
"test-runner": "jest",
"specs": "e2e",
"configurations": {
"ios.sim.debug": {
"binaryPath": "ios/build/Build/Products/Debug-iphonesimulator/ExerFit_mobileapp.app",
"build": "xcodebuild -workspace ios/ExerFit_mobileapp.xcworkspace -scheme ExerFit_mobileapp -configuration Debug -sdk iphonesimulator -derivedDataPath ios/build",
"type": "ios.simulator",
"device": {
"type": "iPhone 8"
}
}
}
}
}
podfile
# Uncomment the next line to define a global platform for your project
# platform :ios, '9.0'
target 'ExerFit_mobileapp' do
# Comment the next line if you don't want to use dynamic frameworks
use_frameworks!
# 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
# Pods for ExerFit_mobileapp
target 'ExerFit_mobileapp-tvOSTests' do
inherit! :search_paths
# Pods for testing
end
target 'ExerFit_mobileappTests' do
inherit! :search_paths
# Pods for testing
end
end
target 'ExerFit_mobileapp-tvOS' do
# Comment the next line if you don't want to use dynamic frameworks
use_frameworks!
# Pods for ExerFit_mobileapp-tvOS
end
This project had been working before today and when I began working on it I was getting this error. Any solutions would be greatly appreciated.

Related

Migrating to latest react native firebase version

I am having some issues on my iOS app for the react native firebase version's conflicts.
There were some errors when I tried to run my app for IOS yesterday.
react-native-firebase/crashlytics, analytics and messaging were depending on different versions of react-native-firebase/app.
When I tried to resolve them I got into multiple problems, one after another.
The first thing was, I followed a solution to update my firebase/app to the latest version by this command: npm i #react-native-firebase/app#16.4.0 --legacy-peer-deps. This updated the version but I got several other issues.
The other thing I did to resolve the second problem was:
pod 'GoogleUtilities', :modular_headers => true
pod 'FirebaseCore', :modular_headers => true
In my Podfile. But then I got 127 issue related to Undefined symbol: ........ etc
This was my PodFile:
require_relative '../node_modules/react-native/scripts/react_native_pods'
require_relative '../node_modules/#react-native-community/cli-platform-ios/native_modules'
$FirebaseSDKVersion = '8.0.0'
platform :ios, '11.0'
target 'Buggy' do
config = use_native_modules!
use_react_native!(:path => config["reactNativePath"])
# permissions_path = '../node_modules/react-native-permissions/ios'
# pod 'Permission-Camera', :path => "#{permissions_path}/Camera"
# pod 'Permission-PhotoLibrary', :path => "#{permissions_path}/PhotoLibrary"
pod 'RNCAsyncStorage', :path => '../node_modules/#react-native-async-storage/async-storage'
pod 'react-native-netinfo', :path => '../node_modules/#react-native-community/netinfo'
pod 'RNGestureHandler', :path => '../node_modules/react-native-gesture-handler'
pod 'react-native-version-check', :path => '../node_modules/react-native-version-check'
pod 'ReactNativeExceptionHandler', :path => '../node_modules/react-native-exception-handler'
target 'BuggyTests' 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 these next few lines.
# use_flipper!
# post_install do |installer|
# flipper_post_install(installer)
# end
end
target 'Buggy-tvOS' do
# Pods for Buggy-tvOS
target 'Buggy-tvOSTests' do
inherit! :search_paths
# Pods for testing
end
end
post_install do |installer|
installer.pods_project.targets.each do |target|
target.build_configurations.each do |config|
config.build_settings["ONLY_ACTIVE_ARCH"] = "NO"
end
end
end
# post_install do |pi|
# pi.pods_project.targets.each do |t|
# t.build_configurations.each do |config|
# config.build_settings['IPHONEOS_DEPLOYMENT_TARGET'] = '10.0'
# end
# end
# end
And package.json
{
"name": "Buggy",
"version": "0.0.1",
"private": true,
"scripts": {
"android": "react-native run-android",
"ios": "react-native run-ios",
"start": "react-native start",
"test": "jest",
"lint": "eslint ."
},
"dependencies": {
"#apollo/client": "^3.3.6",
"#apollo/react-hooks": "^4.0.0",
"#ptomasroos/react-native-multi-slider": "^2.2.2",
"#react-native-async-storage/async-storage": "^1.13.4",
"#react-native-community/checkbox": "^0.5.6",
"#react-native-community/masked-view": "^0.1.10",
"#react-native-community/netinfo": "^5.9.10",
"#react-native-community/push-notification-ios": "^1.8.0",
"#react-native-firebase/analytics": "^11.0.0",
"#react-native-firebase/app": "^12.0.0",
"#react-native-firebase/crashlytics": "^11.0.0",
"#react-native-firebase/firestore": "^14.5.1",
"#react-native-firebase/messaging": "^12.0.0",
"#react-native-firebase/perf": "^11.0.0",
"#react-native-picker/picker": "^1.9.10",
"#react-navigation/bottom-tabs": "^5.11.2",
"#react-navigation/material-bottom-tabs": "^5.3.10",
"#react-navigation/native": "^5.8.10",
"#react-navigation/stack": "^5.12.8",
"apollo-boost": "^0.4.7",
"apollo-cache-inmemory": "^1.6.6",
"apollo-client": "^2.6.10",
"apollo-link-rest": "^0.8.0-beta.0",
"dotenv": "^10.0.0",
"events": "^3.3.0",
"express": "^4.17.1",
"graphql": "^15.4.0",
"graphql-tag": "^2.11.0",
"moment": "^2.29.1",
"moment-timezone": "^0.5.33",
"react": "16.13.1",
"react-native": "0.63.4",
"react-native-animate-loading-button": "^1.0.3",
"react-native-animated-login": "^0.2.1",
"react-native-calendar-picker": "^7.1.1",
"react-native-device-info": "^8.0.7",
"react-native-dialog": "^6.1.2",
"react-native-dropdownalert": "^4.3.0",
"react-native-elements": "^3.0.1",
"react-native-exception-handler": "^2.10.10",
"react-native-file-viewer": "^2.1.4",
"react-native-gesture-handler": "^1.9.0",
"react-native-google-places-autocomplete": "^2.1.3",
"react-native-image-crop-picker": "^0.36.0",
"react-native-image-resizer": "^1.4.4",
"react-native-image-slider-box": "^1.0.12",
"react-native-image-view": "^2.1.9",
"react-native-input-credit-card": "^0.5.5",
"react-native-internet-connection-alert": "^0.1.4",
"react-native-keyboard-aware-scroll-view": "^0.9.3",
"react-native-launch-navigator": "^1.0.8",
"react-native-linear-gradient": "^2.5.6",
"react-native-modal": "^11.6.1",
"react-native-paper": "^4.5.0",
"react-native-paper-dropdown": "^0.0.5",
"react-native-picker-select": "^8.0.4",
"react-native-push-notification": "^7.3.1",
"react-native-pusher-push-notifications": "^2.5.1",
"react-native-reanimated": "^1.13.2",
"react-native-responsive-screen": "^1.4.1",
"react-native-restart": "^0.0.22",
"react-native-safe-area-context": "^3.1.9",
"react-native-screens": "^2.16.1",
"react-native-simple-dialogs": "^1.4.0",
"react-native-tab-view": "^2.16.0",
"react-native-toast-message": "^1.4.9",
"react-native-vector-icons": "^7.1.0",
"react-native-version-check": "^3.4.2",
"react-navigation": "^4.4.4",
"rn-fetch-blob": "^0.12.0"
},
"devDependencies": {
"#babel/core": "^7.8.4",
"#babel/runtime": "^7.8.4",
"#react-native-community/eslint-config": "^1.1.0",
"babel-jest": "^25.1.0",
"eslint": "^6.5.1",
"jest": "^25.1.0",
"metro-react-native-babel-preset": "^0.59.0",
"react-test-renderer": "16.13.1"
},
"jest": {
"preset": "react-native"
}
}
I think I need to migrate to the latest version But I am having difficulties as I am a newbiew, Please help me to get the solution for this, Thanks!

How to solve "property with retain (or strong) attribute must be of object type" on React Native?

I am trying to build a React Native app in iOS that use Firebase, but I got this error:
error screenshot
error: property with 'retain (or strong)' attribute must be of object type
While building module 'FirebaseStorage'
This is a the error log:
In file included from /Users/xxxx/Documents/Grups/grups/node_modules/#react-native-firebase/messaging/ios/RNFBMessaging/RNFBMessagingSerializer.h:18:
/Users/xxxx/Documents/Grups/grups/ios/Pods/Headers/Public/Firebase/Firebase.h:50:13: fatal error: could not build module 'FirebaseFirestore'
#import <FirebaseFirestore/FirebaseFirestore.h>
~~~~~~~^
While building module 'FirebaseStorage' imported from /Users/xxxx/Documents/Grups/grups/ios/Pods/Headers/Public/Firebase/Firebase.h:78:
In file included from <module-includes>:2:
/Users/xxxx/Library/Developer/Xcode/DerivedData/grups-ekqodkfcidbeowgmbeplgbgpybif/Build/Products/Debug-iphonesimulator/FirebaseStorage/FirebaseStorage.framework/Headers/FirebaseStorage-Swift.h:315:1: error: property with 'retain (or strong)' attribute must be of object type
This is my podfile:
$RNFirebaseAsStaticFramework = true
require_relative '../node_modules/react-native/scripts/react_native_pods'
require_relative '../node_modules/#react-native-community/cli-platform-ios/native_modules'
platform :ios, '13.0'
install! 'cocoapods', :deterministic_uuids => false
target 'grups' do
use_frameworks! :linkage => :static
config = use_native_modules!
# Flags change depending on the env values.
flags = get_default_flags()
use_react_native!(
:path => config[:reactNativePath],
# Hermes is now enabled by default. Disable by setting this flag to false.
# Upcoming versions of React Native may rely on get_default_flags(), but
# we make it explicit here to aid in the React Native upgrade process.
:hermes_enabled => true,
#:fabric_enabled => flags[:fabric_enabled],
# Enables Flipper.
#
# Note that if you have use_frameworks! enabled, Flipper will not work and
# you should disable the next line.
#:flipper_configuration => FlipperConfiguration.enabled,
# An absolute path to your application root.
:app_path => "#{Pod::Config.instance.installation_root}/.."
)
target 'grupsTests' do
inherit! :complete
# Pods for testing
end
post_install do |installer|
react_native_post_install(
installer,
# Set `mac_catalyst_enabled` to `true` in order to apply patches
# necessary for Mac Catalyst builds
:mac_catalyst_enabled => false
)
__apply_Xcode_12_5_M1_post_install_workaround(installer)
end
end
This is the package.json
{
"name": "grups",
"version": "0.0.1",
"private": true,
"scripts": {
"android": "react-native run-android",
"ios": "react-native run-ios",
"start": "react-native start",
"test": "jest",
"lint": "eslint ."
},
"dependencies": {
"react": "18.1.0",
"react-native": "0.70.3",
"#react-native-async-storage/async-storage": "^1.17.10",
"#react-native-firebase/app": "^15.7.0",
"#react-native-firebase/auth": "^15.7.0",
"#react-native-firebase/firestore": "^15.7.0",
"#react-native-firebase/messaging": "^15.7.1",
"#react-native-firebase/storage": "^15.7.0",
"#react-native-google-signin/google-signin": "^8.0.0",
"#react-native-picker/picker": "^2.4.6",
"#react-navigation/bottom-tabs": "^6.4.0",
"#react-navigation/native": "^6.0.13",
"#react-navigation/native-stack": "^6.9.0",
"#types/react-native": "^0.70.4",
"i18n-js": "^3.8.0",
"react-native-date-picker": "^4.2.5",
"react-native-image-crop-picker": "^0.38.0",
"react-native-safe-area-context": "^4.4.1",
"react-native-screens": "^3.17.0",
"react-native-vector-icons": "^9.2.0"
},
"devDependencies": {
"#babel/core": "^7.12.9",
"#babel/runtime": "^7.12.5",
"#react-native-community/eslint-config": "^2.0.0",
"babel-jest": "^26.6.3",
"eslint": "^7.32.0",
"jest": "^26.6.3",
"metro-react-native-babel-preset": "0.72.3",
"react-test-renderer": "18.1.0"
},
"jest": {
"preset": "react-native"
}
}
How can I solve that?
I didn't find other solutions here.
This issue happens with firebase react native 15 in my project, downgrade to react native firebase 14.11.0 works for me.

'EXUpdates/EXUpdatesAppController.h' file not found

I have a react native project named 'MyReactNative'. I have updated react native version(~0.63.3) and after that I am getting an error below while running iOS code:
'EXUpdates/EXUpdatesAppController.h' file not found
This is how my package.json looks like:
{
"main": "index.js",
"scripts": {
"android": "react-native run-android",
"ios": "react-native run-ios",
"web": "expo start --web",
"start": "react-native start",
"test": "jest",
"build:ios": "node node_modules/react-native/local-cli/cli.js bundle --entry-file='index.js' --bundle-output='./ios/main.jsbundle' --dev=false --platform='ios' --assets-dest='./ios'"
},
"dependencies": {
"#react-native-community/cli-platform-android": "^4.13.0",
"#react-native-community/masked-view": "^0.1.10",
"#react-navigation/native": "^5.8.10",
"#react-navigation/stack": "^5.12.8",
"axios": "^0.19.0",
"babel-preset-react-native": "5.0.2",
"local_package": "file:../local_package-1.6.0.tgz",
"expo": "~39.0.2",
"expo-splash-screen": "~0.6.2",
"expo-status-bar": "~1.0.2",
"expo-updates": "^0.3.5",
"nodemon": "^1.18.10",
"npm-install-peers": "^1.2.1",
"prop-types": "^15.6.0",
"react": "17.0.1",
"react-devtools": "^3.6.1",
"react-dom": "16.13.1",
"react-native": "~0.63.3",
"react-native-axios": "^0.17.1",
"react-native-easy-toast": "^1.2.0",
"react-native-enhanced-popup-menu": "^0.6.1",
"react-native-gesture-handler": "^1.7.0",
"react-native-reanimated": "^1.13.2",
"react-native-safe-area-context": "^3.1.9",
"react-native-screens": "^2.10.1",
"react-native-unimodules": "~0.11.0",
"react-native-web": "~0.13.12",
"underscore": "^1.9.1"
},
"devDependencies": {
"#babel/core": "~7.9.0",
"babel-jest": "~25.2.6",
"jest": "~25.2.6",
"react-test-renderer": "~16.13.1"
},
"jest": {
"preset": "react-native"
},
"private": true
}
And podfile looks like:
# Uncomment the next line to define a global platform for your project
# platform :ios, '10.0'
require_relative '../node_modules/react-native-unimodules/cocoapods.rb'
require_relative '../node_modules/react-native/scripts/react_native_pods'
require_relative '../node_modules/#react-native-community/cli-platform-ios/native_modules'
target 'MyReactNative' do
# Comment the next line if you don't want to use dynamic frameworks
use_frameworks!
config = use_native_modules!
use_react_native!(:path => config["../node_modules/react-native"])
end
I tried solution given on internet as below:
react native ios build fails with error - 'EXUpdates/EXUpdatesAppController.h' file not found
https://docs.expo.io/bare/installing-updates/
Also tried reinstall node module and pods. Unfortunately, nothing work for me. Please help!
I am able to run my project after doing below changes in podfile:(Added use_unimodules!)
require_relative '../node_modules/react-native/scripts/react_native_pods'
require_relative '../node_modules/react-native-unimodules/cocoapods.rb'
require_relative '../node_modules/#react-native-community/cli-platform-ios/native_modules'
platform :ios, '10.0'
target 'MyReactNative' do
#use_frameworks!
use_unimodules!
config = use_native_modules!
use_react_native!(:path => config["reactNativePath"])
# 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
Run pod install again.

SyntaxError occurs when reading js.erb file with webpacker

I'm currently developing with Rails5 and React.
And to use React, we use a gem called react-rails, and this gem uses webpacker.
At that time, in React, js.erb file was created to refer to the image precompiled with assets.
The information I looked up on the net had rails-erb-loader, so it should have been readable.
However, SyntaxError occurred.
I will write the details below.
ErrorLog
# ./bin/webpack-dev-server
~~~
Module build failed (from ./node_modules/babel-loader/lib/index.js):
SyntaxError: /home/myproject/app/javascript/components/sample.js.erb: Unexpected token (1:1)
> 1 | <% helpers = ActionController::Base.helpers %>
sample.js.erb
<% helpers = ActionController::Base.helpers %>
export const png_path = "<%= helpers.image_path('sample.png') %>"
package.json
{
"name": "Sample",
"private": true,
"dependencies": {
"#babel/preset-react": "^7.0.0",
"#rails/webpacker": "^4.0.7",
"babel-plugin-transform-react-remove-prop-types": "^0.4.24",
"lodash": "^4.17.14",
"prop-types": "^15.7.2",
"rails-erb-loader": "^5.5.2",
"react": "^16.10.2",
"react-dom": "^16.10.2",
"react_ujs": "^2.6.0",
"reactjs-popup": "^1.4.1"
},
"devDependencies": {
"webpack-dev-server": "^3.8.2"
}
}
How can I solve this error?
We will wait for the answer.
This issue was not resolved. Sorry

React native: ios - Library not found for -lbolts

React native 0.57
CocoaPods 1.5.3
Xcode 10.1
I've build in debug mode It's fine but archive got errors message
Figure 1: Errors
I've open .xcworkspace instead of .xcodeproj. And remove Pods, Podfile.lock re-install pods but still not work.
I've try to link libBolts in Link Binary With Libraries but Xcode still asking for other lib up to IPods-PorjectName. But It's already in Link Binary With Libraries.
Podfile
# Uncomment the next line to define a global platform for your project
platform :ios, '12.1'
target 'Project' do
# Uncomment the next line if you're using Swift or would like to use dynamic frameworks
# use_frameworks!
rn_path = '../node_modules/react-native' # This path is likely to be `../node_modules/react-native` in your own project.
# See http://facebook.github.io/react-native/docs/integration-with-existing-apps.html#configuring-cocoapods-dependencies
pod 'yoga', path: "#{rn_path}/ReactCommon/yoga/yoga.podspec"
pod 'React', path: rn_path, subspecs: [
'Core',
'DevSupport',
'ART',
'RCTActionSheet',
'RCTAnimation',
'RCTGeolocation',
'RCTImage',
'RCTLinkingIOS',
'RCTNetwork',
'RCTSettings',
'RCTText',
'RCTVibration',
'RCTWebSocket',
]
pod 'react-native-fbsdk', :path => '../node_modules/react-native-fbsdk'
pod 'react-native-image-picker', :path => '../node_modules/react-native-image-picker'
pod 'react-native-fetch-blob', :path => '../node_modules/react-native-fetch-blob'
pod 'Firebase/Core'
pod 'Firebase/Messaging'
end
Package.json
{
"name": "Project",
"version": "0.0.1",
"private": true,
"scripts": {
"start": "node node_modules/react-native/local-cli/cli.js start",
"test": "jest"
},
"dependencies": {
"#types/styled-components": "^4.1.6",
"axios": "^0.18.0",
"moment": "^2.24.0",
"native-base": "^2.10.0",
"prop-types": "^15.6.2",
"react": "16.6.3",
"react-addons-update": "^15.6.2",
"react-native": "0.57.8",
"react-native-autogrow-textinput": "^5.2.0",
"react-native-cached-image": "^1.4.3",
"react-native-fbsdk": "^0.8.0",
"react-native-fetch-blob": "^0.10.8",
"react-native-firebase": "^5.2.2",
"react-native-gifted-chat": "^0.7.2",
"react-native-highcharts": "^1.0.2",
"react-native-image-picker": "^0.28.0",
"react-native-image-zoom-viewer": "^2.2.25",
"react-native-linear-gradient": "^2.5.3",
"react-native-popup-menu": "^0.15.0",
"react-native-read-more-text": "^1.1.0",
"react-native-render-html": "^4.1.1",
"react-native-router-flux": "^4.0.6",
"react-native-size-matters": "^0.1.6",
"react-native-swiper": "^1.5.14",
"react-native-view-more-text": "^2.0.1",
"react-redux": "^6.0.0",
"redux": "^4.0.1",
"redux-thunk": "^2.3.0",
"socket.io-client": "^2.2.0",
"styled-components": "^4.1.3"
},
"devDependencies": {
"#types/jest": "^23.3.13",
"#types/react": "^16.7.20",
"#types/react-native": "^0.57.29",
"#types/react-test-renderer": "^16.0.3",
"babel-jest": "23.6.0",
"eslint-config-rallycoding": "^3.2.0",
"jest": "23.6.0",
"metro-react-native-babel-preset": "0.51.1",
"react-native-typescript-transformer": "^1.2.11",
"react-test-renderer": "16.6.3",
"typescript": "^3.2.4"
},
"jest": {
"preset": "react-native",
"moduleFileExtensions": [
"ts",
"tsx",
"js"
],
"transform": {
"^.+\\.(js)$": "<rootDir>/node_modules/babel-jest",
"\\.(ts|tsx)$": "<rootDir>/node_modules/ts-jest/preprocessor.js"
},
"testRegex": "(/__tests__/.*|\\.(test|spec))\\.(ts|tsx|js)$",
"testPathIgnorePatterns": [
"\\.snap$",
"<rootDir>/node_modules/"
],
"cacheDirectory": ".jest/cache"
},
"rnpm": {
"assets": [
"./src/assets/fonts"
]
}
}
Finally I solved It by change Deployment target version to 12.1 because version are difference between Podfile and Deployment target. Then everything is fine!.
In your .xcworkspace => Build Phases ==> Link Binary with Libraries :
add libPods-Project.a

Resources