HMS-Core / hms-react-native-plugin

This repo contains all of React-Native HMS plugins.
https://developer.huawei.com/consumer/en/doc/overview/HMS-Core-Plugin?ha_source=hms1
Apache License 2.0
241 stars 68 forks source link

MapInitializer is not initialized #297

Closed ottohyyrynendigia closed 11 months ago

ottohyyrynendigia commented 1 year ago

Description Running react-native-hms-map example project doesn't render the Map. Android logs show: E/HmsMapKit_MapView_15: MapsInitializer is not initialized.

Expected behavior React native example project should show map.

Current behavior Map is not showing. Error is logged in Android studio.

Environment

Other I created a project in AppGallery Connect, enabled Location and Map APIs, created and configured fingerprint, downloaded agconnect-services.json and added in project/android/app folder. I used the React native example code from the repo to display the MapView, but it shows empty.

On a side node, I cloned the Kotlin example project also, configured agconnect-services.json and keystore-file in the same way as with React native project and the Map loads and is displayed, so I don't think it's a problem with AppGallery configurations.

For the React native project I am using these dependencies:

"dependencies": { "@hmscore/react-native-hms-location": "^6.11.0-301", "@hmscore/react-native-hms-map": "^6.11.0-304", "react": "18.2.0", "react-native": "0.71.7" },

ahmedelsayed11 commented 1 year ago

Same issue with me. Did you find a solution for that ? @ottohyyrynendigia

ahmedelsayed11 commented 1 year ago

@rozeridilar @isamert @ozcanozgur @canerkocer

ottohyyrynendigia commented 1 year ago

Unfortunately no. I downgraded to version 5 which seems to be working.

peura-toni commented 1 year ago

Hi, Have you tried to set the API key using "initializer" method? this is a reference from the official document https://developer.huawei.com/consumer/en/doc/development/HMS-Plugin-References/mapview-0000001051150160-V1#section17562133322720

ozkulbeng commented 11 months ago

Hi, Have you tried to set the API key using "initializer" method? this is a reference from the official document https://developer.huawei.com/consumer/en/doc/development/HMS-Plugin-References/mapview-0000001051150160-V1#section17562133322720

Please follow the documentation for the latest updates.