Cannot read property 'getCurrentAccessToken' of undefined - react-native

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'

Related

iOS Simulator crashes when clicking on Map

So I have an issue only with the simulator for iOS, I can interact with the map for about two seconds before the whole app crashes...
When I use my own device, it works fine...
here's a gif: https://gyazo.com/67a5d7f10586d0368eb631346122867b
Here is my implementation:
import React, { useEffect } from "react";
import { StatusBar } from "react-native";
import MapboxGL from "#react-native-mapbox-gl/maps";
function MapScreen() {
const context = useEquipment();
// const { deployedEquipment } = context!;
const defaultCameraCoordinates = {
latitude: context?.location?.latitude ?? 0,
longitude: context?.location?.longitude ?? 0,
};
return (
<>
<StatusBar animated={true} backgroundColor="black" barStyle="dark-content" />
<MapboxGL.MapView style={styles.map}>
</MapboxGL.MapView>
</>
);
}
The error from the device:
Application Specific Information:
dyld4 config: DYLD_ROOT_PATH=/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS.simruntime/Contents/Resources/RuntimeRoot
terminating with uncaught exception of type NSException
*** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '*** -[__NSPlaceholderArray initWithObjects:count:]: attempt to insert nil object from objects[0]'
abort() called
CoreSimulator 783.5 - Device: iPhone 13 (D63AEBAD-44FF-4884-8F91-259CAEA4FC7F) - Runtime: iOS 15.2 (19C51) - DeviceType: iPhone 13
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, '11.0'
target 'DigiCatchRN' 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 => true
)
target 'DigiCatchRNTests' do
inherit! :complete
# Pods for testing
end
pre_install do |installer|
$RNMBGL.pre_install(installer) #mapbox
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)
__apply_Xcode_12_5_M1_post_install_workaround(installer)
$RNMBGL.pre_install(installer) # mapbox
end
end
I finally found a solution for this, and it turns out that my simulator runs ios 15.2 crashed. When I downloaded another version below this version. In my case 13.5. It finally works :)

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

react-native adding crashlytics

I'm new to react-native .
I'm trying to add crashlytics to my app , this is my podfile:
# Required by RNFirebase
pod 'Firebase/Core', '~> 5.15.0'
pod 'Firebase/Auth', '~> 5.15.0'
pod 'Fabric', '~> 1.9.0'
pod 'Crashlytics', '~> 3.12.0'
pod 'GoogleIDFASupport', '~> 3.14.0'
this is my code:
import React, {Component} from 'react';
import {View} from 'react-native';
import {Provider} from "mobx-react";
import rootStore from './src/stores/RootStore';
import firebase from "react-native-firebase";
class App extends Component {
componentDidMount(){
firebase.crashlytics().enableCrashlyticsCollection();
}
render() {
return (
<Provider rootStore={rootStore}>
<View/>
</Provider>
)}
}
export default (App);
I get this error message :
371d29ab-9482-42bd-a…-4915912912cd:25629 Error: You attempted to use a firebase module that's not installed natively on your iOS project by calling firebase.crashlytics(). Ensure you have the required Firebase iOS SDK pod for this module included in your Podfile, in this instance confirm you've added "pod 'undefined'" to your Podfile
Am I missing something?
Just like you, I got the same issue today... even if it works before like a charm.
Strange, don't know how it came out of the blue!?!
I figured out, that if I open XCode -> Product -> Scheme and duplicate the Scheme and set Build-Configuration on that duplicated Scheme to Release, the Error didn't appear.
I've even tried to remove /ios/Pods and reinstall all the Pods. Didn't get it to work in Debug-Mode. Any Idea why?

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>

React Native Navigation React/RCTRootView.h file not found

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