Skip to content
This repository has been archived by the owner on Jul 5, 2021. It is now read-only.

[Crash] TabTrayFragment.java line 195 #4942

Closed
shsu571 opened this issue Apr 29, 2020 · 4 comments · Fixed by #4946
Closed

[Crash] TabTrayFragment.java line 195 #4942

shsu571 opened this issue Apr 29, 2020 · 4 comments · Fixed by #4946
Labels
P0 you'd rather block the release for this Q-verified as is, it's verified

Comments

@shsu571
Copy link
Contributor

shsu571 commented Apr 29, 2020

Describe the bug
crashes 636 ; user affected 129

https://console.firebase.google.com/u/0/project/zerda-dcf76/crashlytics/app/android:org.mozilla.rocket/issues/844c4fc80faf3a0244a9d171894a7a23?time=last-seven-days&sessionId=5EA981D3019700013C95C76274423FEA_DNE_0_v2

Device info (please complete the following information):
螢幕快照 2020-04-29 下午9 56 18
螢幕快照 2020-04-29 下午9 56 24

This only happens on Version 2.1.16(19398)

@shsu571 shsu571 added the P0 you'd rather block the release for this label Apr 29, 2020
@cnevinc
Copy link
Contributor

cnevinc commented Apr 29, 2020

I've reproduced this issue twice

  1. Launch app without [Don't keep Activity]
  2. Open to Tab Tray
  3. Go to [System Settings] and enable [Don't keep Activity]
  4. Go back to FxLite in Recent Apps
  5. App crashes
2020-04-30 01:12:27.517 11356-11356/org.mozilla.rocket.debug.nechen E/AndroidRuntime: FATAL EXCEPTION: main
    Process: org.mozilla.rocket.debug.nechen, PID: 11356
    java.lang.RuntimeException: Unable to start activity ComponentInfo{org.mozilla.rocket.debug.nechen/org.mozilla.focus.activity.MainActivity}: java.lang.RuntimeException: Cannot create an instance of class org.mozilla.rocket.home.HomeViewModel
        at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2817)
        at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2892)
        at android.app.ActivityThread.-wrap11(Unknown Source:0)
        at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1593)
        at android.os.Handler.dispatchMessage(Handler.java:105)
        at android.os.Looper.loop(Looper.java:164)
        at android.app.ActivityThread.main(ActivityThread.java:6541)
        at java.lang.reflect.Method.invoke(Native Method)
        at com.android.internal.os.Zygote$MethodAndArgsCaller.run(Zygote.java:240)
        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:767)
     Caused by: java.lang.RuntimeException: Cannot create an instance of class org.mozilla.rocket.home.HomeViewModel
        at androidx.lifecycle.ViewModelProvider$NewInstanceFactory.create(ViewModelProvider.java:221)
        at androidx.lifecycle.ViewModelProvider.get(ViewModelProvider.java:187)
        at androidx.lifecycle.ViewModelProvider.get(ViewModelProvider.java:150)
        at org.mozilla.focus.tabs.tabtray.TabTrayFragment.onCreateView(TabTrayFragment.java:195)
        at androidx.fragment.app.Fragment.performCreateView(Fragment.java:2698)
        at androidx.fragment.app.FragmentStateManager.createView(FragmentStateManager.java:320)
        at androidx.fragment.app.FragmentManager.moveToState(FragmentManager.java:1187)
        at androidx.fragment.app.FragmentManager.moveToState(FragmentManager.java:1356)
        at androidx.fragment.app.FragmentManager.moveFragmentToExpectedState(FragmentManager.java:1434)
        at androidx.fragment.app.FragmentManager.moveToState(FragmentManager.java:1497)
        at androidx.fragment.app.FragmentManager.dispatchStateChange(FragmentManager.java:2625)
        at androidx.fragment.app.FragmentManager.dispatchActivityCreated(FragmentManager.java:2577)
        at androidx.fragment.app.FragmentController.dispatchActivityCreated(FragmentController.java:247)
        at androidx.fragment.app.FragmentActivity.onStart(FragmentActivity.java:541)
        at androidx.appcompat.app.AppCompatActivity.onStart(AppCompatActivity.java:201)
        at org.mozilla.focus.activity.MainActivity.onStart(MainActivity.kt:344)
        at android.app.Instrumentation.callActivityOnStart(Instrumentation.java:1333)
        at android.app.Activity.performStart(Activity.java:6992)
        at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2780)
        at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2892) 
        at android.app.ActivityThread.-wrap11(Unknown Source:0) 
        at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1593) 
        at android.os.Handler.dispatchMessage(Handler.java:105) 
        at android.os.Looper.loop(Looper.java:164) 
        at android.app.ActivityThread.main(ActivityThread.java:6541) 
        at java.lang.reflect.Method.invoke(Native Method) 
        at com.android.internal.os.Zygote$MethodAndArgsCaller.run(Zygote.java:240) 
        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:767) 
     Caused by: java.lang.InstantiationException: java.lang.Class<org.mozilla.rocket.home.HomeViewModel> has no zero argument constructor
        at java.lang.Class.newInstance(Native Method)
        at androidx.lifecycle.ViewModelProvider$NewInstanceFactory.create(ViewModelProvider.java:219)
        at androidx.lifecycle.ViewModelProvider.get(ViewModelProvider.java:187) 
        at androidx.lifecycle.ViewModelProvider.get(ViewModelProvider.java:150) 
        at org.mozilla.focus.tabs.tabtray.TabTrayFragment.onCreateView(TabTrayFragment.java:195) 
        at androidx.fragment.app.Fragment.performCreateView(Fragment.java:2698) 
        at androidx.fragment.app.FragmentStateManager.createView(FragmentStateManager.java:320) 
        at androidx.fragment.app.FragmentManager.moveToState(FragmentManager.java:1187) 
        at androidx.fragment.app.FragmentManager.moveToState(FragmentManager.java:1356) 
        at androidx.fragment.app.FragmentManager.moveFragmentToExpectedState(FragmentManager.java:1434) 
        at androidx.fragment.app.FragmentManager.moveToState(FragmentManager.java:1497) 
        at androidx.fragment.app.FragmentManager.dispatchStateChange(FragmentManager.java:2625) 
        at androidx.fragment.app.FragmentManager.dispatchActivityCreated(FragmentManager.java:2577) 
        at androidx.fragment.app.FragmentController.dispatchActivityCreated(FragmentController.java:247) 
        at androidx.fragment.app.FragmentActivity.onStart(FragmentActivity.java:541) 
        at androidx.appcompat.app.AppCompatActivity.onStart(AppCompatActivity.java:201) 
        at org.mozilla.focus.activity.MainActivity.onStart(MainActivity.kt:344) 
        at android.app.Instrumentation.callActivityOnStart(Instrumentation.java:1333) 
        at android.app.Activity.performStart(Activity.java:6992) 
        at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2780) 
        at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2892) 
        at android.app.ActivityThread.-wrap11(Unknown Source:0) 
        at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1593) 
        at android.os.Handler.dispatchMessage(Handler.java:105) 
        at android.os.Looper.loop(Looper.java:164) 
        at android.app.ActivityThread.main(ActivityThread.java:6541) 
        at java.lang.reflect.Method.invoke(Native Method) 
        at com.android.internal.os.Zygote$MethodAndArgsCaller.run(Zygote.java:240) 
        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:767) 

cnevinc added a commit that referenced this issue Apr 29, 2020
If we want to initialize HomeViewModel using the old method, the depedencies won't be ready so it'll choose the zero parameter constructor.
Since we use Dagger to inject HomeViewModel and its depedencies, we should do the same here.

The reason why previous versions won't crash is because HomeFragment will always be visible first.
But if we turn on "Don't keep activity" and resume the app while Tab Tray is previously showing, this trash will happen.
@benjamin-cheng
Copy link
Contributor

Update the 100% reproduce steps

  1. Open external link with FxLite
  2. Click the tab counter

@Daisy-pliu
Copy link
Contributor

Daisy-pliu commented Apr 30, 2020

verify: ✅
version : preview 19415 (2.1.16)
Test steps

  1. open external link with FxLite
  2. tap [tab tray]

result: see tab tray correctly

@Daisy-pliu Daisy-pliu added the Q-verified as is, it's verified label Apr 30, 2020
@Daisy-pliu
Copy link
Contributor

Daisy-pliu commented May 5, 2020

  • Immediate action: halted 2.1.16(19398) release ( Done on 4/29)
  • Follow up Measurement : check how many user affected in terms of severity and frequency (Done on 4/29)
  • Measurement leads to action: Hotfix (Done on 4/30)
  • Hotfix Timeline proposal (Done on 4/30)
  • Hotfix verification ( Done on 4/30, 4pm)
  • Start Hotfix release train (Done on 4/30, 7pm)

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
P0 you'd rather block the release for this Q-verified as is, it's verified
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants