Open shirakaba opened 1 month ago
I reinitialised the project with experimentalNuGetDependency
disabled this time and I think it got further. However, I get a different error which I can't get past either:
Time Elapsed 00:00:01.67
✔ Restoring NuGet packages
✔ Auto-linking...
Success: No auto-linking changes necessary. (224ms)
✔ Found Solution: C:\Users\jamie\git\my_monorepo\packages\react-native-app-auth-js\windows\react-native-app-auth-js.sln
ℹ Build configuration: Debug
ℹ Build platform: x64
✖ Building Solution: C:\Program Files\Microsoft Visual Studio\2022\Community\MSBuild\Microsoft\VisualStudio\v17....
✖ Build failed with message C:\Program Files\Microsoft Visual Studio\2022\Community\MSBuild\Microsoft\VisualStudio\v17.0\AppxPackage\Microsoft.AppXPackage.Targets(2006,5): error APPX1111: Payload contains two or more files with the same destination path 'hermes.dll', but they are different sizes. Source files: [C:\Users\jamie\git\my_monorepo\packages\react-native-app-auth-js\windows\react-native-app-auth-js\react-native-app-auth-js.vcxproj]. Check your build configuration.
✖ It is possible your installation is missing required software dependencies. Dependencies can be automatically installed by running C:\Users\jamie\git\my_monorepo\packages\react-native-app-auth-js\node_modules\react-native-windows\scripts\rnw-dependencies.ps1 from an elevated PowerShell prompt.
For more information, go to http://aka.ms/rnw-deps
Command failed. Re-run the command with --logging for more information.
ELIFECYCLE Command failed with exit code 2302.
There are a few mentions of "Payload contains two or more files with the same destination path" in the issues.
I've checked all offered solutions:
pnpm why react-native-windows
that I only have one copy of react-native-windows<ReactNativeWindowsDir
is already in the suggested state for an example app to go along with a native module package.<TargetPlatformMinVersion>10.0.17763.0</TargetPlatformMinVersion>
.All have the same result.
There are a few mentions of "Payload contains two or more files with the same destination path" in the issues.
It looks like it's complaining about hermes.dll
, which is currently provided by the Microsoft.JavaScript.Hermes package, the version of which should have been chosen by RNW in by the property in react-native-windows\PropertySheets\JSEngine.props
and loaded by the PackageReferences in react-native-windows\PropertySheets\External\Microsoft.ReactNative.Uwp.CppApp.targets
for your app and react-native-windows\PropertySheets\External\Microsoft.ReactNative.Uwp.CppLib.targets
for native modules.
It's possible that one or more of your modules are specifying a different version of Hermes (maybe even a different older package since we renamed it at some point) which is why you're getting two different hermes.dll
files. The modules would need to be updated to not specify a reference for a version of Hermes themselves and instead rely on the version being coordinated by those RNW property sheets.
That'd make sense. I'm using react-native-svg
, react-native-webview
, and a library of my own making.
However, I've since re-initialised the library of my own making with a different boilerplate and it's now building with experimentalNuGetDependency
disabled.
I would like to re-enable experimentalNuGetDependency
, however. Do you have any thoughts about the original error I got whilst experimentalNuGetDependency
was enabled, about error MSB3271?
Problem Description
Using a project freshly initialised from
react-native-windows-init
withexperimentalNuGetDependency
enabled, I'm struggling to create an app that uses react-native-webview on ARM.I get a build error upon running
npx react-native run-windows --logging --arch arm64 --sln windows/react-native-app-auth-js.sln
.It seems to be specific to
react-native-webview
, as this short log appears innode_modules\react-native-webview\windows\ReactNativeWebView\ARM64\Debug\ReactNativeWebView.log
:The full error log propagated up to the CLI is this:
I'm specifying in the CLI that I want it to build for ARM, so I'm unclear why it's failing. Does
react-native-webview
lack an ARM slice or something? Or isexperimentalNuGetDependency
only built for x86?Steps To Reproduce
react-native-windows
app inside an existingreact-native@0.73
project:Expected Results
I should be able to build my RNW app on ARM without
react-native-webview
causing a build failure.CLI version
npx @react-native-community/cli -v
Environment
Community Modules
No response
Target Platform Version
None
Target Device(s)
No response
Visual Studio Version
None
Build Configuration
None
Snack, code example, screenshot, or link to a repository
No response
Related
The only relevant reference I can see to this in
react-native-webview
is this issue from 2021, v0.63: https://github.com/react-native-webview/react-native-webview/issues/1883. Wondering whether @asklar would recognise this.