Troubleshooting¶
Overview of common issues.
Gradle Building May Fail on Upgrading to SAP BTP SDK for Android to Release 24.8.0¶
Problem: When using Jetpack Composed Based UI library in the project, the building may fail on not resolving com.github.jeziellago:compose-markdown:0.5.0.
Fix: Since the Jetpack Composed based Fiori UI library of version 24.8.0 or above depends on a third party MarkDown library which is only published on https://jitpack.io, so the developer will need to add https://jitpack.io in the maven repositories in the build script to meet the dependency.
Buttons Cannot Be Displayed Properly¶
Problem: When using Fiori screens containing buttons, if buttons cannot be auto-inflated as material buttons (you can check this using the Android Studio Layout Inspector), some attributes will not take effect, for instance, backgroundTint. Buttons will then not be displayed properly.
Fix: <Button> is auto-inflated as <com.google.android.material.button.MaterialButton> via MaterialComponentsViewInflater when using a non-Bridge Theme.MaterialComponents.* theme. Make sure that you apply a non-Bridge Theme.MaterialComponents.* theme (or any theme that inherits a non-Bridge Theme.MaterialComponents.* theme) when trying to import these Fiori screens. Meanwhile, ensure the activity class containing these screens extends androidx.appcompat.app.AppCompatActivity rather than android.app.Activity.
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).
A View-Based App May Fail to Build Since Android Studio 2024.2.1¶
Problem: By default, the Gradle JDK in Android Studio 2024.2.x is set to JDK 21.0.x. However, a newly created view-based app should be built with JDK 17. This mismatch results in build issues.
Fix: Locate and change the Gradle JDK setting to JDK 17.0.11-17.0.14. Ensure the java.home variable defined in the config.properties file under the .gradle folder of your project is also set to JDK 17. Afterward, clean your project's cache and try again.
Data Binding Issues During Kotlin 2.x Upgrading for View-Based Apps¶
Problem: Upgrading a view-based app to Kotlin 2.x may lead to data binding issues:
- If you use KAPT as an annotation processor, the proxy classes produced by the OData generator are invisible when Kotlin 2.x is active.
- Kotlin's stricter type-casting rules prevent automatic coercion between
CharSequenceandString. This is no longer allowed when binding object properties to Fiori components.
Fix:
- Explicitly pass the generated-proxy directory to KAPT using the android
sourceSetsblock. Update any annotation syntax to comply with the new KAPT requirements.
android {
...
sourceSets {
main {
java.srcDirs += ['build/generated/source/odata/googlePlayStoreforGlobalMarket/debug/',
'build/generated/source/odata/tencentAppStoreforChinaMarket/debug/']
}
}
}
- Explicitly convert
Stringobjects toCharSequencewhen binding object properties to Fiori components. For more details, refer to the pull request.
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" />