Troubleshooting¶
Overview of common issues.
Upgrade SAP BTP SDK for Android to Release 5.0¶
Problem: Upgrading the version
and sdkVersion
to 5.0.0 will cause build errors/exceptions.
Workaround: See solution
Request Gets Timeout But Response Is Returned¶
Problem: Sometimes an HTTP request gets java.net.SocketTimeoutException
on the app after sending it, despite mobile services sending back the response correctly.
Thus the error is not shown in mobile services logs or network traces.
Workaround: The reason for the timeout exception is, when there are many parallel HTTP requests sent to mobile services, the server may not be able to handle them in time.
To solve this, the client code needs to set a large timeout value for read and write operations.
See OkHttpClient
for additional information on timeouts.
OkHttpClient okHttpClient = new OkHttpClient.Builder()
.addInterceptor(...)
.connectTimeout(60, TimeUnit.SECONDS)
.readTimeout(60, TimeUnit.SECONDS)
.writeTimeout(60, TimeUnit.SECONDS)
.build();
ClientProvider.set(okHttpClient);
Upgrade H2 Database¶
Problem: H2 database 1.4.199 or earlier versions have critical vulnerabilities, but after upgrading the database to 1.4.200, opening the database generated with previous versions is problematic. Users cannot use the connection accounts feature without the correct version of the H2 database.
Fix: upgrade the existing H2 database to 1.4.200 if the application encounters issues (because the existing database is version 1.4.199 or lower). The user will see a message prompting them to run a script to upgrade the H2 database. The script is in the installer file.
For Linux: Run upgradeH2Database.sh
.
For Mac OS: Run upgradeH2Database.sh
.
For Windows: Run upgradeH2Database.bat
.
Failed to Get Metadata From The Configured Destinations¶
Problem: Sometimes the Wizard fails to download metadata from the configured destinations during application generation.
Workaround: The Wizard will interrupt the application generation process to open a dialog and ask you to upload an OData metadata file from your local file system. At the same time, the following warning message will be displayed when the generated project opens in Android Studio:
Warning
The following Destination(s) might be misconfigured, which can result in a non-working application. Please check the related settings in the SAP mobile service cockpit: [app ID]
Failed to Identify The New Generated Project as Gradle Based Project¶
Problem: Occasionally, Android Studio fails to identify a newly generated project as a Gradle-based
project when the IDE opens it, resulting in an error message: The project is not a Gradle-based
project.
Workaround: Manually launch the Build Bundles command to run new build tasks:
- Select Build → Build Bundle(s)/APK(s) and click Build Bundle(s).
Failed to Transform bcprov-jdk15on-1.70.jar
¶
Problem: If the Gradle plugin version of the application project is lower than 7.0.2, after upgrading to SDK 5.0, the project may report this build error.
Fix: Upgrade the Gradle plugin version of your application project to 7.0.2 or higher.
Workaround: If you cannot upgrade the Gradle plugin version, in the gradle.properties
file of your project, add android.jetifier.blacklist=bcprov
for Gradle plugin versions lower than 7.0, or add android.jetifier.ignorelist=bcprov
for Gradle plugin versions between 7.0 and 7.0.2.
App Crash On Older Android OS Versions Due To "Class Not Found" Error¶
Problem: On some older versions of Android OS, such as 8.0 and earlier, after upgrading to SDK 4.0 or 5.0, the application may crash randomly due to a Baidu "class not found" error.
Fix: Upgrade the SDK to 4.0.7, 5.0.1, or higher.
Workaround: If you cannot upgrade the SDK version, add the following remove nodes code in the manifest.xml
file of your project.
<receiver
android:name="com.sap.cloud.mobile.foundation.remotenotification.SAPBaiduPushMessageReceiver"
tools:node="remove" />
<receiver
android:name="com.baidu.android.pushservice.PushServiceReceiver"
tools:node="remove" />
<receiver
android:name="com.baidu.android.pushservice.RegistrationReceiver"
tools:node="remove" />
<service
android:name="com.baidu.android.pushservice.PushService"
tools:node="remove" />