Nutrient 5.1 migration guide
This article provides a set of guidelines for migrating from version 5.0 to version 5.1 of Nutrient Android SDK. If you’re upgrading from a version earlier than 5.0, review the Android 5 migration guide first.
AndroidX
Nutrient Android SDK now uses AndroidX instead of the support library, which means you’ll have to migrate your applications in order to continue using Nutrient. The complete migration instructions can be found here. You can let Android Studio automatically migrate your project.
However, you might still need to manually update a few things afterward before everything is working properly.
Notable changes and deprecations
-
XfdfFormatter#writeXfdf[Async]()
now throws an exception when an annotation that isn’t attached to the document is passed in. -
Deprecates
TextSearch
constructors takingContext
. Use other overloads instead. -
Deprecates the
SearchOptions.Builder()
constructor takingContext
. Use the default constructor instead. -
Deprecates
isShareEnabled()
inPdfActivityConfiguration
. UsePdfConfiguration#getEnabledShareFeatures()
instead. -
Deprecates
enableShare()
anddisableShare()
inPdfActivityConfiguration.Builder
. UsePdfActivityConfiguration.Builder#setEnabledShareFeatures()
instead. -
Deprecates
isTextSharingEnabled()
,isEmbeddedFilesSharingEnabled
, andisSharingNoteEditorContentEnabled()
inPdfConfiguration
. UsePdfConfiguration#getEnabledShareFeatures()
instead. -
Deprecates
textSharingEnabled()
,embeddedFileSharingEnabled()
, andsharingNoteEditorContentEnabled
inPdfConfiguration.Builder
. UsePdfConfiguration.Builder#setEnabledShareFeatures()
instead.
Java 8 support
Since Nutrient Android SDK 5, apps including Nutrient need to enable Java 8 support. In order to enable Java 8 support, follow the instructions below.
-
Make sure you’re using version
3.2.1
or higher of the Android Gradle plugin. In your top-levelbuild.gradle
file, add:
classpath 'com.android.tools.build:gradle:3.2.1'
-
In your app-level
build.gradle
file, enable Java 8 support:
compileOptions { sourceCompatibility JavaVersion.VERSION_1_8 targetCompatibility JavaVersion.VERSION_1_8 }