Description and solution of the problem that the Tuya APP map UI business package causes the APP to crash when positioni

App development related product technical discussions, including OEM App, App SDK, device control interface development, mini program development and other topics.


Post Reply
daxiong
Posts: 13

Problem background:
After the release of the Android14 beta version, Google officially updated the restrictions on non-SDK interfaces, including reflection restrictions on multiple existing historical methods and new methods of the Location class of the positioning function, such as:

  1. New method: getMslAltitudeAccuracyMeters()
  2. Historical method: getLongitude()
    There are many such methods. For details, please refer to: https://developer.android.com/about/ver ... non-sdk-14

Download the corresponding csv file and query the restricted class name: Landroid/location/Location

However, this class is not restricted in Android13 systems and before. For details, please refer to:
https://developer.android.com/guide/app ... interfaces

problem causes:
Based on business needs, the Tuya map positioning component provides a method to obtain the current positioning information. The Javabean that stores the positioning information encapsulates the Location object for serialized transmission, and both Fastjson and Gson serialization and deserialization require reflection. Disabled on Android14 systems.
In short, the Android 14 system does not allow reflection to call the Location class method. Android 13 and previous systems allow it, and we used this class method for serialized transmission reflection, thus triggering a crash on the Android 14 system phone. Previous Android system versions are not affected and can be used normally.

Sphere of influence:

  1. Affected customers: Accessed map positioning UI business package
  2. Called the positioning function of the map positioning UI business package

solution:
For 4.x and 5.x SDK versions, please upgrade the map positioning UI business package to the latest version of the corresponding series respectively, and ensure that the version you access is as follows:
4 series version, please upgrade to at least the following versions:

Code: Select all

dependencies {
implementation 'com.tuya.smart:tuyasmart-bizbundle-map_google:4.2.0-33'
implementation 'com.tuya.smart:tuyasmart-bizbundle-location_google:4.2.0-33'
}

5 series version, please upgrade to at least the following versions:

Code: Select all

dependencies {
implementation 'com.thingclips.smart:thingsmart-bizbundle-map_google:4.8.0-6'
implementation 'com.thingclips.smart:thingsmart-bizbundle-location_google:4.8.0-6'
}

Compatibility time:

  1. 5.x compatible release time: June 15, 2023
  2. 4.x compatible release time: June 25, 2023
  3. 3.x is not compatible, please upgrade to 4.x yourself (4.x is compatible with 3.x)
Post Reply