pendo-io / pendo-mobile-sdk

Pendo captures product usage data, gathers user feedback, and lets you communicate in-app to onboard, educate, and guide users to value
https://www.pendo.io
Other
58 stars 2 forks source link

Could not resolve any matches for sdk.pendo.io:pendoIO:3.3.+ as no versions of sdk.pendo.io:pendoIO are available #158

Closed thechaudharysab closed 3 months ago

thechaudharysab commented 3 months ago

Platform + Version Android using react-native v0.73.6.

        buildToolsVersion = "34.0.0"
        minSdkVersion = 24
        compileSdkVersion = 34
        targetSdkVersion = 34
        ndkVersion = "25.1.8937393"
        kotlinVersion = "1.8.0"

The only version that is considered "behind" as per this ReadME would be kotlinVersion in my case but upgrading it also doesn't make the error go away.

SDK Version 3.3.0+

Framework React Native using React Navigation,

Describe the bug

When I'm running the app from Android Studio it fails with this error:

Could not resolve any matches for sdk.pendo.io:pendoIO:3.3.+ as no versions of sdk.pendo.io:pendoIO are available

The details of this are:

Could not determine the dependencies of task ':app:processDebugResources'.
> Could not resolve all task dependencies for configuration ':app:debugRuntimeClasspath'.
   > Could not find any matches for sdk.pendo.io:pendoIO:3.3.+ as no versions of sdk.pendo.io:pendoIO are available.
     Searched in the following locations:
       - https://oss.sonatype.org/content/repositories/snapshots/sdk/pendo/io/pendoIO/maven-metadata.xml
       - https://repo.maven.apache.org/maven2/sdk/pendo/io/pendoIO/maven-metadata.xml
       - file:/Users/MY_USER/MY_RN_APP/node_modules/jsc-android/dist/sdk/pendo/io/pendoIO/maven-metadata.xml
       - https://dl.google.com/dl/android/maven2/sdk/pendo/io/pendoIO/maven-metadata.xml
       - https://www.jitpack.io/sdk/pendo/io/pendoIO/maven-metadata.xml
     Required by:
         project :app > project :rn-pendo-sdk

Possible solution:
 - Declare repository providing the artifact, see the documentation at https://docs.gradle.org/current/userguide/declaring_repositories.html

To Reproduce Steps to reproduce the behavior:

  1. Installed yarn add rn-pendo-sdk

  2. Added the following in android/build.gradle under repositories {... above google() and mavenCentral().

        maven {
            url "https://software.mobile.pendo.io/artifactory/androidx-release"
        }
  3. I added the following in metro.congif.js even though I'm only going to use in-app guide and not analytics.

        minifierConfig: {
            keep_classnames: true, // Preserve class names
            keep_fnames: true, // Preserve function names
            mangle: {
              keep_classnames: true, // Preserve class names
              keep_fnames: true, // Preserve function names
            }
        }
  4. After that added init code on JS side.

Expected behavior It should run the app normally.

Logs N/A

Sample Code N/A

Additional context I'm using react-navigation so I have implemented it as PendoNavigationContainer = WithPendoReactNavigation(NavigationContainer); and for initialisation

class Pendo {

    // Initialize pendo Library
    init = (): void => {
        const navigationOptions = { library: NavigationLibraryType.ReactNavigation };
        const pendoKey = Config.PENDO_API_KEY;

        PendoSDK.setup(pendoKey, navigationOptions);
    }

}

export default new Pendo();
randmaayan commented 3 months ago

hi @thechaudharysab thanks for reaching out!

please make sure you added our native repo under AllProjects as follows-

allprojects { 
    repositories {
        maven {
            url "https://software.mobile.pendo.io/artifactory/androidx-release"
        }
        mavenCentral()
    }
} 

Please let us know if this has solved your issue!

thechaudharysab commented 3 months ago

@randmaayan thank you for your quick response.

I'm using the latest version of Android Studio i.e. Android Studio Koala | 2024.1.1 Patch 1 so I don't have allprojects in my android/build.gradle file (as seen in the screenshot below)

Screenshot 2024-07-23 at 2 31 22 PM

Do I need to do something in settings.gradle instead?

randmaayan commented 3 months ago

Please add the following in your setting gradle - (taken from https://docs.gradle.org/current/userguide/declaring_repositories.html#sub:centralized-repository-declaration)

dependencyResolutionManagement { repositoriesMode = RepositoriesMode.PREFER_SETTINGS repositories { maven { url "https://software.mobile.pendo.io/artifactory/androidx-release" } } }

thechaudharysab commented 3 months ago

Adding it like below in settings.gradle doesn't show the particular error, but then the other dependencies starts to throw error like I have react-native-create-thumbnail (screenshot attached), I tried on another project as well and got the same error for react-native vision-camera.

dependencyResolutionManagement {
    repositoriesMode.set(RepositoriesMode.PREFER_SETTINGS)
    repositories {
        maven { url "https://software.mobile.pendo.io/artifactory/androidx-release" }
    }
}
Screenshot 2024-07-24 at 9 44 34 AM

So, I'm still resolving these other errors that are raised and might or might not use the above suggested solution. If you think this is it for this particular issue feel free to close it.

thechaudharysab commented 3 months ago

For me what works for PendoSDK v3.3.0 is in android/build.gradle adding:

allprojects { 
    repositories {
        maven {
            url "https://software.mobile.pendo.io/artifactory/androidx-release"
        }
        mavenCentral()
    }
}

Here is the screenshot of the file:

Screenshot 2024-07-24 at 12 20 27 PM