Open Vishwajith-Shettigar opened 5 months ago
@Vishwajith-Shettigar, could you also add a copy paste of the stacktrace from your logcat?
The crash path looks similar to what I found for this prod issue: https://github.com/oppia/oppia-android/issues/5451
@Vishwajith-Shettigar kindly also add device information to the issue
@adhiamboperes, done.
@Vishwajith-Shettigar Can I work on it?
@TanishMoral11 you can work on this.
Hi @Vishwajith-Shettigar
I have submitted a PR (#5561) that addresses this issue by ensuring proper initialization of state variables to prevent the crash. When you have a moment, could you please take a look and provide any feedback?
Thank you!
@TanishMoral11 please wait for @adhiamboperes review.
Describe the bug
The app crashes occasionally when the device is rotated during exploration.
The attached video shows the app crashing when the user rotates the device after selecting input. However, I later found that it crashes even without selecting input.
Steps To Reproduce
Open any lesson and rotate device.
Expected Behavior
The crash should not happen.
Screenshots/Videos
https://github.com/oppia/oppia-android/assets/76042077/8fb94b8a-447d-4b63-ab5d-02c2db1b513c
Device:
Android 10 Realme 3
Full stacktrace
``` --------- beginning of crash 2024-07-01 12:33:04.441 20689-20689/org.oppia.android E/AndroidRuntime: FATAL EXCEPTION: main Process: org.oppia.android, PID: 20689 kotlin.UninitializedPropertyAccessException: lateinit property state has not been initialized at org.oppia.android.app.player.audio.AudioViewModel.loadAudio(AudioViewModel.kt:91) at org.oppia.android.app.player.audio.AudioViewModel.loadMainContentAudio(AudioViewModel.kt:76) at org.oppia.android.app.player.audio.AudioFragmentPresenter.subscribeToAudioLanguageLiveData$lambda-3(AudioFragmentPresenter.kt:162) at org.oppia.android.app.player.audio.AudioFragmentPresenter.lambda$fdov4KnYyyWXrE4vXcM8K07F1xI(Unknown Source:0) at org.oppia.android.app.player.audio.-$$Lambda$AudioFragmentPresenter$fdov4KnYyyWXrE4vXcM8K07F1xI.onChanged(Unknown Source:4) at androidx.lifecycle.LiveData.considerNotify(LiveData.java:131) at androidx.lifecycle.LiveData.dispatchingValue(LiveData.java:149) at androidx.lifecycle.LiveData.setValue(LiveData.java:307) at androidx.lifecycle.MutableLiveData.setValue(MutableLiveData.java:50) at androidx.lifecycle.Transformations$1.onChanged(Transformations.java:76) at androidx.lifecycle.MediatorLiveData$Source.onChanged(MediatorLiveData.java:152) at androidx.lifecycle.LiveData.considerNotify(LiveData.java:131) at androidx.lifecycle.LiveData.dispatchingValue(LiveData.java:149) at androidx.lifecycle.LiveData.setValue(LiveData.java:307) at org.oppia.android.util.data.DataProviders$NotifiableAsyncLiveData.setValue(DataProviders.kt:405) at org.oppia.android.util.data.DataProviders$NotifiableAsyncLiveData.setValue(DataProviders.kt:354) at androidx.lifecycle.LiveData$1.run(LiveData.java:91) at android.os.Handler.handleCallback(Handler.java:883) at android.os.Handler.dispatchMessage(Handler.java:100) at android.os.Looper.loop(Looper.java:227) at android.app.ActivityThread.main(ActivityThread.java:7822) at java.lang.reflect.Method.invoke(Native Method) at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:492) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1026) 2024-07-01 12:33:04.447 1463-3711/? D/OppoDisplayPolicy: com.android.systemui, change system app cutoutMode: color always 2024-07-01 12:33:04.450 20689-21508/org.oppia.android D/FA: Event not sent since app measurement is disabled 2024-07-01 12:33:04.452 1816-16507/? D/Launcher.TouchInteractionService: onActiveNavBarRegionChanges: region = SkRegion((452,1432,612,1520)(618,1432,720,1520)) 2024-07-01 12:33:04.454 1463-1485/? V/WindowManager: adjustNotShowWallpaperByOppo: false 2024-07-01 12:33:04.456 1463-1485/? I/WindowManager: Screen frozen for +414ms due to Window{73c7261 u0 org.oppia.android/org.oppia.android.app.player.exploration.ExplorationActivity} 2024-07-01 12:33:04.477 6823-6823/? E/SubscriptionManagerWrapper: java.lang.NoSuchMethodException: android.telephony.SubscriptionManager.getActiveDataSubscriptionId [] 2024-07-01 12:33:04.482 1463-8237/? I/Process: ydh getFreeMemory tag = MemFree: 2024-07-01 12:33:04.482 1463-8237/? I/Process: ydh getFreeMemory tag = Buffers: 2024-07-01 12:33:04.482 1463-8237/? I/Process: ydh getFreeMemory tag = Cached: 2024-07-01 12:33:04.482 1463-8237/? I/Process: ydh getFreeMemory tag = IonTotalCache: 2024-07-01 12:33:04.482 1463-8237/? I/Process: ydh getFreeMemory val = 94000 2024-07-01 12:33:04.483 1463-8237/? I/Process: ydh getFreeMemory val = 47568 2024-07-01 12:33:04.483 1463-8237/? I/Process: ydh getFreeMemory val = 1262656 2024-07-01 12:33:04.483 1463-8237/? I/Process: ydh getFreeMemory val = 4716 2024-07-01 12:33:04.483 1463-8237/? E/Process: get_ion_cache_memory: Unable to open /d/ion/system_stats 2024-07-01 12:33:04.486 6823-6823/? I/Choreographer: Skipped 1 frames! The application may be doing too much work on its main thread. 2024-07-01 12:33:04.507 641-781/? I/hwcomposer: [OVL] (0) Overlay input(0) was used with queue previously 2024-07-01 12:33:04.507 641-781/? I/hwcomposer: [DBQ] (q2:0x726b66d300) Buffer queue is destroyed 2024-07-01 12:33:04.507 641-781/? I/hwcomposer: [DBQ] (q2:0x726b66d300) Free Slot(0), handle=0x726b651000, 4377600 -> 0 2024-07-01 12:33:04.514 1463-8237/? I/Process: ydh getFreeMemory tag = MemFree: 2024-07-01 12:33:04.514 1463-8237/? I/Process: ydh getFreeMemory tag = Buffers: 2024-07-01 12:33:04.514 1463-8237/? I/Process: ydh getFreeMemory tag = Cached: 2024-07-01 12:33:04.514 1463-8237/? I/Process: ydh getFreeMemory tag = IonTotalCache: 2024-07-01 12:33:04.514 1463-8237/? I/Process: ydh getFreeMemory val = 93376 2024-07-01 12:33:04.514 1463-8237/? I/Process: ydh getFreeMemory val = 47568 2024-07-01 12:33:04.514 1463-8237/? I/Process: ydh getFreeMemory val = 1262700 2024-07-01 12:33:04.514 1463-8237/? I/Process: ydh getFreeMemory val = 4536 2024-07-01 12:33:04.514 1463-8237/? E/Process: get_ion_cache_memory: Unable to open /d/ion/system_stats 2024-07-01 12:33:04.650 1463-8237/? W/ActivityTaskManager: Force finishing activity org.oppia.android/.app.player.exploration.ExplorationActivity 2024-07-01 12:33:04.650 1463-8237/? V/ColorZoomWindowManagerService: prepareZoomTransition: curStack=ActivityStack{68858ed stackId=864 type=standard mode=fullscreen visible=true translucent=true, 1 tasks} nextStackActivityStack{68858ed stackId=864 type=standard mode=fullscreen visible=true translucent=true, 1 tasks} 2024-07-01 12:33:04.650 1463-8236/? I/Process: ydh getFreeMemory tag = MemFree: 2024-07-01 12:33:04.650 1463-8236/? I/Process: ydh getFreeMemory tag = Buffers: 2024-07-01 12:33:04.650 1463-8236/? I/Process: ydh getFreeMemory tag = Cached: 2024-07-01 12:33:04.650 1463-8236/? I/Process: ydh getFreeMemory tag = IonTotalCache: 2024-07-01 12:33:04.650 1463-8236/? I/Process: ydh getFreeMemory val = 88988 2024-07-01 12:33:04.650 1463-8236/? I/Process: ydh getFreeMemory val = 47580 2024-07-01 12:33:04.650 1463-8236/? I/Process: ydh getFreeMemory val = 1263152 2024-07-01 12:33:04.650 1463-8236/? I/Process: ydh getFreeMemory val = 9440 2024-07-01 12:33:04.651 1463-8236/? E/Process: get_ion_cache_memory: Unable to open /d/ion/system_stats 2024-07-01 12:33:04.651 1463-8237/? D/PowerHalWrapper: