YoussefHenna / expo-mapbox-navigation

MIT License
2 stars 0 forks source link

Can't Build On Android | ExpoSDK 50 #1

Closed ChickenBone closed 1 month ago

ChickenBone commented 1 month ago

Cant get a successful build on android on the latest version. iOS builds perfectly fine thought and functions flawlessly!

Source of error

[RUN_GRADLEW] > Task :youssefhenna-expo-mapbox-navigation:compileDebugKotlin FAILED
[RUN_GRADLEW] e: file:///private/var/folders/yp/ht2091bn6qq7p6prt8vyj2zm0000gp/T/eas-build-local-nodejs/d164ffc8-0db4-47ae-ae5a-7434428c289c/build/node_modules/@youssefhenna/expo-mapbox-navigation/android/src/main/java/expo/modules/mapboxnavigation/ExpoMapboxNavigationView.kt:138:38 Unresolved reference: id
[RUN_GRADLEW] e: file:///private/var/folders/yp/ht2091bn6qq7p6prt8vyj2zm0000gp/T/eas-build-local-nodejs/d164ffc8-0db4-47ae-ae5a-7434428c289c/build/node_modules/@youssefhenna/expo-mapbox-navigation/android/src/main/java/expo/modules/mapboxnavigation/ExpoMapboxNavigationView.kt:333:64 Unresolved reference: mapbox_navigation_puck_icon
[RUN_GRADLEW] e: file:///private/var/folders/yp/ht2091bn6qq7p6prt8vyj2zm0000gp/T/eas-build-local-nodejs/d164ffc8-0db4-47ae-ae5a-7434428c289c/build/node_modules/@youssefhenna/expo-mapbox-navigation/android/src/main/java/expo/modules/mapboxnavigation/ExpoMapboxNavigationView.kt:390:39 Unresolved reference: id
[RUN_GRADLEW] e: file:///private/var/folders/yp/ht2091bn6qq7p6prt8vyj2zm0000gp/T/eas-build-local-nodejs/d164ffc8-0db4-47ae-ae5a-7434428c289c/build/node_modules/@youssefhenna/expo-mapbox-navigation/android/src/main/java/expo/modules/mapboxnavigation/ExpoMapboxNavigationView.kt:401:39 Unresolved reference: id
[RUN_GRADLEW] e: file:///private/var/folders/yp/ht2091bn6qq7p6prt8vyj2zm0000gp/T/eas-build-local-nodejs/d164ffc8-0db4-47ae-ae5a-7434428c289c/build/node_modules/@youssefhenna/expo-mapbox-navigation/android/src/main/java/expo/modules/mapboxnavigation/ExpoMapboxNavigationView.kt:411:39 Unresolved reference: id

Final Error

[RUN_GRADLEW] FAILURE: Build failed with an exception.
[RUN_GRADLEW] * What went wrong:
[RUN_GRADLEW] Execution failed for task ':youssefhenna-expo-mapbox-navigation:compileDebugKotlin'.
[RUN_GRADLEW] > A failure occurred while executing org.jetbrains.kotlin.compilerRunner.GradleCompilerRunnerWithWorkers$GradleKotlinCompilerWorkAction
[RUN_GRADLEW]    > Compilation error. See log for more details
[RUN_GRADLEW] * Try:
[RUN_GRADLEW] > Run with --stacktrace option to get the stack trace.
[RUN_GRADLEW] > Run with --info or --debug option to get more log output.
[RUN_GRADLEW] > Run with --scan to get full insights.
[RUN_GRADLEW] > Get more help at https://help.gradle.org.
[RUN_GRADLEW] BUILD FAILED in 39s
YoussefHenna commented 1 month ago

Hey, can you try out v0.2.1? It has a possible fix for the issue, although I was not able to reproduce it, so this might not fully address it.

ChickenBone commented 1 month ago

Hey! Still running into the issue, sorry it cant be reproduced I am on

"expo": "51.0.18",
"react-native": "0.74.3",
"@rnmapbox/maps": "^10.1.27",

Could it be a Java version?

export JAVA_HOME=`/usr/libexec/java_home -v 17.0.9`
export ANDROID_HOME=$HOME/Library/Android/sdk
export PATH=$ANDROID_HOME/tools:$PATH
export PATH=$ANDROID_HOME/platform-tools:$PATH
export PATH=$ANDROID_HOME/build-tools/34.0.0:$PATH
ChickenBone commented 1 month ago

Hey! I was able to fix it by downgrading to , I would love to be able to use expo SDK version 50 and 51 but this can work in the meantime!

         "expo": "49.0.15",
         "@youssefhenna/expo-mapbox-navigation": "^0.2.1",
         "@rnmapbox/maps": "
         "react-native": "0.72.10",
YoussefHenna commented 1 month ago

Thanks for figuring out the root cause! I was testing on 49, so that's probably why I wasn't able to reproduce. Support for expo 50/51 is definitely a significant thing to have, I'll work on it when I get the chance and let you know.

jacquesngomeheffa commented 1 month ago

@YoussefHenna I greatly appreciate your work and the effort that goes with it.

I have tried to build and Android internal distribution build on expoSDK 50, unfortunately this did not come to fruition. I have encountered the same error. I can't downgrade my SDK because a have a lot of package depending on it.

Let me know if you come up with a fix, thx

YoussefHenna commented 1 month ago

Fixed in v0.2.2

jacquesngomeheffa commented 1 month ago

@YoussefHenna Thank u, I now I'm able to build a Android internal distribution build on SDK version 50 and 51. Great job !!!

jacquesngomeheffa commented 1 month ago

It's already possible to use those default fonctions?

shouldSimulateRoute
showsEndOfRouteFeedback
        onLocationChange={(event) => {
          const { latitude, longitude } = event.nativeEvent;
        }}
        onRouteProgressChange={(event) => {
          const {
            distanceTraveled,
            durationRemaining,
            fractionTraveled,
            distanceRemaining,
          } = event.nativeEvent;
        }}
        onError={(event) => {
          const { message } = event.nativeEvent;
        }}
        onCancelNavigation={() => {
          // User tapped the "X" cancel button in the nav UI
          // or canceled via the OS system tray on android.
          // Do whatever you need to here.
        }}
        onArrive={() => {
          // Called when you arrive at the destination.
        }}
YoussefHenna commented 1 month ago

It's already possible to use those default fonctions?

shouldSimulateRoute
showsEndOfRouteFeedback
        onLocationChange={(event) => {
          const { latitude, longitude } = event.nativeEvent;
        }}
        onRouteProgressChange={(event) => {
          const {
            distanceTraveled,
            durationRemaining,
            fractionTraveled,
            distanceRemaining,
          } = event.nativeEvent;
        }}
        onError={(event) => {
          const { message } = event.nativeEvent;
        }}
        onCancelNavigation={() => {
          // User tapped the "X" cancel button in the nav UI
          // or canceled via the OS system tray on android.
          // Do whatever you need to here.
        }}
        onArrive={() => {
          // Called when you arrive at the destination.
        }}

Not yet, but I'm planning on adding at least some of these callbacks soon. Also feel free to create a PR for them if you're up for it.

jacquesngomeheffa commented 1 month ago

It's already possible to use those default fonctions?

shouldSimulateRoute
showsEndOfRouteFeedback
        onLocationChange={(event) => {
          const { latitude, longitude } = event.nativeEvent;
        }}
        onRouteProgressChange={(event) => {
          const {
            distanceTraveled,
            durationRemaining,
            fractionTraveled,
            distanceRemaining,
          } = event.nativeEvent;
        }}
        onError={(event) => {
          const { message } = event.nativeEvent;
        }}
        onCancelNavigation={() => {
          // User tapped the "X" cancel button in the nav UI
          // or canceled via the OS system tray on android.
          // Do whatever you need to here.
        }}
        onArrive={() => {
          // Called when you arrive at the destination.
        }}

Not yet, but I'm planning on adding at least some of these callbacks soon. Also feel free to create a PR for them if you're up for it.

Alright, but I'm very happy to have this package who works with EXPO. I will keep an eye on your package, let me know if you need a additional tester.