Manual library integration

Nutrient Android SDK can be imported manually. Below are the steps to follow if you wish to do so.

  1. Download the [Nutrient Android SDK library AAR bundle from our Maven repository](http://my.nutrient.io/maven/com/pspdfkit/pspdfkit/10.7.0/pspdfkit-10.7.0.aar).
  2. Copy it to your project’s libs directory.
  3. Add it as a file-based dependency, along with the required transitive dependencies:
dependencies {
implementation(files("libs/Nutrient-Android-SDK-AAR-10.7.0.aar")
// You must include all transitive dependencies of Nutrient.
implementation("androidx.appcompat:appcompat:1.7.0")
implementation("androidx.cardview:cardview:1.0.0")
implementation("androidx.compose.material3:material3:1.3.1")
implementation("androidx.compose.runtime:runtime:1.7.8")
implementation("androidx.compose.runtime:runtime-rxjava3:1.7.8")
implementation("androidx.compose.ui:ui:1.7.8")
implementation("androidx.constraintlayout:constraintlayout:2.2.0")
implementation("androidx.exifinterface:exifinterface:1.3.7")
implementation("androidx.fragment:fragment-ktx:1.8.5")
implementation("androidx.fragment:fragment-compose:1.8.5")
implementation("androidx.gridlayout:gridlayout:1.0.0")
implementation("androidx.legacy:legacy-support-v4:1.0.0")
implementation("androidx.preference:preference:1.2.1")
implementation("androidx.recyclerview:recyclerview:1.4.0")
implementation("androidx.viewpager2:viewpager2:1.1.0")
implementation("androidx.webkit:webkit:1.12.1")
implementation("com.getkeepsafe.relinker:relinker:1.4.5")
implementation("com.google.android.material:material:1.12.0")
implementation("io.reactivex.rxjava3:rxandroid:3.0.2")
implementation("io.reactivex.rxjava3:rxjava:3.1.6")
implementation("org.jetbrains.kotlin:kotlin-stdlib-jdk8:2.1.20")
implementation("org.jetbrains.kotlin:kotlin-stdlib:2.1.20")
implementation("org.jetbrains.kotlin:kotlin-parcelize-runtime:2.1.20")
implementation("org.jetbrains.kotlinx:kotlinx-collections-immutable:0.3.8")
implementation("org.jetbrains.kotlinx:kotlinx-serialization-json:1.7.1")
}

flatDir repositories have been deprecated since Android Gradle plugin (AGP) 3.5. Use file-based AAR dependencies.

The following library is included in the list of transitive dependencies:

  • ReLinker — to work around some versions of Android that have unreliable PackageManager implementations

This optional library can be omitted from the list of transitive dependencies if you don’t want to bundle it with your app. In such a case, Nutrient will detect the absence of this dependency and fall back to different implementations.

ProGuard

There’s no need to specify additional ProGuard rules since Nutrient uses consumersProguardFiles to keep ProGuard from obfuscating the required symbols. If you want to check out the rules, look in the proguard.txt file, which is located inside the Nutrient .aar:

Terminal window
cd [YOUR_AAR_LOCATION]
unzip [YOUR_AAR_NAME].aar -d aar-contents
cat aar-contents/proguard.txt