Issue
Projects created with Mendix Studio Pro and stored on drives other than C: may encounter errors like the one below when running a native mobile profile. Specifically, developers may receive Metro bundler errors indicating that essential files cannot be resolved or hashed correctly, such as failure to obtain the SHA-1 for native.js.
[Output] ERROR Error: Failed to get the SHA-1 for: D:\C:\Program Files\Mendix\10.24.1.74050\modeler\tools\node\node_modules\mendix\native.js.
[Output] Potential causes:
[Output] 1) The file is not watched. Ensure it is under the configured `projectRoot` or `watchFolders`.
[Output] 2) Check `blockList` in your metro.config.js and make sure it isn't excluding the file path.
[Output] 3) The file may have been deleted since it was resolved - try refreshing your app.
[Output] 4) Otherwise, this is a bug in Metro or the configured resolver - please report it.
[Output] at missingSha1Error (C:\Program Files\Mendix\10.24.1.74050\modeler\tools\node\node_modules\metro\src\node-haste\DependencyGraph.js:28:3)
[Output] at DependencyGraph.getSha1 (C:\Program Files\Mendix\10.24.1.74050\modeler\tools\node\node_modules\metro\src\node-haste\DependencyGraph.js:189:13)
[Output] at Transformer._getSha1 (C:\Program Files\Mendix\10.24.1.74050\modeler\tools\node\node_modules\metro\src\Bundler.js:21:43)
[Output] at Transformer.transformFile (C:\Program Files\Mendix\10.24.1.74050\modeler\tools\node\node_modules\metro\src\DeltaBundler\Transformer.js:97:33)
[Output] at Bundler.transformFile (C:\Program Files\Mendix\10.24.1.74050\modeler\tools\node\node_modules\metro\src\Bundler.js:49:30)
[Output] at process.processTicksAndRejections (node:internal/process/task_queues:105:5)
[Output] at async Object.transform (C:\Program Files\Mendix\10.24.1.74050\modeler\tools\node\node_modules\metro\src\lib\transformHelpers.js:139:12)
[Output] at async transform (C:\Program Files\Mendix\10.24.1.74050\modeler\tools\node\node_modules\metro\src\DeltaBundler\Graph.js:164:26)
[Output] at async visit (C:\Program Files\Mendix\10.24.1.74050\modeler\tools\node\node_modules\metro\src\DeltaBundler\buildSubgraph.js:82:29)
[Output] at async Promise.all (index 0)
[Output] MxTerminalReporter: {"event":"bundling_error","name":"Error","message":"Failed to get the SHA-1 for: D:\\C:\\Program Files\\Mendix\\10.24.1.74050\\modeler\\tools\\node\\node_modules\\mendix\\native.js.\n Potential causes:\n 1) The file is not watched. Ensure it is under the configured `projectRoot` or `watchFolders`.\n 2) Check `blockList` in your metro.config.js and make sure it isn't excluding the file path.\n 3) The file may have been deleted since it was resolved - try refreshing your app.\n 4) Otherwise, this is a bug in Metro or the configured resolver - please report it."}
[Output] MxTerminalReporter: {"event":"bundle_build_started"}
[Output] BUNDLE ./index.jsEnvironment
Studio Pro (all versions)
Cause
This issue is that Mendix Studio Pro only supports running native mobile projects from the C: drive. When a project is stored on a different drive, like D:, the Metro bundler used for building native apps cannot correctly resolve file paths or calculate SHA-1 hashes, leading to bundling errors.
Solution / Workaround
To resolve the issue with native mobile app bundling in Mendix Studio Pro, the project must be saved on the C: drive. Moving the entire project directory from any other drive (e.g., D:) to C: ensures that the Metro bundler can correctly locate and process all necessary files during runtime. This configuration aligns with Mendix’s current supported setup for native development.
Internal information related
253689
Additional information
Native App Prerequisites and Troubleshooting | Mendix Documentation
0 Comments