YoussefHenna / expo-mapbox-navigation

MIT License
6 stars 2 forks source link

RNMBXLocationModule - LocationEngineCallback Error - After the app is build succefully on android #8

Closed SoumyaranjanX closed 1 month ago

SoumyaranjanX commented 2 months ago

Console Error:

ERROR Error: Exception in HostObject::get for prop 'RNMBXLocationModule': java.lang.NoClassDefFoundError: Failed resolution of: Lcom/mapbox/android/core/location/LocationEngineCallback;, js engine: hermes ERROR Invariant Violation: "main" has not been registered. This can happen if:

Steps to reproduce:

  1. Install package @youssefhenna/expo-mapbox-navigation
  2. added plugin "@youssefhenna/expo-mapbox-navigation"
  3. Added plugin "expo-build-properties"
  4. Created development build using "npx expo run:android" (build successful)
  5. Opeing the development build app in mobile

My Configurations & Dependencies:

build.gradle: buildToolsVersion = findProperty('android.buildToolsVersion') ?: '34.0.0' minSdkVersion = Integer.parseInt(findProperty('android.minSdkVersion') ?: '23') compileSdkVersion = Integer.parseInt(findProperty('android.compileSdkVersion') ?: '34') targetSdkVersion = Integer.parseInt(findProperty('android.targetSdkVersion') ?: '34') kotlinVersion = findProperty('android.kotlinVersion') ?: '1.9.23'

    ndkVersion = "26.1.10909125"

package.json: "react": "18.2.0" "react-dom": "18.2.0", "react-map-gl": "^7.1.7", "react-native": "0.74.5", "react-native-maps": "1.14.0", "expo": "~51.0.31", "@rnmapbox/maps": "^10.1.24", "@youssefhenna/expo-mapbox-navigation": "^0.3.1"

Please help me I am stuck in this issue!

samilenl commented 1 month ago

Have you been able to find a solution to this problem?

YoussefHenna commented 1 month ago

Hey, I am not able to reproduce this issue on a fresh app, but this seems to be an issue relating to the @rnmapbox/maps. This issue (https://github.com/rnmapbox/maps/issues/3193) seems related, so maybe start there to try and debug it. This (https://github.com/rnmapbox/maps/issues/3193#issuecomment-1902529788) could be a possible solution. Let me know if you find anything.

One thing I would also try is to remove @youssefhenna/expo-mapbox-navigation and work on getting @rnmapbox/maps working on its own first, so that we can pinpoint where the issue is coming from.

SoumyaranjanX commented 1 month ago

Hello Again. I got the solution for this problem.

I actually forgot to add these plugins in my app.json:

  [
    "@youssefhenna/expo-mapbox-navigation",
    {
      "accessToken": "****"
    }
  ],
  [
    "@rnmapbox/maps",
    {
      "RNMapboxMapsDownloadToken": "****",
      "RNMapboxMapsVersion": "11.3.0"
    }
  ]

  After I added these, This issue resolved. 

  Thank you for your support.