Skip to content

gson 2.13.0 causes StackOverflowError with Gradle license report plugins #2846

@rarenatoe

Description

@rarenatoe

Gson version

2.13.0

Java / Android version

Android 14 (API 34)
Android 15 (API 35)

Used tools

  • Maven; version:
  • Gradle; version: 8
  • ProGuard (attach the configuration file please); version:
  • com.jaredsburrows:gradle-license-plugin:0.9.7
  • React Native: 0.75.5

Description

The latest version of gson (2.13.0), released around April 11, 2025, causes StackOverflowErrors when used with Gradle license report generation tools, specifically with com.jaredsburrows:gradle-license-plugin:0.9.7.

Expected behavior

The license report generation task should complete successfully, as it does with gson 2.12.1 and earlier versions.

Actual behavior

When the project resolves to gson 2.13.0, the license report generation task fails with a StackOverflowError with no additional error message.

Reproduction steps

  1. Create or use a project that includes the gradle-license-plugin:
plugins {
  id "com.jaredsburrows.license" version "0.9.7"
}
  1. Include a dependency that uses gson 2.13.0 (or a library with wildcard dependency like com.google.code.gson:gson:+). In my case this happens with rollbar-react-native
  2. Configure license report generation:
licenseReport {
  generateHtmlReport = false
  generateJsonReport = true
  copyHtmlReportToAssets = false
  copyJsonReportToAssets = true
}
  1. Run the license report generation task:
./gradlew licenseReleaseReport

Exception stack trace

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':app:licenseReleaseReport'.
> java.lang.StackOverflowError (no error message)

Additional information:

  • The error does not occur when forcing gson 2.12.1 with this workaround:
configurations.all {
  resolutionStrategy {
    force 'com.google.code.gson:gson:2.12.1'
  }
}
  • I discovered this issue in a React Native project using rollbar-react-native, which includes a wildcard dependency on gson, but the issue appears to be with gson 2.13.0 itself.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions