我已按照react-native-maps文档中的指南进行操作:我收到错误。
我在 stackoverflow 和 google 上到处查看,但无法找到解决方案。
我尝试了在论坛上可以找到的所有答案,但仍然收到错误。
错误 :
不变违规:requireNativeComponent:在 UIManager 中找不到“AIRMap”。
我的代码:
import React from 'react';
import MapView from 'react-native-maps';
import { StyleSheet } from 'react-native';
export default class App extends React.Component {
constructor() {
super();
this.state = {};
}
render() {
return (
<MapView
style = {styles.map}
showsUserLocation = {false}
followUserLocation = {false}
zoomEnabled = {true}
/>
)
}
}
const styles = StyleSheet.create ({
map: {
height: 400,
marginTop: 80
}
})
Run Code Online (Sandbox Code Playgroud)
尝试这个:
打开 xcode 项目 > 你的项目 > 构建阶段 > 链接二进制文件 > 删除 libAirMaps.a > 然后再次添加它 > 检查它是否有效... 检查图像以获取详细说明
编辑:如果您已经安装了react-native-maps,请尝试手动添加AirMapsLib。按照此图像上的说明进行操作。之后,再次尝试上述说明。

| 归档时间: |
|
| 查看次数: |
12243 次 |
| 最近记录: |