Upgrading

Maven-Based Integration

If your app automatically integrates PSPDFKit using our Maven repository, all you need to do is update the dependency inside your build.gradle file. You can also use a version wildcard to tell gradle to look for a new version every time your app is built:

app/build.gradle
1
2
3
4
...
dependencies {
    compile 'com.pspdfkit:pspdfkit:5.0.+' // keeps hotfix versions up to date
}

Note: While you can also use com.pspdfkit:pspdfkit:+ to build with the most recent stable version, it is not recommended, as builds may fail if breaking API changes were introduced in the newer version.

Manual AAR File Integration

If you manually downloaded and integrated the PSPDFKit AAR file, you need to go to the customer portal download page and download a recent AAR file from there. Replace the existing AAR file inside your app/libs/ folder and update all dependencies (including required third-party dependencies) inside your build.gradle file to the latest versions:

app/build.gradle
1
2
3
4
5
...
dependencies {
    compile 'com.pspdfkit:pspdfkit:[email protected]'
    ...
}

Important: You need to update versions of all dependencies, as stated in the online guides for that version, or your build will probably fail.

Migration Troubleshooting

If you’re updating to a newer version, it might happen that you receive build time or even runtime errors. In such a situation, the first step is to do a clean build of your project:

  • In Android Studio — Build -> Rebuild Project
  • From the command line — ./gradlew clean before building the app

Also try uninstalling any previously installed development version of your app, in order to eliminate the problem of stale data.

API Changes

After an upgrade, you might see new warnings or build errors due to PSPDFKit API changes. Commonly used APIs are normally deprecated before being changed — we annotate these methods with @Deprecated and provide a migration strategy. We recommend that you upgrade deprecated APIs as soon as possible, as APIs that are less commonly used may be changed without prior notice and this might lead to build failures on your side. If that happens, please consult the changelog for details on how to resolve the issue.