Comments (8)
Hello @minUswachoke and @sktan810 ,
First Solution
1- First import Platform from react-native
import { Platform } from "react-native";
2- Define HMSLocation after your imports using let
let HMSLocation;
3- Check platform
if (Platform.OS === "android") { HMSLocation = require("@hmscore/react-native-hms-location").default; }
4- Now you can run your code.
Second Solution
You can use platform specific solutions as given here by React Native.
from hms-react-native-plugin.
Similar affects also analytics kit:
[Mon Nov 30 2020 12:39:18.599] ERROR TypeError: null is not an object (evaluating 'HmsAnalytics.HAEventType = _HAEventType.default')
Please review all kits so that iOS builds won't fail.
from hms-react-native-plugin.
Hello @ukasiu ;
Location plugin is not supporting iOS. That implementation is in our roadmap and we're working hard for that 👍👍
Please use 5.0.3-300 version of Analytics Kit, it is the initial version of supporting iOS. https://www.npmjs.com/package/@hmscore/react-native-hms-analytics/v/5.0.3-300
from hms-react-native-plugin.
@aktug , I don't mean supporting, but not breaking. In case of absence of HMS native module, just importing JS part should not cause runtime errors.
from hms-react-native-plugin.
Hello again @ukasiu
This issue has been fixed and waiting to release.
The next version 5.0.4.300 will be published at end of the December 👍
from hms-react-native-plugin.
Hi @aktug ,
thanks for the good news!
from hms-react-native-plugin.
Please reopen this issue, 5.0.4.300 still does not fix this issue.
from hms-react-native-plugin.
the issue still exists even using 5.0.4.300
from hms-react-native-plugin.
Related Issues (20)
- [react-native-hms-push] HmsPushInstanceId.getToken error HOT 2
- Hitting error TS1110 when importing @hmscore/react-native-hms-analytics
- gradle-wrapper.jar! where is gradle-wrapper.jar ?? HOT 1
- Ads kit: VAST player needs permission on Android 31 HOT 2
- HMS map can not work inside ScrollView HOT 1
- Can the latest tag be created for the current open source repository? HOT 1
- fails to build Android with React Native 0.72.0 HOT 9
- Unhelpful Typescript type definitions HOT 1
- MapInitializer is not initialized HOT 5
- Android build error v0.72.6 [HMS-PUSH] HOT 7
- Map not showing in React Native Expo HOT 2
- HMSMap Not Displaying on Device HOT 2
- Cannot use @TaskAction annotation on method IncrementalTransformTask.transform()
- HMS push not working in expo HOT 1
- HMSReward.adRewardedListenerAdd is not functioning properly
- AGC Check Fail on HMS Location
- HMS-Account Integration Error on React Native 0.73.1
- -
- Clarification on Push Notification Behavior When Disabled
- Location Kit causes crash on Android 14 HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from hms-react-native-plugin.