Error Installing Android SDK for new Android Studio project

Good day

I’m trying to setup a new Android project with the SDK Add-on. I’ve follow the steps described in Datalogic Android SDK | Technical Documentation, but when I try to build the project I receive the following error:

  1. Dependency ‘androidx.appcompat:appcompat-resources:1.5.1’ requires libraries and applications that
    depend on it to compile against version 32 or later of the
    Android APIs.
    :app is currently compiled against Datalogic:Datalogic SDK v1:29.

I tried changing androidx.appcompat:appcompat-resources and com.google.android.material:material to older versions, but I then end up with the following error that I don’t know how to resolve:

error: attribute android:dataExtractionRules not found

Is there a step that I am missing?

1 Like

Hey Louis,
Unfortunately, our SDK documentation for initial setup of using our SDK is currently outdated.
We are working on updating them now, but the update may take some time.
What you want to do is:

  1. In Android Studio, start a new blank project.
  2. Open your settings.gradle (Project Settings).
  3. In your settings.gradle add the following line to your repositories, it would be line 13 on a blank project:
    maven { url "https://jitpack.io" }
  4. Open your build.grade (:app)
  5. In your build.gradle add the following line to your dependencies, it would be line 37 on a blank project:
    implementation 'com.github.datalogic:datalogic-android-sdk:1.31'
  6. A notification should appear at the top of your code to sync your project files, click “Sync Now”

After following these steps, the project should build without errors and you should be able to proceed.

1 Like

Hi Drew

Thanks! This resolved the issue

1 Like

For additional reference on possible building errors, see also this post:

Simone Callegari
Datalogic Mobile Products - L3 Specialist SW Engineer

I’m not able to get a running project in Android Studio Hedgedog
I implement the following lines:

maven { url = uri(“https://jitpack.io”) }
implementation (“com.github.datalogic:datalogic-android-sdk:1.31”)

I always receive this issue:
Could not find com.github.datalogic:datalogic-android-sdk:1.31.

Can you give me a hint what I’m doing wrong

Best regards
René

Our documentation has been updated, check that out here:

I would make sure you followed all the steps listed there.
Also, our SDK has been updated to 1.34, so you will want to use that for the latest features.

Drew Hugentobler
L3 Mobile Computer Specialist Support Engineer

Hello @Rene_Ries

Depending on your project settings, your gradle build system could be based on Groovy or Kotlin.
Depending on the language, the syntax could be slightly different.

Gradle scripts based on Groovy

In the settings.gradle file of the project add the following line:

maven { url "https://jitpack.io" }

This line can be added in your settings.gradle file into the dependencyResolutionManagement block as follows:

dependencyResolutionManagement {
  repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS)
    repositories {
      google()
      mavenCentral()
      maven { url "https://jitpack.io" }      //<---new
    }
}

Then in your app/build.gradle file add a reference to the specific version of the SDK you would like to use

dependencies {
  ...  
  implementation 'com.github.datalogic:datalogic-android-sdk:1.34'   //<---new
  ...
}  //<---

Gradle scripts based on Kotlin

In the settings.gradle file of the project add the following line:

maven (url="https://jitpack.io")

This line can be added in your settings.gradle file into the dependencyResolutionManagement block as follows:

dependencyResolutionManagement {
  repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS)
    repositories {
      google()
      mavenCentral()
      maven(url="https://jitpack.io")  //<---new
    }
}

Then in your app/build.gradle file add a reference to the specific version of the SDK you would like to use

dependencies {
  ...
  implementation("com.github.datalogic:datalogic-android-sdk:1.34")  //<---new
  ...
}

Simone Callegari
Mobile Products L3 Specialist - SW Engineer | Datalogic

These days the Datalogic SDK online documentation has been updated to offer sample instructions on how to reference the SDK’s Maven repository from the project’s Gradle files in the two different Gradle scripting languages, Groovy or Kotlin:

image


Simone Callegari
Mobile Products L3 Specialist - SW Engineer | Datalogic