uxcam / react-native-ux-cam

51 stars 10 forks source link

Docs fix needed for expo android implementation #116

Closed wmarsey closed 6 months ago

wmarsey commented 9 months ago

Description

This package cannot be run on android using the current doc instructions, as the uxcam maven repository isn't added during build.

Steps to Reproduce

npx create-expo-app android-uxcam-expo-test -y
cd android-uxcam-expo-test
npx expo install react-native-ux-cam
npx expo prebuild -p android
npx expo run:android

Error

FAILURE: Build failed with an exception.

* What went wrong:
Could not determine the dependencies of task ':app:processDebugResources'.
> Could not resolve all task dependencies for configuration ':app:debugRuntimeClasspath'.
   > Could not find com.uxcam:uxcam:3.6.18.
     Searched in the following locations:
       - file:/Users/wmarsey/Code/adapt/android-uxcam-expo-test/node_modules/react-native/android/com/uxcam/uxcam/3.6.18/uxcam-3.6.18.pom
       - file:/Users/wmarsey/Code/adapt/android-uxcam-expo-test/node_modules/jsc-android/dist/com/uxcam/uxcam/3.6.18/uxcam-3.6.18.pom
       - https://dl.google.com/dl/android/maven2/com/uxcam/uxcam/3.6.18/uxcam-3.6.18.pom
       - https://repo.maven.apache.org/maven2/com/uxcam/uxcam/3.6.18/uxcam-3.6.18.pom
       - https://www.jitpack.io/com/uxcam/uxcam/3.6.18/uxcam-3.6.18.pom
       - https://oss.sonatype.org/content/repositories/snapshots/com/uxcam/uxcam/3.6.18/uxcam-3.6.18.pom
     Required by:
         project :app > project :react-native-ux-cam

Fix

The uxcam maven repository needs to be added using the extraMavenRepos property of expo-build-properties.

Install the plugin, then add the below to app.config.ts or similar:

npx expo install expo-build-properties

export default {
  expo: {
    ...
    plugins: [
      [
        "expo-build-properties",
        {
          ...
          android: {
            extraMavenRepos: [
              ...
              "https://sdk.uxcam.com/android/",
            ],
          },
        },
      ],
younes0 commented 9 months ago

@wmarsey no problems on my side using EAS fyi

DFDIEGOH commented 6 months ago

Hi @wmarsey Apologize for the delay,

Thank you for sharing some feedback on our RN repository and how to accomplish this for an Expo application, we will reviewing this deeply with the team.

As for now, In order to integrate UXCam in an Expo application and as @younes0 mentioned, you will need to use an EAS build. Here you will find the instructions for the same: https://developer.uxcam.com/docs/expo.

thozh commented 2 weeks ago

thanks for the tip @wmarsey it's weird that I was able to run npx expo run:ios but not npx expo run:android