最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

android - TypeError: Cannot read property 'StyleSource' of null - mappls-map-react-native - Stack Overflow

programmeradmin5浏览0评论

When importing import MapplsGL from 'mappls-map-react-native'; App getting crash with TypeError: Cannot read property 'StyleSource' of null.

 "react": "18.3.1",
 "react-native": "0.77.1",
 "mappls-map-react-native": "^1.0.11",

When importing import MapplsGL from 'mappls-map-react-native'; App getting crash with TypeError: Cannot read property 'StyleSource' of null.

 "react": "18.3.1",
 "react-native": "0.77.1",
 "mappls-map-react-native": "^1.0.11",

Share Improve this question asked 3 hours ago ElangoElango 3003 silver badges21 bronze badges
Add a comment  | 

1 Answer 1

Reset to default 0

This error happens because MapplsGL is not initialized correctly, or the native module is not properly linked. Follow these steps to resolve it:

Step 1: Reinstall the Package and Link Native Modules

npm uninstall mappls-map-react-native
npm install mappls-map-react-native --save

Step 2: Check If MapplsGL is Loaded Correctly

import MapplsGL from 'mappls-map-react-native';

console.log("MapplsGL:", MapplsGL);
console.log("Available Keys:", 
Object.keys(MapplsGL));

MapplsGL.setAccessToken("<yourToken>");
发布评论

评论列表(0)

  1. 暂无评论