tuya / tuya-android-industry-app-sdk-sample

This sample provides examples of Tuya Industry App SDK basic functions such as device network configuration, login and registration, and asset management of Tuya Open API.
MIT License
0 stars 0 forks source link

RequestTask errorCode: 99010102 errorMessage: json parse error #7

Closed jonasbark closed 2 years ago

jonasbark commented 2 years ago

With com.tuya.smart:iot-app-sdk:1.0.3 and com.tuya.smart:iot-app-sdk:1.0.2 we're getting the following issue when running:

TYActivatorManager.activator.getRegistrationResultToken(
            token.token,
            object : ResultListener<DeviceRegistrationResultBean> {
                override fun onFailure(errorCode: String?, errorMsg: String?) {
                    result.error(IOException("$errorCode $errorMsg"))
                }

Logs

D/Tuya: RequestTask onResponse : true
D/Tuya: RequestTask onResponse body: {"result":{"errorDevices":[],"successDevices":[{"id":"****","ip":"***","lat":"44.444","lon":"9.000","name":"***","productId":"***","uuid":"***"}]},"success":true,"t":1642493014050}
D/Tuya: TYRequestImpl =======after convert===: {"errorDevices":[],"successDevices":[{"id":"***","ip":"***","lat":"44.4444","lon":"9.000","name":"***","productId":"***","uuid":"***"}]}
D/Tuya: RequestTask errorCode: 99010102 errorMessage: json parse error
linhuiluo commented 2 years ago

@jonasbark Do you have your own integrated fastjson parsing library, what is the version ? It may be a library conflict.If it is convenient for you, provide us with a debug apk for further investigation?

jonasbark commented 2 years ago

Yes, you are correct!

I used 'com.alibaba:fastjson:1.1.67.android' which was used in https://github.com/tuya/tuya-home-android-sdk-sample-kotlin/blob/main/homesdk_sample/app/build.gradle#L68 but upgraded to 1.2.32 and it works fine now.

Thanks!