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

App crash: NullPointerException #4146

Closed
OlehHaidaienko opened this issue Sep 27, 2022 · 7 comments
Closed

App crash: NullPointerException #4146

OlehHaidaienko opened this issue Sep 27, 2022 · 7 comments
Assignees

Comments

@OlehHaidaienko
Copy link

[REQUIRED] Step 2: Describe your environment

  • Android Studio version: Android Studio Dolphin | 2021.3.1
  • Firebase Component: Performance
  • Component version: 20.1.1

[REQUIRED] Step 3: Describe the problem

Steps to reproduce:

After updating Firebase BoM from 29.2.0 to 30.4.1 we started receiving a lot of crashes on Android 7, 8, and 9. Unfortunately, we can't reproduce this issue.

Here is the crash log

Caused by java.lang.NullPointerException: Attempt to invoke virtual method 'int java.util.ArrayList.size()' on a null object reference
       at android.view.View.findFrameMetricsObserver(View.java:6539)
       at android.view.View.removeFrameMetricsListener(View.java:6510)
       at android.view.Window.removeOnFrameMetricsAvailableListener(Window.java:886)
       at androidx.core.app.FrameMetricsAggregator$FrameMetricsApi24Impl.remove(FrameMetricsAggregator.java:433)
       at androidx.core.app.FrameMetricsAggregator.remove(FrameMetricsAggregator.java:243)
       at com.google.firebase.perf.application.FrameMetricsRecorder.stop(FrameMetricsRecorder.java:110)
       at com.google.firebase.perf.application.AppStateMonitor.sendScreenTrace(AppStateMonitor.java:355)
       at com.google.firebase.perf.application.AppStateMonitor.onActivityStopped(AppStateMonitor.java:210)
       at android.app.Application.dispatchActivityStopped(Application.java:257)
       at android.app.Activity.onStop(Activity.java:1914)
       at androidx.fragment.app.FragmentActivity.onStop(FragmentActivity.java:496)
       at androidx.appcompat.app.AppCompatActivity.onStop(AppCompatActivity.java:252)
       at com.fusionmedia.investing.ui.activities.base.BaseSplashActivity.onStop(BaseSplashActivity.java:922)
       at android.app.Instrumentation.callActivityOnStop(Instrumentation.java:1433)
       at android.app.Activity.performStop(Activity.java:7367)
       at android.app.ActivityThread.callActivityOnStop(ActivityThread.java:4146)
       at android.app.ActivityThread.performStopActivityInner(ActivityThread.java:4124)
       at android.app.ActivityThread.handleStopActivity(ActivityThread.java:4199)
       at android.app.servertransaction.TransactionExecutor.performLifecycleSequence(TransactionExecutor.java:192)
       at android.app.servertransaction.TransactionExecutor.cycleToPath(TransactionExecutor.java:165)
       at android.app.servertransaction.TransactionExecutor.executeLifecycleState(TransactionExecutor.java:142)
       at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:70)
       at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1811)
       at android.os.Handler.dispatchMessage(Handler.java:106)
       at android.os.Looper.loop(Looper.java:193)
       at android.app.ActivityThread.main(ActivityThread.java:6694)
       at java.lang.reflect.Method.invoke(Method.java)
       at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:493)
       at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:858)

BaseSplashActivity.java:922 looks like this:

@Override 
protected void onStop() {
    super.onStop() → Crash happens here
    ....
}

image

After rollback to Firebase BoM 29.2.0 issue is gone

@argzdev
Copy link
Contributor

argzdev commented Sep 27, 2022

Thanks for reporting, @OlehHaidaienko. I'll let our engineers know about this.

Just some notes, crash happened here:

@jeremyjiang-dev jeremyjiang-dev self-assigned this Sep 27, 2022
@jeremyjiang-dev
Copy link
Contributor

Could be related to b/133827763

@kimrtaylor
Copy link

kimrtaylor commented Oct 25, 2022

Just wanted to add that we are also experiencing this crash.

It looks like there are some PRs in progress

@argzdev Do we know yet if and when a fix wil be available? It would help us decide whether to rollback our firebase version, or hold off for the fix. Thanks a lot 🙏

@argzdev
Copy link
Contributor

argzdev commented Oct 25, 2022

Hi @kimrtaylor, upon checking, it looks like the PR is still in progress, and it may take some time before it is merged in the main branch. That said, once the fix is merged we would still expect this fix to be in the M124 release that is targeted for the week of Nov. 17 (around the third week).

Since there's still a long wait, I'd advise to rollback for now. Thanks!

@kimrtaylor
Copy link

Great that's exactly what we needed to know, thanks @argzdev , we will rollback while we wait for the fix

@leotianlizhan
Copy link
Contributor

Should be fixed in #4284, which is released in Firebase Performance 20.3.0, part of Firebase BOM 31.1.0.

@argzdev
Copy link
Contributor

argzdev commented Nov 29, 2022

Thanks for the update, @leotianlizhan. I'll close this now.

@argzdev argzdev closed this as completed Nov 29, 2022
@firebase firebase locked and limited conversation to collaborators Dec 30, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

6 participants