question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

IllegalStateException: Fragment HomeFragment not attached to a context.

See original GitHub issue

https://sentry.prod.mozaws.net/operations/fenix-nightly/issues/6162466/ https://sentry.prod.mozaws.net/operations/fenix-nightly/issues/6162466/ Socorro link

IllegalStateException: Fragment HomeFragment{1a41004} (84c6a2c6-6203-448c-b564-fee8f55208fc)} not attached to a context.
    at androidx.fragment.app.Fragment.requireContext(Fragment.java:2)
    at androidx.fragment.app.Fragment.getResources(Fragment.java:1)
    at org.mozilla.fenix.home.HomeFragment$onViewCreated$2.invokeSuspend(HomeFragment.kt:9)
    at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:2)
    at kotlinx.coroutines.DispatchedTask.run(Dispatched.kt:15)
...
(2 additional frame(s) were not displayed)

Fragment HomeFragment{1a41004} (84c6a2c6-6203-448c-b564-fee8f55208fc)} not attached to a context.

┆Issue is synchronized with this Jira Task

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:15 (14 by maintainers)

github_iconTop GitHub Comments

1reaction
severinrudiecommented, Jan 8, 2020

Note to QA: this is a very rare crash, and I don’t think we’re going to be able to reproduce it. I’m also very confident in the fix. If you don’t mind, I think it’s safe can call this qa-not-needed.

0reactions
sfloreancommented, Jul 17, 2020

@ekager sorry for the late reply here! Tested with the same device on Nightly 7/16 and on 79.0.0-beta.7 and the issue isn’t reproducible anymore.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Fragment not attached to a context - android - Stack Overflow
In my case, this problem occurred when I was calling getString(). changing this calls to getActivity().getString() solved the problem.
Read more >
Android Fragment not attached to a context | by Weidian Huang
This is a common issue if we don't take care of it in our application, and it is difficult to catch the issue...
Read more >
I Get Fragment Not Attached To A Context. What ... - ADocLib
This issue occurs whenever you call a context which is unavailable or null when you call it. This can be a situation when...
Read more >
java.lang.IllegalStateException: Fragment not attached to Activity
IllegalStateException : Fragment not attached to Activity [ Beautify Your Computer : https://www.hows.tech/p/recommended.html ] Android :...
Read more >
IllegalStateException Fragment
IllegalStateException : Fragment HomeFragment {32dd527} (861da8e7-151f-4367-9f5a-af37c10c6e3b)} not attached to a context. FATAL EXCEPTION : main Process ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found