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:
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.
If the onFailure callback is not triggered after you import the SDK into your project, confirm that
network profileris 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?)After you change the code, the onFailure callback is triggered as expected.