Bug Report
Description
AndroidCodeStudio crashes when opening the editor/project.
The crash occurs because "ChatFragment" tries to access the project directory before the project path has been initialized.
Crash Log
java.lang.IllegalStateException:
Cannot get project directory. Path has not been set.
at com.tom.rv2ide.projects.internal.ProjectManagerImpl.getProjectDir(ProjectManagerImpl.kt:82)
at com.tom.rv2ide.utils.ProjectHelper.getProjectRoot(ProjectHelper.kt:531)
at com.tom.rv2ide.fragments.ChatFragment.(ChatFragment.kt:73)
The important part of the stacktrace is:
ChatFragment.(ChatFragment.kt:73)
→ ProjectHelper.getProjectRoot()
→ ProjectManagerImpl.getProjectDir()
→ Cannot get project directory. Path has not been set.
Environment
- AndroidCodeStudio: "v1.0.0+gh.r04 (1025)"
- Variant: "arm64-v8a"
- Build type: "OFFICIAL"
- Android SDK: "35"
- Device: "OPPO CPH2591"
- Architecture: "arm64-v8a"
Steps to Reproduce
- Open AndroidCodeStudio.
- Open a project/editor.
- Wait for the editor and fragments to initialize.
- The application crashes.
Expected Behavior
AndroidCodeStudio should initialize the project directory before "ChatFragment" tries to access it, or gracefully handle the project path being unavailable.
Actual Behavior
The application crashes with:
IllegalStateException:
Cannot get project directory. Path has not been set.
Suspected Cause
"ChatFragment" appears to call "ProjectHelper.getProjectRoot()" during Fragment construction/property initialization, before the project directory has been initialized.
The relevant location appears to be:
ChatFragment.kt:73
Full Stacktrace
java.lang.IllegalStateException: Cannot get project directory. Path has not been set.
at com.tom.rv2ide.projects.internal.ProjectManagerImpl.getProjectDir(ProjectManagerImpl.kt:82)
at com.tom.rv2ide.utils.ProjectHelper.getProjectRoot(ProjectHelper.kt:531)
at com.tom.rv2ide.fragments.ChatFragment.(ChatFragment.kt:73)
at java.lang.reflect.Constructor.newInstance0(Native Method)
at java.lang.reflect.Constructor.newInstance(Constructor.java:343)
at androidx.fragment.app.Fragment.instantiate(Fragment.java:672)
at androidx.fragment.app.FragmentContainer.instantiate(FragmentContainer.java:57)
at androidx.fragment.app.FragmentManager$3.instantiate(FragmentManager.java:525)
at androidx.fragment.app.FragmentStateManager.restoreSaveStateInternal(FragmentManager.java:2562)
The remaining stacktrace is available in the original crash report.
Bug Report
Description
AndroidCodeStudio crashes when opening the editor/project.
The crash occurs because "ChatFragment" tries to access the project directory before the project path has been initialized.
Crash Log
java.lang.IllegalStateException:
Cannot get project directory. Path has not been set.
at com.tom.rv2ide.projects.internal.ProjectManagerImpl.getProjectDir(ProjectManagerImpl.kt:82)
at com.tom.rv2ide.utils.ProjectHelper.getProjectRoot(ProjectHelper.kt:531)
at com.tom.rv2ide.fragments.ChatFragment.(ChatFragment.kt:73)
The important part of the stacktrace is:
ChatFragment.(ChatFragment.kt:73)
→ ProjectHelper.getProjectRoot()
→ ProjectManagerImpl.getProjectDir()
→ Cannot get project directory. Path has not been set.
Environment
Steps to Reproduce
Expected Behavior
AndroidCodeStudio should initialize the project directory before "ChatFragment" tries to access it, or gracefully handle the project path being unavailable.
Actual Behavior
The application crashes with:
IllegalStateException:
Cannot get project directory. Path has not been set.
Suspected Cause
"ChatFragment" appears to call "ProjectHelper.getProjectRoot()" during Fragment construction/property initialization, before the project directory has been initialized.
The relevant location appears to be:
ChatFragment.kt:73
Full Stacktrace
java.lang.IllegalStateException: Cannot get project directory. Path has not been set.
at com.tom.rv2ide.projects.internal.ProjectManagerImpl.getProjectDir(ProjectManagerImpl.kt:82)
at com.tom.rv2ide.utils.ProjectHelper.getProjectRoot(ProjectHelper.kt:531)
at com.tom.rv2ide.fragments.ChatFragment.(ChatFragment.kt:73)
at java.lang.reflect.Constructor.newInstance0(Native Method)
at java.lang.reflect.Constructor.newInstance(Constructor.java:343)
at androidx.fragment.app.Fragment.instantiate(Fragment.java:672)
at androidx.fragment.app.FragmentContainer.instantiate(FragmentContainer.java:57)
at androidx.fragment.app.FragmentManager$3.instantiate(FragmentManager.java:525)
at androidx.fragment.app.FragmentStateManager.restoreSaveStateInternal(FragmentManager.java:2562)
The remaining stacktrace is available in the original crash report.