Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

RN 0.63.5 - null is not an object - BeaconsManager.requestWhenInUseAuthrization #204

Open
iSaBo96 opened this issue Jan 9, 2021 · 9 comments

Comments

@iSaBo96
Copy link

iSaBo96 commented Jan 9, 2021

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

  1. react-native init MyBeaconTest
  2. npm install --save react-native-beacon-manager
  3. 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:

image

Should i link the Libary manually? I use React-Native 0.63.4. So i think an autolinking is active.

Thanks for your help :)

@iSaBo96 iSaBo96 changed the title null is not an object - BeaconsManager.requestWhenInUseAuthro null is not an object - BeaconsManager.requestWhenInUseAuthrization Jan 9, 2021
@iSaBo96 iSaBo96 changed the title null is not an object - BeaconsManager.requestWhenInUseAuthrization RN 0.63.5 - null is not an object - BeaconsManager.requestWhenInUseAuthrization Jan 9, 2021
@mahendraios
Copy link

Were you able to fix this, I'm facing this error too

@iSaBo96
Copy link
Author

iSaBo96 commented Mar 22, 2022

I have linked the libary manually again and after this it works

@duylinhdang1998
Copy link

I have linked the libary manually again and after this it works

How you can linked the library manually ? Help me please

@iSaBo96
Copy link
Author

iSaBo96 commented Dec 20, 2022

Drag "node_modles/react-native-beacons-manager/ios/RNiBeacon.xcodeproj" to Libraries in your xcode structure

@duylinhdang1998
Copy link

I get the error when linking manually.
React/RCTBridge.h file not found!
How can I fix that? Help me please

@iSaBo96
Copy link
Author

iSaBo96 commented Dec 21, 2022

I write you at the evening. In germany we have 7 clock am

@duylinhdang1998
Copy link

Thanks! Help me if you're freetime

@iSaBo96
Copy link
Author

iSaBo96 commented Dec 21, 2022

You have to link the library manually and add the following paths:

  1. Link RNiBeacon.xcpdeproj (Drag from node_modules/react-native-beacons-manager/ios to libraries folder in your xcode)
    image
  2. Go to your project target and link your binaries.
    image
  3. Add this path "$(SRCROOT)/node_modules/react-native-beacons-manager/ios" to Headers Search Paths for your App
    image
  4. 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:
    image

Info: This answer was from the post in https://stackoverflow.com/a/74747124/3625778

@iSaBo96
Copy link
Author

iSaBo96 commented Dec 23, 2022

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants