Migrate to the latest Android SDK version
Update to the current most recent version of the Android SDK, which is 4.1.1.
The latest version of the Android SDK is 4.1.1.
Version 4.1.1 includes all the features of 4.x.x, including a refreshed user experience with a new, seamless UI and support for payment retries.
The following new features are available automatically for all GBP single payments and EUR payments in Ireland:
- A single-screen, modern, declarative UI system under the hood, allowing for smooth transitions and improved user experience.
- Retries: allow your users to change bank on the fly, or retry failed payments without restarting the SDK.
- Cancellation screen streamlining: more insight on why users are abandoning their payments.
- Preselected providers for returning users: automatically select the last used provider, allowing for faster one-click payments and more engaged, better converting users.
This update contains minor bug fixes, improvements and underlying library updates.

The 4.1.1 Mobile SDK UI.

The screen that appears when your user attempts to cancel their payment.
If you are upgrading from version 3.8.0 or later, this is not a breaking release. The minimum requirements for some libraries have changed. If you define libraries explicitly within your project, you need to update these.
If you don't define libraries explicitly within your project, they will automatically update.
Requirements
- The minimum Kotlin version is now
2.2.20 - The minimum Compose BOM is now
2025.10.01 - The
minSdkis now 24,compileSdkis 36 andtargetSdkis 36 - If you are using the
androidx.datastore.datastore-preferencesexplicitly in your project, make sure you've set the version to1.1.7. - the
desugaringlibrary must be version2.1.5 - the
gradlelibrary must be versiongradle-8.13
If you are explicitly defining libraries within your project, use these versions:
androidx.activity.activity-compose:1.11.0androidx.compose.runtime.runtime-tracing:1.9.4androidx.core.core-ktx:1.17.0androidx.fragment.fragment-ktx:1.8.9androidx.fragment.fragment-testing:1.8.9androidx.lifecycle.lifecycle-livedata-ktx:2.9.4androidx.lifecycle.lifecycle-runtime-compose-android:2.9.4androidx.lifecycle.lifecycle-runtime-ktx:2.9.4androidx.lifecycle.lifecycle-viewmodel-compose:2.9.4androidx.lifecycle.lifecycle-viewmodel-ktx:2.9.4androidx.navigation.navigation-compose:2.9.5androidx.work.work-multiprocess:2.11.0androidx.work.work-runtime-ktx:2.11.0com.google.android.material.material:1.13.0androidx.appcompat.appcompat:1.7.1androidx.room.room-compiler:2.7.1androidx.room.room-ktx:2.7.1androidx.room.room-runtime:2.7.1androidx.work.work-multiprocess:2.10.2androidx.work.work-runtime-ktx:2.10.2com.android.tools.desugar_jdk_libs:2.1.5io.coil-kt.coil-compose:2.7.0io.coil-kt.coil-svg:2.7.0io.coil-kt.coil:2.7.0org.jetbrains.kotlinx.kotlinx-coroutines-android:1.10.2org.jetbrains.kotlinx.kotlinx-coroutines-core:1.10.2org.jetbrains.kotlinx.kotlinx-coroutines-test:1.10.2
There are some naming changes. The classes and functions that have been moved are listed in the table below:
| Original | New location |
|---|---|
com.truelayer.payments.ui.models.PaymentContext | com.truelayer.payments.ui.screens.processor.ProcessorContext.PaymentContext |
com.truelayer.payments.ui.screens.coordinator.FlowCoordinatorResult | com.truelayer.payments.ui.screens.processor.ProcessorResult |
com.truelayer.payments.ui.screens.coordinator.FlowCoordinatorActivityContract | com.truelayer.payments.ui.screens.processor.ProcessorActivityContract |
com.truelayer.payments.ui.screens.coordinator.FlowCoordinatorActivity | com.truelayer.payments.ui.screens.processor.ProcessorActivity |
com.truelayer.payments.ui.screens.coordinator.FlowCoordinator | com.truelayer.payments.ui.screens.processor.Processor |
com.truelayer.payments.ui.models.PaymentUseCase | com.truelayer.payments.ui.screens.processor.PaymentUseCase |
com.truelayer.payments.ui.models.PaymentContext.Preferences | com.truelayer.payments.ui.screens.processor.ProcessorContext.PaymentPreferences |
PaymentContext.paymentId | PaymentContext.id |
Instead of a dependency on com.google.android.material:material, the SDK now has a dependency on androidx.compose.material3:material3. The dependency on com.google.accompanist:accompanist-insets has also been removed.
The Activity that hosts the SDK must be either android:launchMode="singleTask" or android:launchMode="singleInstance" depending on your app requirements.
This is to make sure that the SDK Activity is not recreated when your end user is redirected back from the bank to your app. This is important so that the result screen is not shown multiple times.
Limitations
The following features are supported by the SDK, but do not work with the newest UI. Instead, they will fall back to the legacy UI as it appeared in versions 3.9.1 and below:
- Payment mandates (or recurring payments)
- EUR payments for countries other than Ireland
This means that retries and cancellation insights are not available for these payments.
SDK theming
When integrating via Compose you no longer need to wrap the Processor composable with Theme.
The theme will be applied automatically. If you want to customise the theme, the Processor composable
now accepts a theme parameter.
Contact us for more details about custom theming. If you try to customise the SDK theme but custom theming is not enabled, the SDK falls back to the default theme.
// Your payments custom theme or use the provided defaults as below
// theme is optional, if not provided default theme will be applied
val theme = TrueLayerTheme(
lightPalette = LightColorDefaults,
darkPalette = DarkColorDefaults,
typography = TypographyDefaults
)
// Obtain your payment context from your backend
val paymentContext = PaymentContext(
id = "your-payment-identifier",
resourceToken = "payment-resource-token",
redirectUri = "redirect-uri-that-will-be-invoked-when-coming-back-from-bank"
)
setContent {
Processor(
context = paymentContext,
// theme is optional, if not provided default theme will be applied
theme = theme,
onSuccess = { successStep ->
// action on success
},
onFailure = { failureReason ->
// action on failure
}
)
}
Because the SDK is using Scaffold and BottomSheetScaffold under the hood to present its UI components
you need to make sure that you don't have nested Scaffold or BottomSheetScaffold in your app when integrating the SDK via Compose.
Although the SDK will work the UI may not behave as expected.
Callbacks
The redirect callback has been removed from this version of the Android SDK. The SDK will no longer send a success message with reason redirect.
Therefore, the SDK will no longer be dismissed after the redirect to the bank app. Instead, you must bring the SDK screen back to the front when you redirect the user back from the bank app.
Payment statuses
The SDK now only returns one of the following terminal [statuses] for a payment:
failedcancelledexecutedsettledauthorized.
Desugaring
We've extended Android compatibility to Android 5.0+ (API level 21+). If your app supports Android 8.0 or below (API level 26), you must make sure that your project has desugaring enabled. Without desugaring, in specific scenarios, the SDK may crash on devices running Android below API level 26.
The following code example helps you to enable desugaring in your project.
android {
...
compileOptions {
coreLibraryDesugaringEnabled true
}
...
}
dependencies {
...
coreLibraryDesugaring "com.android.tools:desugar_jdk_libs:2.1.5"
...
}
UI customisation with Jetpack Compose
To use the latest versions of the SDK, you must integrate with Compose to customise your app UI. You can no longer use XML files to do this.
If your app uses XML for UI
You can integrate the SDK with Compose, even if your app otherwise uses XML. Here's how:
- Enable Compose in your project by adding the code snippet below to the
androidblock in your app-levelbuild.gradlefile.
buildFeatures {
compose = true
}
composeOptions {
kotlinCompilerExtensionVersion = "1.5.4"
}
- Add the following dependencies to your
build.gradlefile:
implementation("androidx.activity:activity-compose:$latest-version")
implementation("androidx.compose.material3:material3")
- Follow the steps for Compose integration.
- For a full list of customisation options, read the Compose customisation guide.
If you are directly integrating with Compose
For the activity that hosts the Compose view that processes the payment:
- Call
enableEdgeToEdge()inActivity.onCreate. - Set
android:windowSoftInputMode="adjustResize"in your Activity'sAndroidManifest.xmlentry.
This setting allows your app to receive the size of the software IME as insets. When the IME appears and disappears in your app, you can pad and lay out content appropriately.
These changes ensure that the UI displays correctly when the keyboard is shown.
If you process payments with a Jetpack Compose integration, remove the following code from your activity hosting. This code was required in previous versions, but will now cause user interface issues.
WindowCompat.setDecorFitsSystemWindows(window, false)
@Suppress("DEPRECATION")
window.setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_ADJUST_RESIZE)
Updated 7 days ago
