react-native-beacons-manager
react-native-beacons-manager copied to clipboard
RN 0.63.5 - null is not an object - BeaconsManager.requestWhenInUseAuthrization
Hello everybody, i get the following error when i use the libary
RN Version: 0.63.4 Plattform: iOS iOS: 14
I set up a new app and add the "react-native-beacon-manager" libary.
Steps to reproduce
- react-native init MyBeaconTest
- npm install --save react-native-beacon-manager
- Add following Code in my "App.js"
import React, {Component} from 'react';
import {
View,
Text,
} from 'react-native';
import Beacons from 'react-native-beacons-manager';
export default class App extends Component {
// Componente wurde geladen
componentWillMount() {
Beacons.requestWhenInUseAuthorization();
}
render() {
return (
<View><Text>123123123</Text></View>
);
}
};
Following Error will be triggered:
Should i link the Libary manually? I use React-Native 0.63.4. So i think an autolinking is active.
Thanks for your help :)
@MacKentoch Push, maybe you can help me. it would be my pleasure.
Were you able to fix this, I'm facing this error too
I have linked the libary manually again and after this it works
I have linked the libary manually again and after this it works
How you can linked the library manually ? Help me please
Drag "node_modles/react-native-beacons-manager/ios/RNiBeacon.xcodeproj" to Libraries in your xcode structure
I get the error when linking manually. React/RCTBridge.h file not found! How can I fix that? Help me please
I write you at the evening. In germany we have 7 clock am
Thanks! Help me if you're freetime
You have to link the library manually and add the following paths:
- Link RNiBeacon.xcpdeproj (Drag from node_modules/react-native-beacons-manager/ios to libraries folder in your xcode)
- Go to your project target and link your binaries.
- Add this path "$(SRCROOT)/node_modules/react-native-beacons-manager/ios" to Headers Search Paths for your App
- Add this paths $(SRCROOT)/../../../../ios/Pods/Headers/Public/React-Core, $(SRCROOT)/../../../../ios/Pods/Headers/Public/Yoga, $(SRCROOT)/../../../../ios/Pods/Headers/Public/YogaKit to Headers Search Paths for RNiBeacon:
Info: This answer was from the post in https://stackoverflow.com/a/74747124/3625778
Info: if you run "npm" or "yarn" install you have to add the paths again or use "npx patch-package react-native-beacons-manager" for permanantly add