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.

  2. Copy the Nutrient AAR file into your project’s libs directory, and rename it to pspdfkit-2024.7.0.aar.

  3. Include Nutrient as a file-based dependency in your project, and provide all the transitive dependencies required by Nutrient (as shown below):

dependencies {
	implementation files('libs/pspdfkit-2024.7.0.aar')

	// You must include all transitive dependencies of PSPDFKit.
	implementation 'androidx.appcompat:appcompat:1.7.0'
	implementation 'androidx.cardview:cardview:1.0.0'
	implementation 'androidx.compose.material:material:1.7.1'
	implementation 'androidx.compose.runtime:runtime-rxjava3:1.7.1'
	implementation 'androidx.compose.runtime:runtime:1.7.1'
	implementation 'androidx.compose.ui:ui:1.7.1'
	implementation 'androidx.constraintlayout:constraintlayout:2.1.4'
	implementation 'androidx.exifinterface:exifinterface:1.3.7'
	implementation 'androidx.fragment:fragment-ktx:1.8.3'
	implementation 'androidx.gridlayout:gridlayout:1.0.0'
	implementation 'androidx.legacy:legacy-support-v4:1.0.0'
	implementation 'androidx.palette:palette:1.0.0'
	implementation 'androidx.preference:preference:1.2.1'
	implementation 'androidx.recyclerview:recyclerview:1.3.2'
	implementation 'androidx.viewpager2:viewpager2:1.1.0'
	implementation 'androidx.webkit:webkit:1.11.0'
	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.0.20'
	implementation 'org.jetbrains.kotlin:kotlin-stdlib:2.0.20'
	implementation 'org.jetbrains.kotlinx:kotlinx-serialization-json:1.6.3'
}

ℹ️ Note: Starting with the Android Gradle plugin 3.5.0, the use of flatDir repositories to include local AAR files is no longer supported. If you’ve been using this technique, you need to migrate to file-based dependencies when updating the Android Gradle plugin to 3.5.0.

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.