1

I have an app I'm developing that appears to be working pretty well except for one problem. It keeps crashing on a physical S9+ device.

The app emulates as expected on emulation devices running API28, 29, and higher. The s9+ is running Android 10, which is API29. There was a point in time where it was running on the S9+ but no longer. I had been testing the app on the emulators and only occasionally running them on some phones - in particular the S9+ in question and an S22. It works as expected on the S22. At some point, I added something to the code or did something somewhere that the phone doesn't like.

It has something to do with Room Database, but I can't figure out what. Each time I try to run the app on the phone, I make sure that it has been uninstalled first. Once studio installs the app, it starts up briefly - the first screen comes up for enough time to recognize it - but then crashes

here is the logcat...

2023-05-01 13:08:20.088 24190-24190 studio.deploy           pid-24190                            E  Could not get package user id: /system/bin/run-as: unknown package: com.viccruzr.handnotes
2023-05-01 13:08:20.147 24190-24190 studio.deploy           pid-24190                            E  Could not find apks for this package: com.viccruzr.handnotes
---------------------------- PROCESS STARTED (24349) for package com.viccruzr.handnotes ----------------------------
2023-05-01 13:08:25.622 24349-24349 Process                 com.viccruzr.handnotes          I  Sending signal. PID: 24349 SIG: 9
2023-05-01 13:08:25.755  1342-1342  SDAgentPac...teReceiver pid-1342                             E  Not going to handle 'com.viccruzr.handnotes'!
---------------------------- PROCESS ENDED (24349) for package com.viccruzr.handnotes ----------------------------
---------------------------- PROCESS STARTED (24715) for package com.viccruzr.handnotes ----------------------------
2023-05-01 13:08:26.200 24715-24715 Zygote                  com.viccruzr.handnotes          E  isWhitelistProcess - Process is Whitelisted
2023-05-01 13:08:26.202 24715-24715 Zygote                  com.viccruzr.handnotes          E  accessInfo : 1
2023-05-01 13:08:26.220 24715-24715 .handnote          com.viccruzr.handnotes          I  Late-enabling -Xcheck:jni
2023-05-01 13:08:26.245 24715-24715 .handnote          com.viccruzr.handnotes          E  Unknown bits set in runtime_flags: 0x8000
2023-05-01 13:08:26.264 24715-24715 ActivityThread          com.viccruzr.handnotes          D  setConscryptValidator
2023-05-01 13:08:26.264 24715-24715 ActivityThread          com.viccruzr.handnotes          D  setConscryptValidator - put
2023-05-01 13:08:26.840 24715-24715 AppCompatDelegate       com.viccruzr.handnotes          D  Checking for metadata for AppLocalesMetadataHolderService : Service not found
2023-05-01 13:08:27.054 24715-24715 .handnote          com.viccruzr.handnotes          W  Accessing hidden method Landroid/view/View;->computeFitSystemWindows(Landroid/graphics/Rect;Landroid/graphics/Rect;)Z (greylist, reflection, allowed)
2023-05-01 13:08:27.214 24715-24715 System.out              com.viccruzr.handnotes          I  MainStart: numSession = 0
2023-05-01 13:08:27.214 24715-24715 System.out              com.viccruzr.handnotes          I  preferencesSessionNum = 7
2023-05-01 13:08:27.214 24715-24715 System.out              com.viccruzr.handnotes          I  _year = 2023
2023-05-01 13:08:27.214 24715-24715 System.out              com.viccruzr.handnotes          I  _month = 0
2023-05-01 13:08:27.214 24715-24715 System.out              com.viccruzr.handnotes          I  _day = 1
2023-05-01 13:08:27.214 24715-24715 System.out              com.viccruzr.handnotes          I  preferencesDateYear = 2023
2023-05-01 13:08:27.214 24715-24715 System.out              com.viccruzr.handnotes          I  preferencesDateMonth = 0
2023-05-01 13:08:27.214 24715-24715 System.out              com.viccruzr.handnotes          I  preferencesDateDay = 1
2023-05-01 13:08:27.214 24715-24715 System.out              com.viccruzr.handnotes          I  preferencesSessionNum = 7
2023-05-01 13:08:27.215 24715-24715 System.out              com.viccruzr.handnotes          I  numSession = 7
2023-05-01 13:08:27.215 24715-24715 System.out              com.viccruzr.handnotes          I  numSessionsShow = 1
2023-05-01 13:08:27.215 24715-24715 System.out              com.viccruzr.handnotes          I  getNumHands = null
2023-05-01 13:08:27.223 24715-24715 PhoneWindow             com.viccruzr.handnotes          D  forceLight changed to true [] from com.android.internal.policy.PhoneWindow.updateForceLightNavigationBar:4274 com.android.internal.policy.DecorView.updateColorViews:1547 com.android.internal.policy.PhoneWindow.dispatchWindowAttributesChanged:3252 android.view.Window.setFlags:1153 com.android.internal.policy.PhoneWindow.generateLayout:2474 
2023-05-01 13:08:27.224 24715-24715 MultiWindowDecorSupport com.viccruzr.handnotes          I  [INFO] isPopOver = false
2023-05-01 13:08:27.224 24715-24715 MultiWindowDecorSupport com.viccruzr.handnotes          I  updateCaptionType >> DecorView@973adfb[], isFloating: false, isApplication: true, hasWindowDecorCaption: false, hasWindowControllerCallback: true
2023-05-01 13:08:27.224 24715-24715 MultiWindowDecorSupport com.viccruzr.handnotes          D  setCaptionType = 0, DecorView = DecorView@973adfb[]
2023-05-01 13:08:27.233 24715-24715 .handnote          com.viccruzr.handnotes          W  Accessing hidden method Landroid/view/ViewGroup;->makeOptionalFitsSystemWindows()V (greylist, reflection, allowed)
2023-05-01 13:08:27.265 24715-24715 ViewRootIm...nActivity] com.viccruzr.handnotes          I  setView = com.android.internal.policy.DecorView@973adfb TM=true MM=false
2023-05-01 13:08:27.357 24715-24715 ViewRootIm...nActivity] com.viccruzr.handnotes          I  Relayout returned: old=(0,0,1440,2960) new=(0,0,1440,2960) req=(1440,2960)0 dur=9 res=0x7 s={true 481811505152} ch=true
2023-05-01 13:08:27.358 24715-24986 AdrenoGLES              com.viccruzr.handnotes          I  QUALCOMM build                   : fdd61e0, I20154638fb
                                                                                                    Build Date                       : 10/07/20
                                                                                                    OpenGL ES Shader Compiler Version: EV031.27.05.01
                                                                                                    Local Branch                     : 
                                                                                                    Remote Branch                    : refs/tags/AU_LINUX_ANDROID_LA.UM.8.3.R1.10.00.00.520.058
                                                                                                    Remote Branch                    : NONE
                                                                                                    Reconstruct Branch               : NOTHING
2023-05-01 13:08:27.358 24715-24986 AdrenoGLES              com.viccruzr.handnotes          I  Build Config                     : S P 8.0.11 AArch64
2023-05-01 13:08:27.361 24715-24986 AdrenoGLES              com.viccruzr.handnotes          I  PFP: 0x016ee187, ME: 0x00000000
2023-05-01 13:08:27.393 24715-24986 Gralloc3                com.viccruzr.handnotes          W  mapper 3.x is not supported
2023-05-01 13:08:27.460 24715-24715 ViewRootIm...nActivity] com.viccruzr.handnotes          I  MSG_WINDOW_FOCUS_CHANGED 1 1
2023-05-01 13:08:27.461 24715-24715 InputMethodManager      com.viccruzr.handnotes          D  prepareNavigationBarInfo() DecorView@973adfb[MainActivity]
2023-05-01 13:08:27.461 24715-24715 InputMethodManager      com.viccruzr.handnotes          D  getNavigationBarColor() -855310
2023-05-01 13:08:27.463 24715-24715 InputMethodManager      com.viccruzr.handnotes          D  prepareNavigationBarInfo() DecorView@973adfb[MainActivity]
2023-05-01 13:08:27.463 24715-24715 InputMethodManager      com.viccruzr.handnotes          D  getNavigationBarColor() -855310
2023-05-01 13:08:27.463 24715-24715 InputMethodManager      com.viccruzr.handnotes          V  Starting input: tba=com.viccruzr.handnotes ic=null mNaviBarColor -855310 mIsGetNaviBarColorSuccess true , NavVisible : true , NavTrans : false
2023-05-01 13:08:27.463 24715-24715 InputMethodManager      com.viccruzr.handnotes          D  startInputInner - Id : 0
2023-05-01 13:08:27.463 24715-24715 InputMethodManager      com.viccruzr.handnotes          I  startInputInner - mService.startInputOrWindowGainedFocus
2023-05-01 13:08:27.479 24715-24715 ViewRootIm...nActivity] com.viccruzr.handnotes          I  MSG_RESIZED: frame=(0,0,1440,2960) ci=(0,84,0,168) vi=(0,84,0,168) or=1
2023-05-01 13:08:27.481 24715-24715 InputMethodManager      com.viccruzr.handnotes          D  prepareNavigationBarInfo() DecorView@973adfb[MainActivity]
2023-05-01 13:08:27.481 24715-24715 InputMethodManager      com.viccruzr.handnotes          D  getNavigationBarColor() -855310
2023-05-01 13:08:27.482 24715-24715 InputMethodManager      com.viccruzr.handnotes          V  Starting input: tba=com.viccruzr.handnotes ic=null mNaviBarColor -855310 mIsGetNaviBarColorSuccess true , NavVisible : true , NavTrans : false
2023-05-01 13:08:27.482 24715-24715 InputMethodManager      com.viccruzr.handnotes          D  startInputInner - Id : 0
2023-05-01 13:08:27.531  1342-1492  WindowManager           pid-1342                             E  win=Window{8df1c47 u0 Splash Screen com.viccruzr.handnotes EXITING} destroySurfaces: appStopped=false win.mWindowRemovalAllowed=true win.mRemoveOnExit=true win.mViewVisibility=0 caller=com.android.server.wm.AppWindowToken.destroySurfaces:1249 com.android.server.wm.AppWindowToken.destroySurfaces:1230 com.android.server.wm.WindowState.onExitAnimationDone:5189 com.android.server.wm.WindowStateAnimator.onAnimationFinished:320 com.android.server.wm.WindowState.onAnimationFinished:5630 com.android.server.wm.-$$Lambda$yVRF8YoeNdTa8GR1wDStVsHu8xM.run:2 com.android.server.wm.SurfaceAnimator.lambda$getFinishedCallback$0$SurfaceAnimator:100 
2023-05-01 13:08:27.770 24715-25080 AndroidRuntime          com.viccruzr.handnotes          E  FATAL EXCEPTION: arch_disk_io_2
                                                                                                    Process: com.viccruzr.handnotes, PID: 24715
                                                                                                    java.lang.RuntimeException: Exception while computing database live data.
                                                                                                        at androidx.room.RoomTrackingLiveData.refreshRunnable$lambda$0(RoomTrackingLiveData.kt:74)
                                                                                                        at androidx.room.RoomTrackingLiveData.$r8$lambda$PhMGW5zFk4QWazERd2lfEeLZqW0(Unknown Source:0)
                                                                                                        at androidx.room.RoomTrackingLiveData$$ExternalSyntheticLambda0.run(Unknown Source:2)
                                                                                                        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167)
                                                                                                        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641)
                                                                                                        at java.lang.Thread.run(Thread.java:919)
                                                                                                    Caused by: java.lang.IllegalStateException: Room cannot verify the data integrity. Looks like you've changed schema but forgot to update the version number. You can simply fix this by increasing the version number. Expected identity hash: ac55909e9937c122f6572345d6368644, found: 8d5dfeb213a352fae7e271364bcee2ed
                                                                                                        at androidx.room.RoomOpenHelper.checkIdentity(RoomOpenHelper.kt:147)
                                                                                                        at androidx.room.RoomOpenHelper.onOpen(RoomOpenHelper.kt:128)
                                                                                                        at androidx.sqlite.db.framework.FrameworkSQLiteOpenHelper$OpenHelper.onOpen(FrameworkSQLiteOpenHelper.kt:287)
                                                                                                        at android.database.sqlite.SQLiteOpenHelper.getDatabaseLocked(SQLiteOpenHelper.java:504)
                                                                                                        at android.database.sqlite.SQLiteOpenHelper.getWritableDatabase(SQLiteOpenHelper.java:391)
                                                                                                        at androidx.sqlite.db.framework.FrameworkSQLiteOpenHelper$OpenHelper.getWritableOrReadableDatabase(FrameworkSQLiteOpenHelper.kt:232)
                                                                                                        at androidx.sqlite.db.framework.FrameworkSQLiteOpenHelper$OpenHelper.innerGetDatabase(FrameworkSQLiteOpenHelper.kt:190)
                                                                                                        at androidx.sqlite.db.framework.FrameworkSQLiteOpenHelper$OpenHelper.getSupportDatabase(FrameworkSQLiteOpenHelper.kt:151)
                                                                                                        at androidx.sqlite.db.framework.FrameworkSQLiteOpenHelper.getWritableDatabase(FrameworkSQLiteOpenHelper.kt:104)
                                                                                                        at androidx.room.RoomDatabase.inTransaction(RoomDatabase.kt:638)
                                                                                                        at androidx.room.RoomDatabase.assertNotSuspendingTransaction(RoomDatabase.kt:457)
                                                                                                        at androidx.room.RoomDatabase.query(RoomDatabase.kt:486)
                                                                                                        at androidx.room.util.DBUtil.query(DBUtil.kt:75)
                                                                                                        at com.viccruzr.handnotes.data.HandsDao_Impl$25.call(HandsDao_Impl.java:3263)
                                                                                                        at com.viccruzr.handnotes.data.HandsDao_Impl$25.call(HandsDao_Impl.java:3260)
                                                                                                        at androidx.room.RoomTrackingLiveData.refreshRunnable$lambda$0(RoomTrackingLiveData.kt:72)
                                                                                                        at androidx.room.RoomTrackingLiveData.$r8$lambda$PhMGW5zFk4QWazERd2lfEeLZqW0(Unknown Source:0) 
                                                                                                        at androidx.room.RoomTrackingLiveData$$ExternalSyntheticLambda0.run(Unknown Source:2) 
                                                                                                        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167) 
                                                                                                        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641) 
                                                                                                        at java.lang.Thread.run(Thread.java:919) 
2023-05-01 13:08:27.797 24715-25080 Process                 com.viccruzr.handnotes          I  Sending signal. PID: 24715 SIG: 9
---------------------------- PROCESS ENDED (24715) for package com.viccruzr.handnotes ----------------------------
2023-05-01 13:08:27.843  1342-1835  InputDispatcher         pid-1342                             E  channel '1c29082 com.viccruzr.handnotes/com.viccruzr.handnotes.MainActivity (server)' ~ Channel is unrecoverably broken and will be disposed!
2023-05-01 13:08:27.874  1342-2317  WindowManager           pid-1342                             E  win=Window{1c29082 u0 com.viccruzr.handnotes/com.viccruzr.handnotes.MainActivity EXITING} destroySurfaces: appStopped=false win.mWindowRemovalAllowed=true win.mRemoveOnExit=true win.mViewVisibility=0 caller=com.android.server.wm.AppWindowToken.destroySurfaces:1249 com.android.server.wm.AppWindowToken.destroySurfaces:1230 com.android.server.wm.WindowState.onExitAnimationDone:5189 com.android.server.wm.-$$Lambda$01bPtngJg5AqEoOWfW3rWfV7MH4.accept:2 java.util.ArrayList.forEach:1262 com.android.server.wm.AppWindowToken.onAnimationFinished:3941 com.android.server.wm.AppWindowToken.commitVisibility:914 

The log states that it can't verify the data integrity and that increasing the version number should fix it. But it doesn't - I've tried that and also making sure that it is uninstalled prior to running it again.

edited to add... I dug out an old Samsung J7 phone running Android 7.0 and the app worked on that phone.

It seems like the database is still present on the phone but I don't know where it is at.

Vic.Cruzr
  • 11
  • 2

0 Answers0