The former mPaaS standard baseline only supports up to 26 for targetSdkVersion. However, The support to targetSdkVersion is added since 10.1.68.21. If your app needs to upgrade targetSdkVersion to 29, refer to Use mPaaS plug-in to update the SDK to 10.1.68.21 or later, and add configuration according to the following description and return to the relevant function.
Update SDK
Update the SDK and related configuration with reference to mPaaS supports for multi-CPU architecture.
Adapt targetSdkVersion 29
Prerequisites
Adapt targetSdkVersion 28 with reference to Adaptation of targetSdkVersion 28 to mPaaS
Modify targetSdkVersion
AAR
Modify the attribute targetSdkVersion 29 in the build.gradle
file under the main module of the project.
Portal&Bundle
Modify the attribute targetSdkVersion 29 in the
build.gradle
file under the main module of the Portal project.The targetSdkVersion in the Bundle project may be left unchanged, but may not be later than that of the Portal project.
Universal configurations
Modify the project AndroidManifest.xml
and add the following attributes under the application node:
<application
android:requestLegacyExternalStorage="true"
... >
The backend uses location function
If your app needs to use the location function while in the backend, you need to add and request the following permissions:
Add the following permissions to
AndroidManifest.xml
:<uses-permission android:name="android.permission.ACCESS_BACKGROUND_LOCATION" />
Ensure that the permission is dynamically requested before calling the locator API:
String[] permissions; if (android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.Q) { permissions = new String[]{ Manifest.permission.ACCESS_FINE_LOCATION, Manifest.permission.ACCESS_COARSE_LOCATION, Manifest.permission.ACCESS_BACKGROUND_LOCATION }; } else { permissions = new String[]{ Manifest.permission.ACCESS_FINE_LOCATION, Manifest.permission.ACCESS_COARSE_LOCATION }; } ActivityCompat.requestPermissions(this, permissions, 101);
Use the Bluetooth function of the mini program
If your app needs to use Bluetooth-related APIs in the mini program, you need to add and request the following permissions.
Add the following permissions to
AndroidManifest.xml
:<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
Ensure that the permission has been requested before calling the Bluetooth API:
String[] permissions = new String[]{ Manifest.permission.ACCESS_FINE_LOCATION, }; ActivityCompat.requestPermissions(this, permissions, 101);
Regression test
Android 10.0+ devices must be included in the full regression test.
For regression test, you need to focus on the following component functions, if used:
Components | Validation project |
Unified data storage | - Whether Database encrypted storage functions well. |
Mobile Analytics Service | - Whether the lag monitoring of Mobile Analytics Service functions well. |
Mini programs | - Whether Mini program file API functions well. - Whether Mini program Bluetooth API functions well. - Whether the map component of the mini program functions well. |
Locating | - Whether Locatingfunctions well. |