未定义不是对象(正在评估RNDeviceinfo.getMacAddress)Expo React本机

时间:2018-12-07 07:24:34

标签: reactjs react-native expo

当我尝试在react-navtive-device-info的帮助下打印设备的MAC地址时。

"DeviceInfo.getMACAddress();"

它显示一个错误,如:

  

“未定义不是对象(正在评估RNDeviceinfo.getMacAddress)”

homescreen.js

  import React from 'react';
  import {
  Image,
  Platform,
  ScrollView,
  StyleSheet,
  Text,
  TouchableOpacity,
  View,
  StatusBar,
  Dimensions,
  LayoutAnimation,
  Alert,
  Linking,
} from 'react-native';
 import { WebBrowser } from 'expo';
 import { BarCodeScanner, Permissions } from 'expo';
 import { MonoText } from '../components/StyledText';

import DeviceInfo from 'react-native-device-info';

please see this image for the linked library to the native modules

1 个答案:

答案 0 :(得分:0)

您似乎没有将库正确链接到本机模块。 如果您使用过$this->db->insert('signatures', $data);而没有用,则应该遵循手动方法。 请参考this进行手动链接