{"record":{"id":"de6f84cf948d79d9","repo":"microg/GmsCore","slug":"neither-preferencesresource-given-nor-overriden-g","errorCode":null,"errorMessage":"Neither preferencesResource given, nor overriden getFragment()","messagePattern":"Neither preferencesResource given, nor overriden getFragment\\(\\)","errorType":"exception","errorClass":"IllegalStateException","httpStatus":null,"severity":"error","filePath":"play-services-core/microg-ui-tools/src/main/java/org/microg/tools/ui/AbstractDashboardActivity.java","lineNumber":105,"sourceCode":"            evaluateConditionAsync(condition);\n        }\n    }\n\n    private synchronized void addConditionToView(Condition condition) {\n        for (int i = 0; i < conditionContainer.getChildCount(); i++) {\n            if (conditionContainer.getChildAt(i).getTag() == condition) return;\n        }\n        conditionContainer.addView(condition.createView(this, conditionContainer));\n    }\n\n    protected void clearConditions() {\n        conditions.clear();\n        resetConditionViews();\n    }\n\n    protected Fragment getFragment() {\n        if (preferencesResource == 0) {\n            throw new IllegalStateException(\"Neither preferencesResource given, nor overriden getFragment()\");\n        }\n        ResourceSettingsFragment fragment = new ResourceSettingsFragment();\n        Bundle b = new Bundle();\n        b.putInt(ResourceSettingsFragment.EXTRA_PREFERENCE_RESOURCE, preferencesResource);\n        fragment.setArguments(b);\n        return fragment;\n    }\n}\n","sourceCodeStart":87,"sourceCodeEnd":114,"githubUrl":"https://github.com/microg/GmsCore/blob/157c9d86ac46c195a86c2f15ab55c84036223f95/play-services-core/microg-ui-tools/src/main/java/org/microg/tools/ui/AbstractDashboardActivity.java#L87-L114","documentation":"Configuration guard in AbstractDashboardActivity.getFragment: the subclass neither set preferencesResource nor overrode getFragment(), so there is no settings fragment to display. It fires from onCreate when both configuration avenues are missing.","triggerScenarios":"Thrown at play-services-core/microg-ui-tools/src/main/java/org/microg/tools/ui/AbstractDashboardActivity.java:105 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Set preferencesResource in the activity's constructor or initialization block","Override getFragment() to return the fragment to show"],"exampleFix":null,"handlingStrategy":"fallback","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"157c9d86ac46c195a86c2f15ab55c84036223f95","analyzedAt":"2026-09-06T17:27:33.892Z","contentChangedAt":"2026-09-06T17:27:33.892Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}