oliexdev / openScale

Open-source weight and body metrics tracker, with support for Bluetooth scales
GNU General Public License v3.0
1.71k stars 296 forks source link

Crash entering mqtt Server on S24 Android14 (SDK34) [openScaleSync] #1058

Open devdvd opened 2 months ago

devdvd commented 2 months ago

Describe the bug A clear and concise description of what the bug is. App crashes if i activate and enter MQTT IP Address

To Reproduce Steps to reproduce the behavior: _1. Go to 'MQTT'

  1. activate "MQTT sync"
  2. Enter Server and Username and Password
  3. Click on Save login credentials
  4. App crash See error_

Reproduced with latest dev version: ???

Expected behavior A clear and concise description of what you expected to happen. Just to work as expexcted.

Additional context Add any other context about the problem here. Same behaviour if i give wrong credentials or correct credentials. Same behaviour with two different mqtt Server (broker).

Debug log Attach a debug log (see Settings -> About -> Save debug log to file) that is captured while reproducing the issue.

Build version: 0.3.5
Build date: 1981-01-01 01:01:02
Current date: 2024-08-17 16:33:18
Device: Samsung SM-S928B
OS version: Android 14 (SDK 34)

Stack trace: 
java.lang.SecurityException: com.health.openscale.sync: One of RECEIVER_EXPORTED or RECEIVER_NOT_EXPORTED should be specified when a receiver isn't being registered exclusively for system broadcasts
    at android.os.Parcel.createExceptionOrNull(Parcel.java:3069)
    at android.os.Parcel.createException(Parcel.java:3053)
    at android.os.Parcel.readException(Parcel.java:3036)
    at android.os.Parcel.readException(Parcel.java:2978)
    at android.app.IActivityManager$Stub$Proxy.registerReceiverWithFeature(IActivityManager.java:6143)
    at android.app.ContextImpl.registerReceiverInternal(ContextImpl.java:1913)
    at android.app.ContextImpl.registerReceiver(ContextImpl.java:1853)
    at android.app.ContextImpl.registerReceiver(ContextImpl.java:1841)
    at android.content.ContextWrapper.registerReceiver(ContextWrapper.java:772)
    at i4.a.start(:2)
    at t5.b.q(:9)
    at t5.d.run(Unknown Source:91)
    at java.lang.Thread.run(Thread.java:1012)
Caused by: android.os.RemoteException: Remote stack trace:
    at com.android.server.am.ActivityManagerService.registerReceiverWithFeature(ActivityManagerService.java:16610)
    at android.app.IActivityManager$Stub.onTransact$registerReceiverWithFeature$(IActivityManager.java:11555)
    at android.app.IActivityManager$Stub.onTransact(IActivityManager.java:2936)
    at com.android.server.am.ActivityManagerService.onTransact(ActivityManagerService.java:3198)
    at android.os.Binder.execTransactInternal(Binder.java:1375)

and

2024-08-17 16:35:36.640 Debug [2] c: Debug log enabled, openScale sync v0.3.5 (9), SDK 34, samsung SM-S928B
2024-08-17 16:36:02.759 Debug [2] d: Check MQTT sync status
2024-08-17 16:36:02.760 Debug [2] d: Trying to connect to MQTT server
2024-08-17 16:36:02.772 Warning [2] MqttService: Database is closed
2024-08-17 16:36:02.924 Debug [258] a: Unregister AlarmReceiver to MqttService openScaleSync
2024-08-17 16:36:02.975 Debug [259] a: Unregister AlarmReceiver to MqttService openScaleSync
2024-08-17 16:36:02.988 Error [2] a: Failed to connect to tcp://farmer.cloudmqtt.com:16199 Verbindung zu Server kann nicht hergestellt werden (32103) - java.net.ConnectException: failed to connect to farmer.cloudmqtt.com/34.250.16.30 (port 16199) from /192.168.0.140 (port 45156) after 30000ms: isConnected failed: ECONNREFUSED (Connection refused)
2024-08-17 16:36:50.527 Debug [2] d: Check MQTT sync status
2024-08-17 16:36:50.528 Debug [2] d: Trying to connect to MQTT server
2024-08-17 16:36:50.533 Warning [2] MqttService: Database is closed
2024-08-17 16:36:50.535 Error [2] a: Failed to connect to http://192.168.0.75 java.lang.IllegalArgumentException: no NetworkModule installed for scheme "http" of URI "http://192.168.0.75"
2024-08-17 16:36:58.397 Debug [2] d: Check MQTT sync status
2024-08-17 16:36:58.398 Debug [2] d: Trying to connect to MQTT server
2024-08-17 16:36:58.404 Warning [2] MqttService: Database is closed
2024-08-17 16:36:58.405 Error [2] a: Failed to connect to http://192.168.0.75:1883 java.lang.IllegalArgumentException: no NetworkModule installed for scheme "http" of URI "http://192.168.0.75:1883"
2024-08-17 16:37:11.485 Debug [2] d: Check MQTT sync status
2024-08-17 16:37:11.486 Debug [2] d: Trying to connect to MQTT server
2024-08-17 16:37:11.491 Warning [2] MqttService: Database is closed
2024-08-17 16:37:11.521 Debug [265] a: Unregister AlarmReceiver to MqttService openScaleSync
2024-08-17 16:37:11.537 Debug [266] a: Unregister AlarmReceiver to MqttService openScaleSync
2024-08-17 16:37:11.545 Error [2] a: Failed to connect to tcp://192.168.0.75:1883 Verbindung zu Server kann nicht hergestellt werden (32103) - java.net.ConnectException: failed to connect to /192.168.0.75 (port 1883) from /192.168.0.140 (port 52062) after 30000ms: isConnected failed: ENETUNREACH (Network is unreachable)
2024-08-17 16:37:30.333 Debug [2] d: Check MQTT sync status
2024-08-17 16:37:30.334 Debug [2] d: Trying to connect to MQTT server
2024-08-17 16:37:30.339 Warning [2] MqttService: Database is closed
2024-08-17 16:37:30.340 Error [2] a: Failed to connect to 192.168.0.75:1883 java.lang.IllegalArgumentException: Can't parse string to URI "192.168.0.75:1883"
2024-08-17 16:37:51.657 Debug [2] d: Check MQTT sync status
2024-08-17 16:37:51.657 Debug [2] d: Trying to connect to MQTT server
2024-08-17 16:37:51.663 Warning [2] MqttService: Database is closed
2024-08-17 16:37:51.664 Error [2] a: Failed to connect to 192.168.0.75:1883 java.lang.IllegalArgumentException: Can't parse string to URI "192.168.0.75:1883"
2024-08-17 16:37:55.095 Debug [2] d: Check MQTT sync status
2024-08-17 16:37:55.096 Debug [2] d: Trying to connect to MQTT server
2024-08-17 16:37:55.102 Warning [2] MqttService: Database is closed
2024-08-17 16:37:55.103 Error [2] a: Failed to connect to 192.168.0.75:1883 java.lang.IllegalArgumentException: Can't parse string to URI "192.168.0.75:1883"
2024-08-17 16:37:55.103 Error [2] a: Failed to connect to 192.168.0.75:1883 java.lang.IllegalArgumentException: Can't parse string to URI "192.168.0.75:1883"
2024-08-17 16:38:01.601 Debug [2] d: Check MQTT sync status
2024-08-17 16:38:01.602 Debug [2] d: Trying to connect to MQTT server
2024-08-17 16:38:01.606 Warning [2] MqttService: Database is closed
2024-08-17 16:38:01.998 Debug [268] a: Register AlarmReceiver to MqttService.pingSender.openScaleSync