All Products
Search
Document Center

Object Storage Service:The onFailure callback is not triggered after a resumable upload fails in the OSS Android SDK

Last Updated:Sep 24, 2026

Problem description

When you perform a resumable upload using the Android SDK for Alibaba Cloud Object Storage Service (OSS), the onSuccess callback is triggered if the upload is successful. However, the onFailure callback is not triggered if the upload fails.

Solution

If a file upload fails and the onFailure callback is not triggered in the OSS Android SDK, troubleshoot the issue as follows:

  1. For sample code, see Resumable uploads for the Android SDK. Run a local test to check for issues with the SDK.

    • If the callback is triggered, the SDK is working correctly.

    • If the callback is not triggered, check the SDK configuration.

  2. If the onFailure callback is not triggered after you import the SDK into your project, confirm that network profiler is not set in Android Studio. This issue may occur because your source code is written in Kotlin. The OSS Android SDK does not currently have a Kotlin version, and its onFailure implementation has a null type checking issue. Change the code as follows:

    onFailure(request: ResumableUploadRequest, clientException: ClientException?, serviceException: ServiceException?)
  3. After you change the code, the onFailure callback is triggered as expected.