Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[0.74] New Architecture fails build with MDMERGE : error MDM2009: Duplicate type Microsoft.UI.Xaml.* when added some native libraries. #13597

Open
jihoobyeon opened this issue Aug 21, 2024 · 4 comments
Assignees
Labels
Area: Fabric Support Facebook Fabric Area: Native Modules Area: Paper bug Old Architecture Broad category for issues that apply to the RN "old" architecture of Cxx Modules + Paper Parity: Fabric vs. Paper RNW Fabric does not look or behave like RNW Paper
Milestone

Comments

@jihoobyeon
Copy link

Problem Description

I am suffering same symptom as #7226, but build fails every time, not only first time.
My app is 0.74 New architecture app, made by instructions mentioned here.

Steps To Reproduce

  1. Make a new RNW app with New architecture.
  2. Add npm packages react-native-permissions and @babylonjs/react-native-windows-0-71 to the app.
  3. Build it.

Expected Results

App should start.

CLI version

13.6.9

Environment

System:
  OS: Windows 10 10.0.19045
  CPU: "(4) x64 AMD Ryzen 3 2200U with Radeon Vega Mobile Gfx  "
  Memory: 24.25 GB / 31.63 GB
Binaries:
  Node:
    version: 20.10.0
    path: C:\Program Files\nodejs\node.EXE
  Yarn:
    version: 3.6.4
    path: ~\AppData\Roaming\npm\yarn.CMD
  npm:
    version: 10.8.2
    path: C:\Program Files\nodejs\npm.CMD
  Watchman: Not Found
SDKs:
  Android SDK: Not Found
  Windows SDK:
    AllowDevelopmentWithoutDevLicense: Enabled
    AllowAllTrustedApps: Enabled
    Versions:
      - 10.0.19041.0
      - 10.0.22000.0
      - 10.0.22621.0
IDEs:
  Android Studio: Not Found
  Visual Studio:
    - 17.11.35219.272 (Visual Studio Community 2022)
Languages:
  Java: 21.0.3
  Ruby: Not Found
npmPackages:
  "@react-native-community/cli": Not Found
  react:
    installed: 18.2.0
    wanted: 18.2.0
  react-native:
    installed: 0.74.5
    wanted: 0.74.5
  react-native-windows:
    installed: 0.74.16
    wanted: ^0.74.16
npmGlobalPackages:
  "*react-native*": Not Found
Android:
  hermesEnabled: true
  newArchEnabled: false
iOS:
  hermesEnabled: Not found
  newArchEnabled: Not found

Community Modules

"react-native-permissions": 4.1.5
"@babylonjs/core": 7.21.5
"@babylonjs/havok": 1.3.8
"@babylonjs/react-native": 1.8.6
"@babylonjs/react-native-windows-0-71": 1.8.6

Target Platform Version

10.0.19041

Target Device(s)

Desktop

Visual Studio Version

Visual Studio 2022

Build Configuration

Debug

Snack, code example, screenshot, or link to a repository

No response

@jihoobyeon jihoobyeon added the bug label Aug 21, 2024
@microsoft-github-policy-service microsoft-github-policy-service bot added the Needs: Triage 🔍 New issue that needs to be reviewed by the issue management team (label applied by bot) label Aug 21, 2024
@jihoobyeon
Copy link
Author

Hmm, I found that same native modules with old architecture also breaks.
It says versions of NuGet package Microsoft.Windows.CppWinRT mismatches - seems to look like RNW is forcing to use specific version of C++/WinRT.

I'm not sure this two symptoms came from same bug, so I'm quite careful to either edit this issue or open another issue for old arch.

I tried building @babylonjs/react-native-windows-0-71 newly from source but that didn't solved the collision.

@jonthysell
Copy link
Contributor

Sorry, we haven't really worked out the complete story/solution for new architecture apps to consume existing modules (esp. if those modules specify new native UI). So it's not really guaranteed that any existing module is set up in a way that it can be successfully consumed by new architecture apps (which is why the new templates are still experimental).

@jonthysell
Copy link
Contributor

@marlenecota We use WinAppSDK in the new arch, it won't work when oplder modules still request WinUI 2 as a dependency, so we'll have to figure out how to support both in a future joint new/old arch module template and/or property sheets.

@jonthysell jonthysell added Area: Native Modules Area: Fabric Support Facebook Fabric Area: Paper Parity: Fabric vs. Paper RNW Fabric does not look or behave like RNW Paper labels Aug 26, 2024
@microsoft-github-policy-service microsoft-github-policy-service bot added Old Architecture Broad category for issues that apply to the RN "old" architecture of Cxx Modules + Paper New Architecture Broad category for issues that apply to the RN "new" architecture of Turbo Modules + Fabric labels Aug 26, 2024
@jonthysell jonthysell removed Needs: Triage 🔍 New issue that needs to be reviewed by the issue management team (label applied by bot) Old Architecture Broad category for issues that apply to the RN "old" architecture of Cxx Modules + Paper New Architecture Broad category for issues that apply to the RN "new" architecture of Turbo Modules + Fabric labels Aug 26, 2024
@microsoft-github-policy-service microsoft-github-policy-service bot added the Old Architecture Broad category for issues that apply to the RN "old" architecture of Cxx Modules + Paper label Aug 26, 2024
@jonthysell jonthysell added this to the Next milestone Aug 26, 2024
@jihoobyeon
Copy link
Author

@marlenecota We use WinAppSDK in the new arch, it won't work when oplder modules still request WinUI 2 as a dependency, so we'll have to figure out how to support both in a future joint new/old arch module template and/or property sheets.

Oh, then do we have a way to disable WinUI 3 in New arch?

I'm now working at another, much simpler native module and it also has a problem with WinUI 3.
so I just set UseWinUI3 to false in ExperimentalFeatures.props and got this error:

9>.\Composition.Input.idl(11): error MIDL2011: [msg]unresolved type declaration [context]: Microsoft.UI.Input.VirtualKeyStates [ Procedure 'GetKeyState' ( Interface 'Microsoft.ReactNative.Composition.Input.KeyboardSource' ) ] [C:\U
       sers\jihoobyeon\Desktop\fptest\node_modules\react-native-windows\Microsoft.ReactNative\Microsoft.ReactNative.vcxproj]
9>.\Composition.Input.idl(24): error MIDL2011: [msg]unresolved type declaration [context]: Microsoft.UI.Input.PhysicalKeyStatus [ Property 'KeyStatus' ( Interface 'Microsoft.ReactNative.Composition.Input.KeyRoutedEventArgs' ) ] [C:
       \Users\jihoobyeon\Desktop\fptest\node_modules\react-native-windows\Microsoft.ReactNative\Microsoft.ReactNative.vcxproj]
9>.\Composition.Input.idl(31): error MIDL2011: [msg]unresolved type declaration [context]: Microsoft.UI.Input.PhysicalKeyStatus [ Property 'KeyStatus' ( Interface 'Microsoft.ReactNative.Composition.Input.CharacterReceivedRoutedEven
       tArgs' ) ] [C:\Users\jihoobyeon\Desktop\fptest\node_modules\react-native-windows\Microsoft.ReactNative\Microsoft.ReactNative.vcxproj]

I'm still trying to find the window handle of RN app, but since I also have to use BabylonReactNative, I prefer not to use WinUI 3 if I can.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area: Fabric Support Facebook Fabric Area: Native Modules Area: Paper bug Old Architecture Broad category for issues that apply to the RN "old" architecture of Cxx Modules + Paper Parity: Fabric vs. Paper RNW Fabric does not look or behave like RNW Paper
Projects
Status: No status
Development

No branches or pull requests

3 participants