Skip to content

Commit 469101e

Browse files
antonisclaude
andcommitted
fix(android): restore missing bundle task warning via taskGraph.whenReady
Re-adds the diagnostic warn() that was lost when switching from tasks.named() to tasks.configureEach. The check is deferred to gradle.taskGraph.whenReady so all plugins' onVariants callbacks (including the RN plugin's) have completed and tasks.names reflects the full set of registered tasks before we decide to emit the warning. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
1 parent 0930fb9 commit 469101e

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

packages/core/sentry.gradle

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -320,6 +320,19 @@ plugins.withId('com.android.application') {
320320
packageTask.finalizedBy modulesCleanUpTask
321321
}
322322
}
323+
324+
// Warn if neither expected bundle task was registered by the time the task
325+
// graph is resolved — by then all plugins' onVariants callbacks (including
326+
// the React Native plugin's) have run, so tasks.names is complete.
327+
gradle.taskGraph.whenReady {
328+
if (bundleTaskNames.every { !tasks.names.contains(it) }) {
329+
project.logger.warn(
330+
"[sentry] No React Native bundle task found for variant '${v.name}'. " +
331+
"Expected 'createBundle${variantCapitalized}JsAndAssets' or " +
332+
"'bundle${variantCapitalized}JsAndAssets' — neither is registered. " +
333+
"Source maps will NOT be uploaded for this variant.")
334+
}
335+
}
323336
}
324337
}
325338
}

0 commit comments

Comments
 (0)