Troubleshooting

Read here if you encounter any issues when running the SDK.

Error: Failed to resolve: ai.pulselabs:flightrecorder:{x.x.x}

If you see the error "Failed to resolve: ai.pulselabs:flightrecorder:{x.x.x}" when syncing gradle, where {x.x.x} is the version of the software you downloaded, run through the following checks:

1. Verify the location of the library

In this section, you ensure the libary was downloaded and clarify the location of the download.

  1. Switch to the 'Project' view in Android Studio if you are not already in that view. To do this, locate the dropdown at the top of the projects window, click on the currently selected option (e.g., 'Android'), and from the dropdown menu, choose 'Project'."

  2. Navigate to the folder with the same name as your project. You should find this folder in the root of the project directory.

  3. Expand the folder containing the main application module. This folder contains the source code for your Android application. By convention this is named 'app', but it might be named something else. Note down its name, this is referred to later as {APP_MODULE_FOLDER}.

  4. Inside the main application module folder, locate and expand the 'libs' folder. If the libs folder is missing, go back to the installation step and repeat the steps.

  5. Verify the presence of a folder inside 'libs' with the following path: flightRecorder/ai/pulselabs/flightrecorder/{x.x.x}. '{x.x.x}' refers to the actual version of the software you are looking for. Note down the version number, this is referred to later as {VERSION_NUMBER}. If the folder is missing, go back to the installation step and repeat the steps.

You should now be able to note down the entire path, {APP_MODULE_FOLDER}/libs/flightRecorder/ai/pulselabs/flightrecorder/{VERSION_NUMBER}, and be confident the library is found there. With this information, move on to the next steps.

2. Verify the declaration of the Gradle repository

  1. Open the build.gradle.kts (Kotlin DSL) or build.gradle (Groovy DSL) file for your app module. The file is typically located in the root directory of the app module, at {APP_MODULE_FOLDER}.

  2. Locate the android block in the build.gradle(.kts) file, and search inside for the repositories block, which may be inside of an allprojects block. If you do not find the repositories block, then you are managing your repositories in a different location, skip to the next section.

  3. Verify that the repositories block contains the maven section with the url reference using the ${projectDir} variable at the start of the path, as highlighted:

    Kotlin: build.gradle.kts
    repositories {
      ...
      maven {
        url = uri("${projectDir}/libs/flightRecorder")
      }
    }

    Groovy: build.gradle
    repositories {
      ...
      maven {
        url "${projectDir}/libs/flightRecorder"
      }
    }
  4. If the repositories block does not contain the maven section, add it now and sync Gradle to install the SDK. If there is no repositories block, read on.

  5. Open the settings.gradle.kts (Kotlin DSL) or settings.gradle (Groovy DSL) file for the project. This file should be located in the root directory of the project.

  6. Locate the dependencyResolutionManagement block. Verify that the block contains the maven section with the url reference within the repositories block, and that the path references the {APP_MODULE_FOLDER} as shown below, in the example the folder is named app):

    Kotlin: settings.gradle.kts
    dependencyResolutionManagement {
        ...
        repositories {
            ...
            maven {
                url = uri("app/libs/flightRecorder")
            }
        }
    }

    Groovy: settings.gradle
    dependencyResolutionManagement {
        ...
        repositories {
            ...
            maven {
                url = "app/libs/flightRecorder"
            }
        }
    }

  7. If you do not find this block, add it. If you do find this block, make sure that the settings.gradle(.kts) file is at the project root, and not inside of a sub-project. If the settings.gradle(.kts) file is in a subproject folder, then the url path will not work because it needs to be relative to the project root. Either use the root settings file as described in the section Special Case: Centrally Declared Repositories, or add the dependency into the module build.gradle(.kts) file as described in the section Declare the Repository in Gradle.

Last updated