{"record":{"id":"5717e121b3b9cba0","repo":"microg/GmsCore","slug":"can-t-construct-object","errorCode":null,"errorMessage":"Can't construct object","messagePattern":"Can't construct object","errorType":"exception","errorClass":"RuntimeException","httpStatus":null,"severity":"error","filePath":"play-services-basement/src/main/java/org/microg/safeparcel/SafeParcelReflectionUtil.java","lineNumber":46,"sourceCode":"    private static final String TAG = \"SafeParcel\";\n\n    private SafeParcelReflectionUtil() {\n    }\n\n    @Deprecated\n    public static <T extends AutoSafeParcelable> T createObject(Class<T> tClass, Parcel in) {\n        ClassDescriptor<T> descriptor = new ClassDescriptor<>(tClass);\n        return createObject(in, descriptor);\n    }\n\n    public static <T extends AutoSafeParcelable> T createObject(Parcel in, ClassDescriptor<T> descriptor) {\n        try {\n            Constructor<T> constructor = descriptor.constructor;\n            T t = constructor.newInstance();\n            readObject(t, in, descriptor);\n            return t;\n        } catch (Exception e) {\n            throw new RuntimeException(\"Can't construct object\", e);\n        }\n    }\n\n    @Deprecated\n    public static void writeObject(AutoSafeParcelable object, Parcel parcel, int flags) {\n        if (object == null)\n            throw new NullPointerException();\n        Class<?> clazz = object.getClass();\n        ClassDescriptor<?> descriptor = new ClassDescriptor<>(clazz);\n        writeObject(object, parcel, flags, descriptor);\n    }\n\n    public static <T extends AutoSafeParcelable> void writeObject(T object, Parcel parcel, int flags, ClassDescriptor<?> descriptor) {\n        int start = SafeParcelWriter.writeObjectHeader(parcel);\n        for (ClassDescriptor.FieldDescriptor fieldDescriptor : descriptor.fields.values()) {\n            try {\n                writeField(object, parcel, flags, fieldDescriptor);\n            } catch (Exception e) {","sourceCodeStart":28,"sourceCodeEnd":64,"githubUrl":"https://github.com/microg/GmsCore/blob/157c9d86ac46c195a86c2f15ab55c84036223f95/play-services-basement/src/main/java/org/microg/safeparcel/SafeParcelReflectionUtil.java#L28-L64","documentation":"Wraps a reflection failure in SafeParcelReflectionUtil.createObject: the no-arg Constructor of the AutoSafeParcelable subclass could not be invoked (missing, inaccessible, or instantiation failed). The cause is chained; the faulty input is the parcelled class lacking a usable constructor.","triggerScenarios":"Thrown at play-services-basement/src/main/java/org/microg/safeparcel/SafeParcelReflectionUtil.java:46 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Give the parcelled class a public no-arg constructor","Ensure the class is non-abstract and accessible to reflection","Catch the exception and treat the parcel as unreadable for that type"],"exampleFix":null,"handlingStrategy":"try-catch","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-14T00:17:10.932Z"}