Skip to content

IllegalArgumentException when initializing Parse #1194

Closed
@hej2010

Description

@hej2010

New Issue Checklist

Issue Description

The app crashes when initializing Parse with the latest Gradle/Android Studio version when using Proguard/R8 with minifyEnabled true and 'com.android.tools.build:gradle:8.0.0'.

Steps to reproduce

Initialize Parse at app startup with Parse.initialize(new Parse.Configuration.Builder(...));

Actual Outcome

The app crashes.

Expected Outcome

The app does not crash.

Environment

Parse Android SDK

  • SDK version: 4.2.0
  • Operating system version: Android 12

Logs

Caused by java.lang.IllegalArgumentException: Cannot register a type that does not implement the default constructor!
       at com.parse.ParseObjectSubclassingController.registerSubclass(ParseObjectSubclassingController.java:95)
       at com.parse.ParseObject.registerSubclass(ParseObject.java:291)
       at com.parse.ParseObject.registerParseSubclasses(ParseObject.java:1032)
       at com.parse.Parse.initialize(Parse.java:169)
       at com.parse.Parse.initialize(Parse.java:140)

I do not have any custom subclasses registered.

Fixed by

Keeping all classes that are registered in registerParseSubclasses() by adding the line -keep @com.parse.ParseClassName class com.parse.* to proguard-rules.pro.

Metadata

Metadata

Assignees

No one assigned

    Labels

    state:releasedReleased as stable versiontype:featureNew feature or improvement of existing feature

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions