react-native-beacons-manager icon indicating copy to clipboard operation
react-native-beacons-manager copied to clipboard

App throws an error after run initial with a minimal example

Open iSaBo96 opened this issue 1 year ago • 26 comments

Version

1.1.0

Platform

iOS

OS version

iOS 13

General versions

  1. react-native: 068.0
  2. react: 17.0.2
  3. beacon library: 1.1.0
  4. pod. 1.11.3
  5. npm: 9.2.0
  6. node: 18.1.0

Steps to reproduce

  1. react-native init myTestApp --version=0.68.0
  2. Add library version 1.1.0 ("react-native-beacons-manager": "git://github.com/MacKentoch/react-native-beacons-manager.git#53c1bda")
  3. cd ios && pod install
  4. add minimal example
import React from 'react';

import {Text, View} from 'react-native';

import {Beacons} from 'react-native-beacons-manager';

const App = ({route, navigation}) => {
    Beacons.requestAlwaysAuthorization();
    Beacons.allowsBackgroundLocationUpdates(true);

    return (
        <View>
          <Text style={{color: 'white', top: 150}}>test</Text>
        </View>
    );
};

export default App;

Expected behavior

The app should be started successfully

Actual behavior

I get the following errors:

Error: Requiring module "node_modules/react-native-beacons-manager/index.js", which threw an exception: Invariant Violation: `new NativeEventEmitter()` requires a non-null argument. 

TypeError: undefined is not an object (evaluating '_$$_REQUIRE(_dependencyMap[2], "react-native-beacons-manager").Beacons')

I have used the library several times in my projects. But now I get the mentioned error and don't know why. I have even created a minimal example. This is described above. But still I have the error. Does anyone know why?

iSaBo96 avatar Dec 09 '22 18:12 iSaBo96

Beacons is default export. Try import Beacons from 'react-native-beacons-manager'; instead of import {Beacons} from 'react-native-beacons-manager';

sashko9807 avatar Dec 23 '22 00:12 sashko9807

Hi @iSaBo96 ,

Are you able to make it work?

gigflex avatar Jan 20 '23 12:01 gigflex

@gigflex yes, what is your problem with this?

iSaBo96 avatar Jan 20 '23 12:01 iSaBo96

Hi @iSaBo96

we are able to run the code somehow but getting the following error

[CoreBluetooth] XPC connection invalid 2023-03-13 21:48:22.061407+0530 beaconApp[4021:2131472] [javascript] iosPLatform 2023-03-13 21:48:22.062827+0530 beaconApp[4021:2130220] createBeaconRegion with: identifier - uuid 2023-03-13 21:48:22.062945+0530 beaconApp[4021:2130220] [Client] {"msg":"Region is nil"} 2023-03-13 21:48:22.063305+0530 beaconApp[4021:2129927] Failed ranging region: Error Domain=kCLErrorDomain Code=17 "(null)"

beaconsDidRange never fires

sangheraajit avatar Mar 13 '23 16:03 sangheraajit

Have you linked the library?

You must link the library in XCode under "Libraries". You have to link the binary "RNiBeacon.a" in you project phases

iSaBo96 avatar Mar 14 '23 13:03 iSaBo96

which version do you use?

iSaBo96 avatar Mar 14 '23 13:03 iSaBo96

@iSaBo96 We are using git+https://github.com/MacKentoch/react-native-beacons-manager.git

and ios 13 We are unable to find RNiBeacon.a

image

sangheraajit avatar Mar 14 '23 15:03 sangheraajit

Hi @iSaBo96 ,

We are able to see Beacons ranging started succesfully and Beacons monitoring started succesfully

log but beaconsDidRange event never fires

image

sangheraajit avatar Mar 14 '23 15:03 sangheraajit

You have to add RNiBeacon.a

I also use "react-native-beacons-manager": "git+https://github.com/MacKentoch/react-native-beacons-manager.git", in my package.json file.

image

Please follow the path in the screenshot to add the RNiBeacon.a. If you do not found it, do a "pod install" in your ios folder

iSaBo96 avatar Mar 14 '23 15:03 iSaBo96

And you have to link the library manually

image

And you have to the the following path in the linked library. Go there to "build settings" and add the following:

image

In your App you have to add the following under "Build settings" > "Header Search Paths"

image

iSaBo96 avatar Mar 14 '23 16:03 iSaBo96

Hi @iSaBo96

Do you have a working copy if you can share that will be a great help. Thanks

sangheraajit avatar Mar 14 '23 17:03 sangheraajit

Please tell me which react-native version you are using. I Use 0.70.6. I have a working copy, but i cannot share this, because it is a production code.

From which country you are? Maybe i can offer you a call tomorrow? I come from germany and the current time is 18:45

iSaBo96 avatar Mar 14 '23 17:03 iSaBo96

Hi

We tried with 0.71.0 we tried with 0.64.4 I am from India Following is my skype id swesoftm42 my email is [email protected]

sangheraajit avatar Mar 14 '23 19:03 sangheraajit

Do you habe discord? I dont have skype

iSaBo96 avatar Mar 14 '23 19:03 iSaBo96

Hi @iSaBo96

This is my discord id sangheraajit#3485

sangheraajit avatar Mar 14 '23 19:03 sangheraajit

I sended you a request

iSaBo96 avatar Mar 14 '23 19:03 iSaBo96

HI @iSaBo96 ,

I m able to get this added "RNiBeacon.a" to the project but getting the following error

image

sangheraajit avatar Mar 15 '23 10:03 sangheraajit

You have to link the library manually

image

Drag and drop from "node_modules/react-native-beacons-manager/ios/RNiBeacon.xcodeproj

iSaBo96 avatar Mar 15 '23 10:03 iSaBo96

Hi @iSaBo96

Did the same thing after doing some changes according to your instruction we got the following error

image

sangheraajit avatar Mar 15 '23 10:03 sangheraajit

Lets wait till we speak plase

iSaBo96 avatar Mar 15 '23 11:03 iSaBo96

@sangheraajit were you able to solve the issue with duplicate symbols?

Jaszczab20 avatar Aug 28 '23 19:08 Jaszczab20

Hi @iSaBo96

Did the same thing after doing some changes according to your instruction we got the following error

image

I have experienced the same issue and I was able to solve it by following this https://github.com/facebook/react-native/issues/27840#issuecomment-623052433

Jaszczab20 avatar Aug 31 '23 12:08 Jaszczab20

HI @Jaszczab20 , Thanks for your response. We have fixed the issue in some other way

sangheraajit avatar Aug 31 '23 13:08 sangheraajit

@sangheraajit, @iSaBo96

Hi guys,

I'm trying to make this library work with RN 0.72.5 on iOS with no luck.

Are you using THIS repo or any of the many forks out here? What version of RN are you successfully using? What iOS version are you successfully using?

Thanks!! Alberto

AlbertoLopSie avatar Sep 29 '23 14:09 AlbertoLopSie

I use the version i wrote above :)

iSaBo96 avatar Sep 30 '23 05:09 iSaBo96