【发布时间】:2022-12-10 12:01:17
【问题描述】:
如果我使用以下代码,我会收到错误消息。我运行了“pod install”,手动链接库。什么都不管用。
- React-Native 版本:0.69.0
- 库版本:1.0.7
import React, {Component} from 'react';
import {
Text,
TouchableOpacity, View
} from 'react-native';
// @ts-ignore
import {Beacons} from 'react-native-beacons-manager';
export default class App extends Component {
componentDidMount() {
Beacons.requestWhenInUseAuthorization();
// Beacons.requestAlwaysAuthorization();
// Beacons.allowsBackgroundLocationUpdates(true);
}
render() {
return (
<View>
<Text style={{color: 'white', top: 150}}>test</Text>
</View>
)
}
};
有人知道为什么会发生错误吗?
【问题讨论】:
-
再次运行“pod install”后,出现错误:“错误:需要模块”node_modules/react-native-beacons-manager/lib/next/new.module.ios.js”,抛出异常:Invariant Violation :
new NativeEventEmitter()需要一个非空参数。”
标签: ios react-native