question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

iOS builds broken with react-native-hms-location

See original GitHub issue

Description Importing import HMSLocation from '@hmscore/react-native-hms-location'; causes iOS to build in runtime with

[Mon Nov 30 2020 12:29:30.290]  ERROR    TypeError: null is not an object (evaluating '_Geofence.default.GeofenceRequestConstants')
[Mon Nov 30 2020 12:29:30.291]  ERROR    Invariant Violation: Module AppRegistry is not a registered callable module (calling runApplication)

Environment

  • Platform: React-Native
  • Kit: Location
  • Kit Version: 5.0.0-301-01

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:8 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
uysalemrecommented, Mar 2, 2021

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.

0reactions
sktan810commented, Mar 1, 2021

the issue still exists even using 5.0.4.300

Read more comments on GitHub >

github_iconTop Results From Across the Web

problem with react native @hmscore/react-native-hms-location
i'm follwing @hmscore/react-native-hms-location documontation with react native, i'm trying to Continuously Obtaining the Location ...
Read more >
React-Native-Hms-Location Error When Building App - ADocLib
Go to buildscript > repositories and allprojects > repositories, and configure the Maven repository address. Download the React Native Location Plugin and ...
Read more >
Troubleshooting - React Native
Within that folder, go to Build → Intermediates.noindex → Pods.build → Debug-iphonesimulator (or the equivalent for your iOS device, ...
Read more >
React Native Changelog - Airship Docs
This release contains small breaking changes to the event handling API, and also adds an extender to Android making it easier to modify...
Read more >
@hmscore/react-native-hms-nearby - npm
React Native HMS Nearby Kit. Latest version: 6.2.0-302, last published: 2 months ago. Start using @hmscore/react-native-hms-nearby in your ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found