Skip to content

[Android] Gradle source map upload silently skipped on react-native 0.85 since 8.14.0 #6319

Closed

Description

@Joel-Mercier

What React Native libraries do you use?

Expo (mobile only), Expo Application Services (EAS), Expo Router, Hermes, RN New Architecture

Are you using sentry.io or on-premise?

sentry.io (SaS)

Are you using any other error monitoring solution alongside Sentry?

No

Other Error Monitoring Solution Name

No response

@sentry/react-native SDK Version

8.14.0

How does your development environment look like?

  - @sentry/react-native: 8.14.0 (also reproduces on 8.15.0, latest)
  - react-native: 0.85.3
  - expo: 56.0.12
  - Platform: Android, release build via eas build (cloud and --local)
  - Last working version: 8.13.0

Sentry.init()

Sentry.init({
  dsn: 'https://...@sentry.io/...'
  enabled: !__DEV__ && process.env.EXPO_PUBLIC_ENV !== "development",
  environment: process.env.EXPO_PUBLIC_ENV ?? "development",
  release: `wavio@${Application.nativeApplicationVersion ?? "0.0.0"}`,
  dist: Application.nativeBuildVersion ?? undefined,
  sendDefaultPii: true,
  enableLogs: true,
  beforeBreadcrumb: (breadcrumb) => scrubBreadcrumb(breadcrumb),
  beforeSend: (event) => scrubEvent(event),
  ignoreErrors: [
    "Network Error",
    "timeout exceeded",
    "Request aborted",
    "AbortError",
    /ECONNABORTED/,
    /ERR_NETWORK/,
  ],
});

Steps to Reproduce

  1. Use a project on react-native 0.85.3 with @sentry/react-native@8.14.0, the @sentry/react-native/expo
    config plugin, and getSentryExpoConfig in metro.config.js (standard Expo setup; Debug IDs enabled).
  2. Ensure SENTRY_AUTH_TOKEN is available at build time so the Gradle auto-upload is eligible to run.
  3. Run a release Android build (eas build -p android --profile production, or any build that invokes the
    createBundleReleaseJsAndAssets task).
  4. Watch the Gradle output for the Sentry source-map upload step.

Expected Result

The Gradle integration extracts the bundle/source-map paths from the createBundleReleaseJsAndAssets
(BundleHermesCTask) task, runs sentry-cli sourcemaps upload, and an artifact bundle with a matching
Debug ID appears under Project → Settings → Source Maps. This is the behavior on 8.13.0 and earlier.

Actual Result

The build succeeds but the upload is silently skipped, with this warning:

  [sentry] Could not extract bundle task arguments for 'createBundleReleaseJsAndAssets'. Source maps will
  not be uploaded.

No artifact bundle is uploaded, so production stack traces are never symbolicated.

Root cause

8.14.0 rewrote the Gradle integration from sentry.gradle (Groovy) to sentry.gradle.kts (Kotlin) and
added a strict type guard in extractBundleTaskArguments (sentry.gradle.kts:266-270):

  val intermediateSourcemapsDirFile =
      when (jsIntermediateSourceMapsDir) {
          is org.gradle.api.file.Directory -> jsIntermediateSourceMapsDir.asFile
          else -> return BundleTaskArgs(null, null, null, null)   // ← bails out
      }

In RN 0.85, BundleHermesCTask declares jsIntermediateSourceMapsDir as a RegularFileProperty (used as a
directory — mkdirs() is called on it), not a DirectoryProperty. So .orNull returns a RegularFile, the is
Directory branch is skipped, and the else returns all-null → the caller logs the warning and skips
upload.

The old Groovy script (≤8.13.0) read the path dynamically
(props.jsIntermediateSourceMapsDir.get().asFile.absolutePath), which works regardless of the property's
static type — hence no regression there.

Suggested fix

Also accept RegularFile in the guard (safe, since RN populates it with a directory path):

       val intermediateSourcemapsDirFile =
           when (jsIntermediateSourceMapsDir) {
               is org.gradle.api.file.Directory -> jsIntermediateSourceMapsDir.asFile
  +            is org.gradle.api.file.RegularFile -> jsIntermediateSourceMapsDir.asFile
               else -> return BundleTaskArgs(null, null, null, null)
           }

Activity

  1. linear-code commented on Jun 18, 2026

    @linear-code
  2. moved this to Waiting for: Product Owner in GitHub Issues with 👀 3on Jun 18, 2026
  3. self-assigned this
    on Jun 18, 2026
  4. antonis commented on Jun 18, 2026

    @antonis
    Contributor

    Thank you for reporting 🙇 We will investigate this and report back.

  5. moved this from Waiting for: Product Owner to No status in GitHub Issues with 👀 3on Jun 18, 2026
  6. Joel-Mercier commented on Jun 18, 2026

    @Joel-Mercier
    Author

    Thanks for the fast response and for the PR, I should have filed it myself but wanted to make sure you were noticing the same on your end
    Looking forward to dropping my temporary patch !
    Have a good one

  7. moved this to Waiting for: Product Owner in GitHub Issues with 👀 3on Jun 18, 2026
  8. github-actions commented on Jun 19, 2026

    @github-actions
    Contributor

    A PR closing this issue has just been released 🚀

    This issue was referenced by PR #6320, which was included in the 8.15.1 release.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions