-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Description
SPECIFIC ISSUE ENCOUNTERED
When using tasks.whenTaskAdded
in the Gradle build script to dynamically modify task dependencies (e.g., making CMake or external tasks depend on a custom extractNativeLibraries
task), ARCore's integration with Firebase Crashlytics silently fails. Crashlytics no longer uploads native symbols and ARCore functionality breaks in subtle ways. This issue seems related to how Gradle task wiring is handled internally, and adding blanket dependsOn
calls appears to interfere with ARCore or Crashlytics plugin task graphs.
This does not happen if using preBuild.dependsOn(...)
explicitly instead of whenTaskAdded
.
VERSIONS USED
- Android Studio: Meerkat
- ARCore SDK for Android: 1.42.0
STEPS TO REPRODUCE THE ISSUE
-
Add the following block to
app/build.gradle
:tasks.whenTaskAdded { task -> if ((task.name.contains("external") || task.name.contains("CMake")) && !task.name.contains("Clean")) { task.dependsOn(extractNativeLibraries) } }
-
Add Firebase Crashlytics support to the project.
-
Build a release APK or Bundle that includes native code and ARCore support.
-
Observe that native symbol uploads are missing and/or ARCore behavior breaks unexpectedly.
WORKAROUNDS (IF ANY)
Replace tasks.whenTaskAdded { ... }
with an explicit dependency like:
afterEvaluate {
preBuild.dependsOn(extractNativeLibraries)
}
This avoids interfering with the internal task graph used by ARCore and Crashlytics.
ADDITIONAL COMMENTS
If tasks.whenTaskAdded
must be used, it would be helpful for ARCore and Firebase plugins to better guard against task wiring changes or expose safer extension points to hook in native tasks. The current behavior is difficult to debug because the Gradle build completes successfully, but functionality like symbol uploads silently fails.