fix: Windows CMake/Ninja paths issue + Gradle 9 bundle/codegen ordering for barcode-scanner#3850
Open
AliRezaBeigy wants to merge 1 commit into
Open
fix: Windows CMake/Ninja paths issue + Gradle 9 bundle/codegen ordering for barcode-scanner#3850AliRezaBeigy wants to merge 1 commit into
AliRezaBeigy wants to merge 1 commit into
Conversation
…ng for barcode-scanner
|
@AliRezaBeigy is attempting to deploy a commit to the Margelo Team on Vercel. A member of the Team first needs to authorize it. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Improves
react-native-vision-camera-barcode-scannerAndroid builds on Windows and with Gradle 9 / React Native New Architecture by relocating native/Gradle outputs under the host app’s standardandroid/build/tree (no extra top-level folders), and by declaring an explicit task ordering between Hermes bundle tasks and this library’s codegen output.Problem
Long paths on Windows
The library often resolves under a deep
node_modules/...tree. Android Gradle Plugin still places CMake/Ninja output in a.cxxtree derived from the module location, so object file paths can exceed practical Ninja/CMake limits. Symptoms include CMake repeatedly re-running and:ninja: error: manifest 'build.ninja' still dirty after 100 tries.Gradle 9 configuration validation
With New Architecture enabled,
:app:createBundle*JsAndAssetscan consume outputs from:react-native-vision-camera-barcode-scanner:generateCodegenArtifactsFromSchemawithout an explicit dependency, which Gradle 9 reports as a misconfiguration.Solution
Windows only (detected via
os.name):project.buildDirtoandroid/build/externalNativeModules/<sanitized-project-name>(underrootProject.buildDir), so library outputs stay in the normal Gradle build output tree.externalNativeBuild.cmake.buildStagingDirectoryto${project.buildDir}/cxxso CMake/Ninja staging is short and colocated with that module’s relocatedbuildDir.All platforms (when the React Gradle plugin registers codegen on this project):
gradle.projectsEvaluated, findgenerateCodegenArtifactsFromSchemaon this project and registerdependsOnfrom every application subproject’screateBundle*JsAndAssetstasks.Notes
-DCMAKE_OBJECT_PATH_MAX=...: Android SDK CMake is often 3.22.x, while that flag targets CMake 3.26+; relocation addresses the root cause without relying on newer CMake.rootProject.buildDirso paths stay correct for the usual React Native layout where the Gradle root is theandroid/project.