Skip to content

Production build is failing with RN 0.72 (Gradle 8) #3144

@renchap

Description

@renchap

OS:

  • Windows
  • MacOS
  • Linux

Platform:

  • iOS
  • Android

SDK:

  • @sentry/react-native (>= 1.0.0)
  • react-native-sentry (<= 0.43.2)

SDK version: 5.6.0

react-native version: 0.72.0

Are you using Expo?

  • Yes
  • No

Are you using sentry.io or on-premise?
Configuration:
Not relevant, this happens during build


I have following issue:

Starting with Gradle 8.0, task dependencies must be explicit.

Building a RN 0.72 app uses Gradle 8, which fails with:

…
> Task :app:bundleRelease
> Task :app:uploadSentryNativeSymbolsForRelease FAILED

FAILURE: Build failed with an exception.

* What went wrong:
Some problems were found with the configuration of task ':app:uploadSentryNativeSymbolsForRelease' (type 'SentryUploadNativeSymbolsTask').
  - Gradle detected a problem with the following location: '/Users/renchap/dev/notos/packages/mobile/android/app/build'.

    Reason: Task ':app:uploadSentryNativeSymbolsForRelease' uses this output of task ':app:produceReleaseBundleIdeListingFile' without declaring an explicit or implicit dependency. This can lead to incorrect results being produced, depending on what order the tasks are executed.

    Possible solutions:
      1. Declare task ':app:produceReleaseBundleIdeListingFile' as an input of ':app:uploadSentryNativeSymbolsForRelease'.
      2. Declare an explicit dependency on ':app:produceReleaseBundleIdeListingFile' from ':app:uploadSentryNativeSymbolsForRelease' using Task#dependsOn.
      3. Declare an explicit dependency on ':app:produceReleaseBundleIdeListingFile' from ':app:uploadSentryNativeSymbolsForRelease' using Task#mustRunAfter.

    Please refer to https://docs.gradle.org/8.0.1/userguide/validation_problems.html#implicit_dependency for more details about this problem.
  - Gradle detected a problem with the following location: '/Users/renchap/dev/notos/packages/mobile/android/app/build'.

    Reason: Task ':app:uploadSentryNativeSymbolsForRelease' uses this output of task ':app:createReleaseBundleListingFileRedirect' without declaring an explicit or implicit dependency. This can lead to incorrect results being produced, depending on what order the tasks are executed.

    Possible solutions:
      1. Declare task ':app:createReleaseBundleListingFileRedirect' as an input of ':app:uploadSentryNativeSymbolsForRelease'.
      2. Declare an explicit dependency on ':app:createReleaseBundleListingFileRedirect' from ':app:uploadSentryNativeSymbolsForRelease' using Task#dependsOn.
      3. Declare an explicit dependency on ':app:createReleaseBundleListingFileRedirect' from ':app:uploadSentryNativeSymbolsForRelease' using Task#mustRunAfter.

    Please refer to https://docs.gradle.org/8.0.1/userguide/validation_problems.html#implicit_dependency for more details about this problem.

Steps to reproduce:

  • Run a production build (bundleRelease) with the Sentry SDK installed
  • See that Gradle fails the build due to missing tasks dependencies

Actual result:

The build fails with the error message above

Expected result:

The build succeed

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    Status

    Done

    Status

    No status

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions