libgdx / libgdx

Desktop/Android/HTML5/iOS Java game development framework
http://www.libgdx.com/
Apache License 2.0
23.27k stars 6.43k forks source link

Class cannot be created (missing no-arg constructor) in gradle 8.1.4 and libgdx 1.12.1 #7296

Closed newMemberHub closed 10 months ago

newMemberHub commented 10 months ago

Issue details

Class cannot be created due to missing no-arg constructor

Reproduction steps/code

Version of libGDX and/or relevant dependencies

Please select the affected platforms

tommyettinger commented 10 months ago

You can add android.enableR8.fullMode=false to your gradle.properties file (either one, I would suggest the root folder's gradle.properties) to stop R8 from erasing generated no-arg constructors. This is the default in new gdx-liftoff projects, and I think is also the default produced by gdx-setup (or will be soon). Unfortunately, there's no way to automatically update older projects to Gradle 8.5 and Android Gradle Plugin 8.1.4, so it has to be done piecemeal like this.

obigu commented 10 months ago

That's right, the change was made here https://github.com/libgdx/libgdx/pull/7247 and is available on latest Gdx Setup but requires the manual change on existing projects.