Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Application stuck at splash screen on a Xiaomi Mi Max 3 #475

Closed
MrCsabaToth opened this issue Jan 2, 2024 · 9 comments
Closed

Application stuck at splash screen on a Xiaomi Mi Max 3 #475

MrCsabaToth opened this issue Jan 2, 2024 · 9 comments
Assignees
Labels
bug Something isn't working

Comments

@MrCsabaToth
Copy link
Member

More details: Xiaomi Mi Max 3 (MIUI 11, Android 10).
Not sure if custom ROM or not.
Since the app doesn't start at all, there's no application specific log.
Ati extracted a Logcat, which shows an insane flood of some system component: looks like most probably the hwservicemanager tries to perform a schema and database migration, and it fails at the 24th step of 27, and it gets into an endless loop logging every single millisecond!

[ 01-01 11:50:07.696 556: 556 I/hwservicemanager ]
getTransport: Cannot find entry vendor.qti.hardware.servicetracker@1.0::IServicetracker/default in either framework or device manifest.
[ 01-01 11:50:07.701 556: 556 I/hwservicemanager ]
getTransport: Cannot find entry vendor.qti.hardware.servicetracker@1.0::IServicetracker/default in either framework or device manifest.
[ 01-01 11:50:07.701 3444: 3444 D/BoundBrokerSvc ]
onUnbind: Intent { act=com.google.android.gms.safetynet.service.START pkg=com.google.android.gms }
[ 01-01 11:50:08.553 22606:22606 I/CloudDatabaseHelper ]
Upgrading database from version 1 to 27
[ 01-01 11:50:08.554 22606:22606 I/CloudDatabaseHelper ]
Upgrading database from version 2 to 27
[ 01-01 11:50:08.555 22606:22606 I/CloudDatabaseHelper ]
Upgrading database from version 3 to 27
[ 01-01 11:50:08.555 22606:22606 I/CloudDatabaseHelper ]
Upgrading database from version 4 to 27
[ 01-01 11:50:08.555 22606:22606 I/CloudDatabaseHelper ]
Upgrading database from version 5 to 27
[ 01-01 11:50:08.556 22606:22606 I/CloudDatabaseHelper ]
Upgrading database from version 6 to 27
[ 01-01 11:50:08.557 22606:22606 I/CloudDatabaseHelper ]
Upgrading database from version 7 to 27
[ 01-01 11:50:08.557 22606:22606 I/CloudDatabaseHelper ]
Upgrading database from version 8 to 27
[ 01-01 11:50:08.557 22606:22606 I/CloudDatabaseHelper ]
Upgrading database from version 9 to 27
[ 01-01 11:50:08.558 22606:22606 I/CloudDatabaseHelper ]
Upgrading database from version 10 to 27
[ 01-01 11:50:08.560 22606:22606 I/CloudDatabaseHelper ]
Upgrading database from version 11 to 27
[ 01-01 11:50:08.562 22606:22606 I/CloudDatabaseHelper ]
Upgrading database from version 12 to 27
[ 01-01 11:50:08.562 22606:22606 I/CloudDatabaseHelper ]
Upgrading database from version 13 to 27
[ 01-01 11:50:08.563 22606:22606 I/CloudDatabaseHelper ]
Upgrading database from version 14 to 27
[ 01-01 11:50:08.565 22606:22606 I/CloudDatabaseHelper ]
Upgrading database from version 15 to 27
[ 01-01 11:50:08.566 22606:22606 I/CloudDatabaseHelper ]
Upgrading database from version 16 to 27
[ 01-01 11:50:08.568 22606:22606 I/CloudDatabaseHelper ]
Upgrading database from version 17 to 27
[ 01-01 11:50:08.568 22606:22606 I/CloudDatabaseHelper ]
Upgrading database from version 18 to 27
[ 01-01 11:50:08.568 22606:22606 I/CloudDatabaseHelper ]
Upgrading database from version 19 to 27
[ 01-01 11:50:08.568 22606:22606 I/CloudDatabaseHelper ]
Upgrading database from version 20 to 27
[ 01-01 11:50:08.569 22606:22606 I/CloudDatabaseHelper ]
Upgrading database from version 21 to 27
[ 01-01 11:50:08.572 22606:22606 I/CloudDatabaseHelper ]
Upgrading database from version 22 to 27
[ 01-01 11:50:08.572 22606:22606 I/CloudDatabaseHelper ]
Upgrading database from version 23 to 27
[ 01-01 11:50:08.573 22606:22606 I/CloudDatabaseHelper ]
Upgrading database from version 24 to 27
[ 01-01 11:50:08.573 22606:22606 E/SQLiteLog ]
(1) duplicate column name: type
[ 01-01 11:50:08.573 22606:22606 E/CloudDatabaseHelper ]
duplicate column name: type (code 1 SQLITE_ERROR): , while compiling: ALTER TABLE ThermalInfo ADD COLUMN type TEXT
[ 01-01 11:50:08.574 22606:22606 E/CloudDatabaseHelper ]
Upgrade database to version 27 fails
[ 01-01 11:50:08.574 22606:22606 I/CloudDatabaseHelper ]
isValidDatabase: false
[ 01-01 11:50:08.577 22606:22606 E/SQLiteHelper ]
Try to getWritableDatabase again
[ 01-01 11:50:08.579 22606:22606 I/CloudDatabaseHelper ]
Upgrading database from version 0 to 27
[ 01-01 11:50:08.579 22606:22606 I/CloudDatabaseHelper ]
Upgrading database from version 0 to 27, which will destroy all old data
[ 01-01 11:50:08.582 22606:22606 I/CloudDatabaseHelper ]
Upgrading database from version 1 to 27
[ 01-01 11:50:08.584 22606:22606 I/CloudDatabaseHelper ]
Upgrading database from version 2 to 27
[ 01-01 11:50:08.584 22606:22606 I/CloudDatabaseHelper ]
Upgrading database from version 3 to 27
[ 01-01 11:50:08.584 22606:22606 I/CloudDatabaseHelper ]
Upgrading database from version 4 to 27
[ 01-01 11:50:08.585 22606:22606 I/CloudDatabaseHelper ]
Upgrading database from version 5 to 27
[ 01-01 11:50:08.585 22606:22606 I/CloudDatabaseHelper ]
Upgrading database from version 6 to 27
[ 01-01 11:50:08.586 22606:22606 I/CloudDatabaseHelper ]
Upgrading database from version 7 to 27
[ 01-01 11:50:08.587 22606:22606 I/CloudDatabaseHelper ]
Upgrading database from version 8 to 27
[ 01-01 11:50:08.587 22606:22606 I/CloudDatabaseHelper ]
Upgrading database from version 9 to 27
[ 01-01 11:50:08.587 22606:22606 I/CloudDatabaseHelper ]
Upgrading database from version 10 to 27
[ 01-01 11:50:08.590 22606:22606 I/CloudDatabaseHelper ]
Upgrading database from version 11 to 27
[ 01-01 11:50:08.591 22606:22606 I/CloudDatabaseHelper ]
Upgrading database from version 12 to 27
[ 01-01 11:50:08.591 22606:22606 I/CloudDatabaseHelper ]
Upgrading database from version 13 to 27
[ 01-01 11:50:08.593 22606:22606 I/CloudDatabaseHelper ]
Upgrading database from version 14 to 27
[ 01-01 11:50:08.595 22606:22606 I/CloudDatabaseHelper ]
Upgrading database from version 15 to 27
[ 01-01 11:50:08.596 22606:22606 I/CloudDatabaseHelper ]
Upgrading database from version 16 to 27
[ 01-01 11:50:08.597 22606:22606 I/CloudDatabaseHelper ]
Upgrading database from version 17 to 27
[ 01-01 11:50:08.597 22606:22606 I/CloudDatabaseHelper ]
Upgrading database from version 18 to 27
[ 01-01 11:50:08.597 22606:22606 I/CloudDatabaseHelper ]
Upgrading database from version 19 to 27
[ 01-01 11:50:08.597 22606:22606 I/CloudDatabaseHelper ]
Upgrading database from version 20 to 27
[ 01-01 11:50:08.598 22606:22606 I/CloudDatabaseHelper ]
Upgrading database from version 21 to 27
[ 01-01 11:50:08.601 22606:22606 I/CloudDatabaseHelper ]
Upgrading database from version 22 to 27
[ 01-01 11:50:08.601 22606:22606 I/CloudDatabaseHelper ]
Upgrading database from version 23 to 27
[ 01-01 11:50:08.602 22606:22606 I/CloudDatabaseHelper ]
Upgrading database from version 24 to 27
[ 01-01 11:50:08.602 22606:22606 E/SQLiteLog ]
(1) duplicate column name: type
[ 01-01 11:50:08.602 22606:22606 E/CloudDatabaseHelper ]
duplicate column name: type (code 1 SQLITE_ERROR): , while compiling: ALTER TABLE ThermalInfo ADD COLUMN type TEXT
[ 01-01 11:50:08.602 22606:22606 E/CloudDatabaseHelper ]
Upgrade database to version 27 fails
[ 01-01 11:50:08.603 22606:22606 I/CloudDatabaseHelper ]
isValidDatabase: false
[ 01-01 11:50:08.605 22606:22606 E/SQLiteHelper ]
Try to getWritableDatabase again
[ 01-01 11:50:08.607 22606:22606 I/CloudDatabaseHelper ]
Upgrading database from version 0 to 27

And so on and on. However this is possibly not relevant to our problem, it just makes the read of the LogCat hard.

@MrCsabaToth MrCsabaToth added the bug Something isn't working label Jan 2, 2024
@MrCsabaToth
Copy link
Member Author

MrCsabaToth commented Jan 2, 2024

LogCat: logcat.txt.bz2.zip
(used zip but with the bzip2 compression algorithm: zip -Zb -9 logcat.txt.bz2.zip logcat.txt
The file is UTF-16 encoded. I'll attach UTF-8 later.

@MrCsabaToth
Copy link
Member Author

MrCsabaToth commented Jan 2, 2024

Pastebin (truncated UTF-8 encoded, dos2unix treated (CRLF -> LF)): https://pastebin.com/F3v0Cha7
(UTF-16 to UTF-8 encoding: https://stackoverflow.com/questions/17287713/using-iconv-to-convert-from-utf-16le-to-utf-8)

@MrCsabaToth
Copy link
Member Author

@MrCsabaToth
Copy link
Member Author

MrCsabaToth commented Jan 3, 2024

Questions:

  1. Does the phone has enough storage space?
  2. Is the Bluetooth enabled?
  3. Does TMIW have BT / location permissions? (Newer Android versions even remove it automatically after some non-use, I'm not sure if Android 10 does that but the app was dormant for more than half a year)?
  4. What was the old app version?
  5. What is the new version, was it upgraded? This is interesting to know because it may mean a SQLite -> Isar database migration. (But that's not the SQLite flood in the logs).

From the logs it seems that the Bluetooth scan got kicked off from the app, and the scanning is ongoing. There could be some permissions missing though. But the scanning should happen only after the initialization is over and the app is on the Find Devices starting screen and not on the splash screen.

@MrCsabaToth
Copy link
Member Author

Possibly I'll release a custom APK build to Ati. The main modification would be to add many log statements which made it to the LogCat and help to determine what is really going on during the initialization.

There's a package https://pub.dev/packages/logging_to_logcat, however I don't think it's even needed. According to https://stackoverflow.com/questions/58906977/flutter-app-print-statements-will-not-show-up-in-adb-logcat I'd need to just use regular log statements and those supposed to make it to the LogCat:

import 'dart:developer';
log('My Message');

@MrCsabaToth
Copy link
Member Author

MrCsabaToth commented Jan 10, 2024

Hmmm, apparently 3 years ago we had the same problem: #120

I wonder if this is a regression, we really need to check those permissions. I don't see the same exception in the logcat tho.

MrCsabaToth added a commit that referenced this issue Jan 15, 2024
(I'll build an apk for Ati)
@MrCsabaToth
Copy link
Member Author

I opened a feature branch:

  1. Extra logging sparkled in the main.dart initialization code area
  2. The LoggingService's log facility is also logging with dart:develop's log instead of debugLog and doesn't manipulate the Isar Logging tables

Release build: https://drive.google.com/file/d/1-e63W5Lvtg2fg8sLvaiRrn3UquAOXs9M/view?usp=drive_link
Debug build: https://drive.google.com/file/d/16sNY7D8f5GiSVahs-hHKAmNrE0BnN5yw/view?usp=drive_link

@MrCsabaToth
Copy link
Member Author

MrCsabaToth commented Jan 21, 2024

With custom APKs I built Ati was not able to reproduce the issue. So it's a mystery so far.

@MrCsabaToth
Copy link
Member Author

Ati also tried the stock beta install and that works now again. I wonder what was the cause. It couldn't be the Floor -> Isar migration (#269 #422), maybe the getApplicationDocumentsDirectory didn't work in the main.dart? Because if the migration is happening that kicks in on the Find Devices (scan) page, and an undismissable overlay shows the progress of it. The app got stuck before navigating to the scan page. I'll reopen this if we can reproduce.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants