Skip to content
Advertisement

react-native-hms-location error when building app

I am trying to install the library @hmscore/react-native-hms-location. I am following all the steps as per https://developer.huawei.com/consumer/en/doc/development/HMS-Plugin-Guides/integrating-sdk-0000001050041330

However, once i have installed the library and I attempt to run ./gradlew assembleRelease in order to build my app, I get the following error in the terminal:

/MainApplication.java:18: error: cannot find symbol import com.huawei.hms.rn.location.RNHMSLocationPackage;

I don’t understand why, because I am following the instructions.

Anyone else seen this error ?

Advertisement

Answer

Thank you for pointing out this issue. We have provided a fix already and it will be on the next release.

There is a bug from the current plug-in code, which affects the compilation. Developers need to manually adjust the plug-in code.

Then I tried to make some changes on the code:

  1. Move the RNHMSLocationPackage.java file to location folder:

enter image description here

  1. Update the code in RNHMSLocationPackage.javaļ¼š

enter image description here

  1. Update the Androidmanifest file in android/src/main folder:
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
          package="com.huawei.hms.location">

</manifest>

According to my previous verification, this modification will be successful.

Update:

The brand new version of React Native Location Plugin 5.0.0.301 is available, please kindly refer to React Native Plugin.

User contributions licensed under: CC BY-SA
6 People found this is helpful
Advertisement