Android Companion app crashes multiple times on startup

Hi guys,

I’m experiencing issues with the Android companion app.
On startup of the app it usually crashes multiple times (it works just long enough to show my Lovelace) after which it does work. I’ve tried to examine the crash reports but could not find anything that points to a problem.
I’ve tried multiple different conditions (like VPN on/off, WIFI/4G) but none of these turned out to be the culprit.
Does anyone has any idea where to start looking for the problem?

Kind regards,
Stefan

we will need the on device logs, if you are able to Settings > Companion App > Show and Share Logs…you should see a Recent Crash tab just below the share icon. If it is not there then we will need to get logs using another method like either Android Studio or Logcat Reader

Thanks for your reply. The Logs did not show any crash.
EDIT: I’ve attached parts of the logcat as the entire thing did not fit. These were the parts of which I thought were interesting.
I appreciate you helping my out.


2022-11-09 20:51:56.267 31838-18593 FA-SVC                  pid-31838                            V  Background event processing time, ms: 23
2022-11-09 20:51:56.268 22017-22094 HwCustConn...anagerImpl pid-22017                            D  isBlockNetworkRequestByNonAis, INVALID_SUBSCRIPTION_ID
2022-11-09 20:51:56.268 22017-22094 ConnectivityManager     pid-22017                            I  requestNetwork and the calling app is: io.homeassistant.companion.android
2022-11-09 20:51:56.270  1610-2103  ConnectivityService     pid-1610                             I  requestNetwork for uid/pid:10309/22017 NetworkRequest [ TRACK_DEFAULT id=36104, [ Capabilities: INTERNET&NOT_RESTRICTED&TRUSTED Uid: 10309 DNN:  SSCMODE: 0 SNSSAI:  PduSessionType: 0 RouteBitmap: 0] ]
2022-11-09 20:51:56.270  1610-1925  ConnectivityService     pid-1610                             I  rematching NetworkAgentInfo [VPN () - 1782]
2022-11-09 20:51:56.270  1610-1925  ConnectivityService     pid-1610                             I  CS = 0, NS = 101
2022-11-09 20:51:56.270  1610-1925  ConnectivityService     pid-1610                             I  rematch for NetworkAgentInfo [VPN () - 1782]
2022-11-09 20:51:56.271  1610-1910  WifiNetworkFactory      pid-1610                             D  got request NetworkRequest [ TRACK_DEFAULT id=36104, [ Capabilities: INTERNET&NOT_RESTRICTED&TRUSTED Uid: 10309 DNN:  SSCMODE: 0 SNSSAI:  PduSessionType: 0 RouteBitmap: 0] ] with score 101 and serial -2
2022-11-09 20:51:56.271  2593-2593  PhoneSwitc...stListener pid-2593                             D  got request NetworkRequest [ TRACK_DEFAULT id=36104, [ Capabilities: INTERNET&NOT_RESTRICTED&TRUSTED Uid: 10309 DNN:  SSCMODE: 0 SNSSAI:  PduSessionType: 0 RouteBitmap: 0] ] with score 101 and serial -2
2022-11-09 20:51:56.271  2593-2593  PhoneSwitc...stListener pid-2593                             D  got request NetworkRequest [ TRACK_DEFAULT id=36104, [ Capabilities: INTERNET&NOT_RESTRICTED&TRUSTED Uid: 10309 DNN:  SSCMODE: 0 SNSSAI:  PduSessionType: 0 RouteBitmap: 0] ] with score 101 and serial -2
2022-11-09 20:51:56.271  1610-1910  UntrustedW...orkFactory pid-1610                             D  got request NetworkRequest [ TRACK_DEFAULT id=36104, [ Capabilities: INTERNET&NOT_RESTRICTED&TRUSTED Uid: 10309 DNN:  SSCMODE: 0 SNSSAI:  PduSessionType: 0 RouteBitmap: 0] ] with score 101 and serial -2
2022-11-09 20:51:56.271  1610-1994  Ethernet                pid-1610                             D  got request NetworkRequest [ TRACK_DEFAULT id=36104, [ Capabilities: INTERNET&NOT_RESTRICTED&TRUSTED Uid: 10309 DNN:  SSCMODE: 0 SNSSAI:  PduSessionType: 0 RouteBitmap: 0] ] with score 101 and serial -2
2022-11-09 20:51:56.271  1610-1925  ConnectivityService     pid-1610                             I  NetworkAgentInfo [VPN () - 1782] NC all is: 23 19 35000 4 8 65 35977 35647 35726 35995 9 36008 35471 26 35996 26833 35971 10 36102 33 36006 35317 14 
2022-11-09 20:51:56.271  2593-2593  VoWifiFactory           pid-2593                             D  got request NetworkRequest [ TRACK_DEFAULT id=36104, [ Capabilities: INTERNET&NOT_RESTRICTED&TRUSTED Uid: 10309 DNN:  SSCMODE: 0 SNSSAI:  PduSessionType: 0 RouteBitmap: 0] ] with score 101 and serial -2
2022-11-09 20:51:56.272  8983-13064 FontLog                 pid-8983                             I  Pulling font file for id = 362, cache size = 23 [CONTEXT service_id=132 ]
2022-11-09 20:51:56.272  1610-1925  ConnectivityService     pid-1610                             I  rematching NetworkAgentInfo [WIFI () - 1781]
2022-11-09 20:51:56.272  1610-1925  ConnectivityService     pid-1610                             I  CS = 101, NS = 60
2022-11-09 20:51:56.273  1610-1925  chatty                  pid-1610                             I  uid=1000(system) ConnectivitySer identical 22 lines
2022-11-09 20:51:56.273  1610-1925  ConnectivityService     pid-1610                             I  CS = 101, NS = 60
2022-11-09 20:51:56.273  1610-1925  ConnectivityService     pid-1610                             I  NetworkAgentInfo [WIFI () - 1781] NC all is: 1 12 
2022-11-09 20:51:56.273  8983-21893 NetworkScheduler        pid-8983                             W  Error inserting flex_time=2949000 job_id=-1 period=5900000 source=16 requires_charging=0 preferred_network_type=1 target_class=com.google.android.gms.measurement.PackageMeasurementTaskService user_id=0 target_package=com.google.android.gms tag=Measurement.PackageMeasurementTaskService.UPLOAD_TASK_TAG task_type=0 required_idleness_state=0 service_kind=0 source_version=224312000 persistence_level=1 preferred_charging_state=1 required_network_type=0 runtime=1668023516269 retry_strategy={"maximum_backoff_seconds":{"3600":0},"initial_backoff_seconds":{"30":0},"retry_policy":{"0":0}} last_runtime=0 [CONTEXT service_id=218 ]
                                                                                                    android.database.sqlite.SQLiteConstraintException: UNIQUE constraint failed: pending_ops.tag, pending_ops.target_class, pending_ops.target_package, pending_ops.user_id (Sqlite code 2067 SQLITE_CONSTRAINT_UNIQUE), (OS error - 2:No such file or directory)
                                                                                                    	at android.database.sqlite.SQLiteConnection.nativeExecuteForLastInsertedRowId(Native Method)
                                                                                                    	at android.database.sqlite.SQLiteConnection.executeForLastInsertedRowId(SQLiteConnection.java:923)
                                                                                                    	at android.database.sqlite.SQLiteSession.executeForLastInsertedRowId(SQLiteSession.java:810)
                                                                                                    	at android.database.sqlite.SQLiteStatement.executeInsert(SQLiteStatement.java:88)
                                                                                                    	at android.database.sqlite.SQLiteDatabase.insertWithOnConflict(SQLiteDatabase.java:1646)
                                                                                                    	at android.database.sqlite.SQLiteDatabase.insertOrThrow(SQLiteDatabase.java:1536)
                                                                                                    	at bjtw.g(:com.google.android.gms@[email protected] (100408-483592595):53)
                                                                                                    	at bjsp.n(:com.google.android.gms@[email protected] (100408-483592595):3)
                                                                                                    	at bjsp.u(:com.google.android.gms@[email protected] (100408-483592595):20)
                                                                                                    	at bjsp.h(:com.google.android.gms@[email protected] (100408-483592595):3)
                                                                                                    	at bjog.run(:com.google.android.gms@[email protected] (100408-483592595):9)
                                                                                                    	at abkt.c(:com.google.android.gms@[email protected] (100408-483592595):6)
                                                                                                    	at abkt.run(:com.google.android.gms@[email protected] (100408-483592595):8)
                                                                                                    	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167)
                                                                                                    	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641)
                                                                                                    	at abpy.run(:com.google.android.gms@[email protected] (100408-483592595):0)
                                                                                                    	at java.lang.Thread.run(Thread.java:929)
2022-11-09 20:51:56.276  8983-13064 FontLog                 pid-8983                             I  Received query name=Noto Color Emoji Compat&weight=400&besteffort=false, URI content://com.google.android.gms.fonts [CONTEXT service_id=132 ]
2022-11-09 20:51:56.276  8983-13064 FontLog                 pid-8983                             I  Query [name=Noto Color Emoji Compat&weight=400&besteffort=false] resolved to {Noto Color Emoji Compat, wdth 100.0, wght 400, ital 0.0, bestEffort false} [CONTEXT service_id=132 ]
2022-11-09 20:51:56.277  8983-13064 FontLog                 pid-8983                             I  Fetch {Noto Color Emoji Compat, wdth 100.0, wght 400, ital 0.0, bestEffort false} end status Status{statusCode=SUCCESS, resolution=null} [CONTEXT service_id=132 ]

2022-11-09 20:51:56.949  1610-1714  HWExtDeviceManager      pid-1610                             I  trigger onDeviceDataChanged : mListener : com.android.server.policy.HWExtMotionRotationProcessorEx$1@1e09048,type : 700
2022-11-09 20:51:56.949  1610-1714  HWEMRP                  pid-1610                             I  onDeviceDataChanged proposedRotation:0
2022-11-09 20:51:56.949  1610-1714  HWEMRP                  pid-1610                             I  onDeviceDataChanged oldProposedRotation:-1
2022-11-09 20:51:56.949  1610-1714  HWEMRP                  pid-1610                             I  notifyProposedRotation: 0
2022-11-09 20:51:57.024   628-28459 netd                    pid-628                              I  trafficSwapActiveStatsMap() <18.45ms>
2022-11-09 20:51:57.114 22017-22236 WebviewActivity         pid-22017                            D  External bus {"type":"config/get","id":1}
2022-11-09 20:51:57.121 22017-22017 WebviewActivity         pid-22017                            D  externalBus({"id":1,"type":"result","success":true,"result":{"hasSettingsScreen":true,"canWriteTag":true,"hasExoPlayer":true}});
2022-11-09 20:51:57.156  1610-9377  WifiService             pid-1610                             E  enforceCanAccessScanResults: hiding ssid and bssidLocation mode is disabled for the device
2022-11-09 20:51:57.157  1610-9377  WifiService             pid-1610                             E  enforceCanAccessScanResults: hiding ssid and bssidLocation mode is disabled for the device
2022-11-09 20:51:57.158 22017-22017 UrlRepository           pid-22017                            D  localUrl is: false and usesInternalSsid is: false
2022-11-09 20:51:57.158 22017-22017 UrlRepository           pid-22017                            D  Using external URL
2022-11-09 20:51:57.166 22017-22017 WebviewActivity         pid-22017                            D  Callback null
2022-11-09 20:51:57.168 22017-22017 WebviewActivity         pid-22017                            D  Color from webview is "#101e24-SPACER-#111111"
2022-11-09 20:51:57.168 22017-22017 WebviewActivity         pid-22017                            D  Color from webview is "#101e24-SPACER-#111111"
2022-11-09 20:51:57.169 22017-22116 WebViewPresenterImpl    pid-22017                            D  Try getting color from webview color "#101e24".
2022-11-09 20:51:57.170 22017-22116 WebViewPresenterImpl    pid-22017                            I  Found color -15720924.
2022-11-09 20:51:57.171 22017-22116 WebViewPresenterImpl    pid-22017                            D  Try getting color from webview color "#111111".
2022-11-09 20:51:57.172 22017-22116 WebViewPresenterImpl    pid-22017                            I  Found color -15658735.
2022-11-09 20:51:57.221 22017-22057 SensorReceiver          pid-22017                            D  Nothing to update
2022-11-09 20:51:57.265 22017-22029 mpanion.androi          pid-22017                            A  logging.cc:172] 12c00000-16740000 rw-p 00000000 00:00 0                                  [anon:dalvik-main space (region space)]
2022-11-09 20:51:57.265 22017-22029 mpanion.androi          pid-22017                            A  logging.cc:172] 16740000-18380000 rw-p 00000000 00:00 0                                  [anon:dalvik-main space (region space)]
2022-11-09 20:51:57.265 22017-22029 mpanion.androi          pid-22017                            A  logging.cc:172] 18380000-18400000 rw-p 00000000 00:00 0                                  [anon:dalvik-main space (region space)]
2022-11-09 20:51:57.265 22017-22029 mpanion.androi          pid-22017                            A  logging.cc:172] 18400000-19e40000 rw-p 00000000 00:00 0                                  [anon:dalvik-main space (region space)]
2022-11-09 20:51:57.265 22017-22029 mpanion.androi          pid-22017                            A  logging.cc:172] 19e40000-42c00000 rw-p 00000000 00:00 0                                  [anon:dalvik-main space (region space)]
2022-11-09 20:51:57.265 22017-22029 mpanion.androi          pid-22017                            A  logging.cc:172] 70eee000-711a3000 rw-p 00000000 fd:05 19689169                           /system/framework/arm64/boot.art
202

2022-11-09 20:51:57.325 22017-22029 mpanion.androi          pid-22017                            A  verification.cc:91] MemMap:
2022-11-09 20:51:57.325 22017-22029 mpanion.androi          pid-22017                            A  verification.cc:91] [MemMap: 0x12c00000+0x30000P prot=0x3 main space (region space)]
2022-11-09 20:51:57.325 22017-22029 mpanion.androi          pid-22017                            A  verification.cc:91] [MemMap: 0x70eee000+0x2b5P prot=0x3 /system/framework/arm64/boot.art]
2022-11-09 20:51:57.325 22017-22029 mpanion.androi          pid-22017                            A  verification.cc:91] [MemMap: 0x711a3000+0x120P prot=0x3 /system/framework/arm64/boot-core-libart.art]
2022-11-09 20:51:57.325 22017-22029 mpanion.androi          pid-22017                            A  verification.cc:91] [MemMap: 0x712c3000+0x46P prot=0x3 /system/framework/arm64/boot-okhttp.art]


2022-11-09 20:51:57.333 22017-22029 mpanion.androi          pid-22017                            A  verification.cc:92] 0x71a2c48540 main space (region space) 0x12c00000-0x42c00000
2022-11-09 20:51:57.333 22017-22029 mpanion.androi          pid-22017                            A  verification.cc:92] 0x71a2d20c80 region space live bitmap[begin=0x12c00000,end=0x42c00000]
2022-11-09 20:51:57.333 22017-22029 mpanion.androi          pid-22017                            A  verification.cc:92] 0x71a2d20c80 region space live bitmap[begin=0x12c00000,end=0x42c00000]


2022-11-09 20:51:57.334 22017-22029 mpanion.androi          pid-22017                            A  verification.cc:92] 0x71a2c55480 free list large object space - begin: 0x78bf7000 end: 0x98bf7000
2022-11-09 20:51:57.334 22017-22029 mpanion.androi          pid-22017                            A  verification.cc:92] Large object at address: 0x78bf7000 of length 20480 bytes
2022-11-09 20:51:57.334 22017-22029 mpanion.androi          pid-22017                            A  verification.cc:92] Large object at address: 0x78bfc000 of length 24576 bytes
2022-11-09 20:51:57.334 22017-22029 mpanion.androi          pid-22017                            A  verification.cc:92] Large object at address: 0x78c02000 of length 20480 bytes
2022-11-09 20:51:57.334 22017-22029 mpanion.androi          pid-22017                            A  verification.cc:92] Large object at address: 0x78c07000 of length 45056 bytes
2022-11-09 20:51:57.334 22017-22029 mpanion.androi          pid-22017                            A  verification.cc:92] Large object at address: 0x78c12000 of length 61440 bytes
2022-11-09 20:51:57.334 22017-22029 mpanion.androi          pid-22017                            A  verification.cc:92] Large object at address: 0x78c21000 of length 28672 bytes
2022-11-09 20:51:57.334 22017-22029 mpanion.androi          pid-22017                            A  verification.cc:92] Large object at address: 0x78c28000 of length 24576 bytes

2022-11-09 20:51:58.409 22242-22242 DEBUG                   pid-22242                            A  *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
2022-11-09 20:51:58.410 22242-22242 DEBUG                   pid-22242                            A  Build fingerprint: 'HUAWEI/EML-L29/HWEML:10/HUAWEIEML-L29/10.0.0.171C432:user/release-keys'
2022-11-09 20:51:58.410 22242-22242 DEBUG                   pid-22242                            A  Revision: '0'
2022-11-09 20:51:58.410 22242-22242 DEBUG                   pid-22242                            A  ABI: 'arm64'
2022-11-09 20:51:58.410 22242-22242 DEBUG                   pid-22242                            A  Timestamp: 2022-11-09 20:51:58+0100
2022-11-09 20:51:58.410 22242-22242 DEBUG                   pid-22242                            A  pid: 22017, tid: 22029, name: HeapTaskDaemon  >>> io.homeassistant.companion.android <<<
2022-11-09 20:51:58.410 22242-22242 DEBUG                   pid-22242                            A  uid: 10309
2022-11-09 20:51:58.411 22242-22242 DEBUG                   pid-22242                            A  signal 6 (SIGABRT), code -1 (SI_QUEUE), fault addr --------
2022-11-09 20:51:58.411 22242-22242 DEBUG                   pid-22242                            A  Abort message: 'logging.cc:172] 12c00000-16740000 rw-p 00000000 00:00 0                                  [anon:dalvik-main space (region space)]'
2022-11-09 20:51:58.411 22242-22242 DEBUG                   pid-22242                            A      x0  0000000000000000  x1  000000000000560d  x2  0000000000000006  x3  0000007191bfa540
2022-11-09 20:51:58.411 22242-22242 DEBUG                   pid-22242                            A      x4  0000000000000000  x5  0000000000000000  x6  0000000000000000  x7  7f7f7f7f7f7f7f7f
2022-11-09 20:51:58.411 22242-22242 DEBUG                   pid-22242                            A      x8  00000000000000f0  x9  5edd818dd32faf3f  x10 0000000000000001  x11 0000000000000000
2022-11-09 20:51:58.411 22242-22242 DEBUG                   pid-22242                            A      x12 fffffff0fffffbdf  x13 0000000000000002  x14 0000000000000004  x15 00000e352fcaa15b
2022-11-09 20:51:58.411 22242-22242 DEBUG                   pid-22242                            A      x16 00000072250e2a08  x17 00000072250c27c0  x18 000000713ea9e000  x19 0000000000005601
2022-11-09 20:51:58.411 22242-22242 DEBUG                   pid-22242                            A      x20 000000000000560d  x21 00000000ffffffff  x22 0000007195c3e0f0  x23 000000000000006b
2022-11-09 20:51:58.411 22242-22242 DEBUG                   pid-22242                            A      x24 0000007191bfc020  x25 000000000000000a  x26 000000722837c258  x27 00000071a2bca000
2022-11-09 20:51:58.411 22242-22242 DEBUG                   pid-22242                            A      x28 0000007191bfc020  x29 0000007191bfa5e0
2022-11-09 20:51:58.411 22242-22242 DEBUG                   pid-22242                            A      sp  0000007191bfa520  lr  0000007225077640  pc  000000722507766c

without seeing the actual crash we won’t be able to solve the issue, if you do not see a Recent Crash tab then we will need to use an app like Logcat Reader which requires special USB permissions and then we can see the crash.

Well, that’s what puzzles me too: there is no crash to be found in logcat…

the recent crash tab is not guaranteed to show up, you will need to refer to my previous comment about what other methods there are to get logcat.

Thank you for replying.

I think we misunderstood each other.
The logs I posted are coming from logcat in Android Studio.

oh ok, then please remove any filtering you are doing to look for the crash, it will definitely be there but usually filtering by homeassistant hides the actual error as it may originate from another location.

I have the full log in a txt file on my home computer. I’ll try to upload it when I get home.

This is a link to the debug file. I haven’t been able to find an error.

have you tried the start fresh steps? I dont quite see the cause for the crash but good to rule out bad data issue.

Thanks for looking into it.
I did so before this log. Wanted to rule out every possibility.