TeamAmaze / TeamAmaze/AmazeFileManager

`IllegalStateException: FtpServerFragment not attached to an activity` on `FtpServerFragment#getMainActivity`

Open
#3,743 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

From-Email Issue-Bug
Dominant language
Kotlin
Stars
6.4k
Forks
1.7k
Avg merge
3d 9h
Merged PRs (30d)
1

Description

Issue explanation (write below this line)

Exception

  • App Name: Amaze File Manager
  • Package: com.amaze.filemanager
  • Version: 3.8.5
  • User Action: UI Error
  • Request: Application crash
  • OS: Linux Android 13 - 33
  • Device: OP4F0BL1
  • Model: CPH2207
  • Product: CPH2207
Crash log

java.lang.IllegalStateException: Fragment FtpServerFragment{94183e7}
(2b939be5-9617-41a2-82a5-172bae11938a) not attached to an activity.
at androidx.fragment.app.Fragment.requireActivity(Fragment.java:947)
at
com.amaze.filemanager.ui.fragments.FtpServerFragment.getMainActivity(FtpServerFragment.kt:124)
at
com.amaze.filemanager.ui.fragments.FtpServerFragment.changeFTPServerPort(FtpServerFragment.kt:819)
at
com.amaze.filemanager.ui.fragments.FtpServerFragment.onOptionsItemSelected$lambda-2(FtpServerFragment.kt:210)
at
com.amaze.filemanager.ui.fragments.FtpServerFragment.$r8$lambda$jRoZ5KTBulpvcdOCJln276agLXo(Unknown
Source:0)
at
com.amaze.filemanager.ui.fragments.FtpServerFragment$$ExternalSyntheticLambda4.onClick(Unknown
Source:2)
at
com.afollestad.materialdialogs.MaterialDialog.onClick(MaterialDialog.java:410)
at android.view.View.performClick(View.java:7558)
at android.view.View.performClickInternal(View.java:7534)
at android.view.View.-$$Nest$mperformClickInternal(Unknown Source:0)
at android.view.View$PerformClick.run(View.java:29661)
at android.os.Handler.handleCallback(Handler.java:942)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loopOnce(Looper.java:240)
at android.os.Looper.loop(Looper.java:351)
at android.app.ActivityThread.main(ActivityThread.java:8364)
at java.lang.reflect.Method.invoke(Native Method)
at
com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:584)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1013)


sal

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start in FtpServerFragment.kt at getMainActivity (line 124), then trace changeFTPServerPort (line 819) and the onOptionsItemSelected callback (line 210) shown in the stack trace. Determine how the dialog action can run after the fragment is detached; done means the same lifecycle path no longer raises the IllegalStateException.

Written by the indexing model from the issue text.

Assessment

Tech stack
android, kotlin
Domain
mobile
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.