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

Cannot build on 0.69.21 with C# library #11345

Closed
cjhines opened this issue Mar 7, 2023 · 4 comments
Closed

Cannot build on 0.69.21 with C# library #11345

cjhines opened this issue Mar 7, 2023 · 4 comments
Labels
bug Needs: Author Feedback The issue/PR needs activity from its author (label drives bot activity) no-recent-activity Issue/PR has gone stale and may be closed (label applied by bot)

Comments

@cjhines
Copy link

cjhines commented Mar 7, 2023

Problem Description

I'm trying to get an older library (react-native-file-viewer) to run in my project.

I made a fork to update dependencies and minimal build which you can find here.

I was running into UAP version errors until I implemented this workaround of setting an AssetTargetFallback property:

  <PropertyGroup Label="NuGet">
    <ResolveNuGetPackages>false</ResolveNuGetPackages>
    <AssetTargetFallback>$(AssetTargetFallback);uap10.0.19041</AssetTargetFallback>
  </PropertyGroup>

I'm now getting the following error when attempting a build on CI:

 C:\MyApp\application\node_modules\react-native-windows\Microsoft.ReactNative.Managed.CodeGen\target\x64\Release\Microsoft.ReactNative.Managed.CodeGen\publish\Microsoft.ReactNative.Managed.CodeGen.exe @C:\MyApp\application\node_modules\react-native-file-viewer\windows\ReactNativeFileViewer\obj\x64\Release\ReactNativeFileViewer.ReactNativeCodeGenReactNativeFileViewer.ReactNativeCodeGen.rsp
  Invalid runtimeconfig.json [C:\MyApp\application\node_modules\react-native-windows\Microsoft.ReactNative.Managed.CodeGen\target\x64\Release\Microsoft.ReactNative.Managed.CodeGen\publish\Microsoft.ReactNative.Managed.CodeGen.runtimeconfig.json] [C:\MyApp\application\node_modules\react-native-windows\Microsoft.ReactNative.Managed.CodeGen\target\x64\Release\Microsoft.ReactNative.Managed.CodeGen\publish\Microsoft.ReactNative.Managed.CodeGen.runtimeconfig.dev.json]
C:\MyApp\application\node_modules\react-native-windows\PropertySheets\ManagedCodeGen\Microsoft.ReactNative.Managed.CodeGen.targets(78,5): error MSB3073: The command "C:\MyApp\application\node_modules\react-native-windows\Microsoft.ReactNative.Managed.CodeGen\target\x64\Release\Microsoft.ReactNative.Managed.CodeGen\publish\Microsoft.ReactNative.Managed.CodeGen.exe @C:\MyApp\application\node_modules\react-native-file-viewer\windows\ReactNativeFileViewer\obj\x64\Release\ReactNativeFileViewer.ReactNativeCodeGenReactNativeFileViewer.ReactNativeCodeGen.rsp" exited with code -2147450733. [C:\MyApp\application\node_modules\react-native-file-viewer\windows\ReactNativeFileViewer\ReactNativeFileViewer.csproj]

I can't find any reference to this error outside of dotnet forums and I'm struggling to apply their use cases to mine.

I thought it could be due to the long paths, but this should be allowed:

Screenshot 2023-03-07 at 21 12 54

Steps To Reproduce

  1. Install my react-native-file-viewer fork.
  2. Follow the workaround outlined here

Expected Results

No response

CLI version

npx react-native --version

Environment

System:
    OS: Windows 10 10.0.20348
    CPU: (4) x64 Intel(R) Xeon(R) CPU E5-2673 v4 @ 2.30GHz
    Memory: 11.96 GB / 16.00 GB
  Binaries:
    Node: 14.20.0 - C:\Program Files\nodejs\node.EXE
    Yarn: 1.22.19 - C:\Program Files (x86)\Yarn\bin\yarn.CMD
    npm: 6.14.17 - C:\Program Files\nodejs\npm.CMD
    Watchman: Not Found
  SDKs:
    Android SDK: Not Found
    Windows SDK:
      AllowDevelopmentWithoutDevLicense: Enabled
      AllowAllTrustedApps: Enabled
      Versions: 10.0.18362.0, 10.0.19041.0
  IDEs:
    Android Studio: Not Found
    Visual Studio: 16.11.32630.194 (Visual Studio Community 2019)
  Languages:
    Java: Not Found
  npmPackages:
    @react-native-community/cli: Not Found
    react: 18.0.0 => 18.0.0
    react-native: 0.69.7 => 0.69.7
    react-native-windows: 0.69.6 => 0.69.6
  npmGlobalPackages:
    *react-native*: Not Found

Target Platform Version

None

Target Device(s)

No response

Visual Studio Version

Visual Studio 2019

Build Configuration

None

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

No response

@cjhines cjhines added the bug label Mar 7, 2023
@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 Mar 7, 2023
@chrisglein
Copy link
Member

chrisglein commented Mar 9, 2023

Title of your issue says C++ library, but the implementation of that module looks like it's C#. Typo?

This failure looks to be in the codegen. There was a change in 0.71 that updates the dotNet version that could affect this. Is upgrading an option?

Also 0.69.6 is a bit behind. 0.69.21 is the latest (https://github.com/microsoft/react-native-windows/releases).

Anyway, not confident this has been patched. But it'll help in investigation if we're dealing with latest. There has been motion in this area.

I'm now getting the following error when attempting a build on CI:

How is it being built in CI?

@chrisglein chrisglein added Needs: Author Feedback The issue/PR needs activity from its author (label drives bot activity) and removed Needs: Triage 🔍 New issue that needs to be reviewed by the issue management team (label applied by bot) labels Mar 9, 2023
@cjhines cjhines changed the title Cannot build on 0.69.6 with C++ library Cannot build on 0.69.6 with C# library Mar 14, 2023
@cjhines cjhines changed the title Cannot build on 0.69.6 with C# library Cannot build on 0.69.21 with C# library Mar 14, 2023
@cjhines
Copy link
Author

cjhines commented Mar 14, 2023

@chrisglein Apologies, it is indeed a C# module. I've updated the title.

I tried 0.69.21 with no luck unfortunately.

Is upgrading an option?

Not in the short term unfortunately. Might look into it as a last resort but it would affect our release schedule.

How is it being built in CI?

Here is the build command I'm using:

npx react-native run-windows --logging --no-launch --no-deploy --release --msbuildprops PackageCertificateKeyFile=keyfile.pfx,PackageCertificatePassword="${CERT_PW}"

@microsoft-github-policy-service microsoft-github-policy-service bot added Needs: Attention 👋 An issue that had been tagged "Needs: Author Feedback" has received activity (label applied by bot) and removed Needs: Author Feedback The issue/PR needs activity from its author (label drives bot activity) labels Mar 14, 2023
@chrisglein
Copy link
Member

chrisglein commented Mar 16, 2023

Just to clarify: This builds fine for you locally but it's only in CI that it fails? Or is it failing to build in both?
How are the images being configured in CI? Do you know what dotNet versions they have installed? (particularly 3.1)

@chrisglein chrisglein added Needs: Author Feedback The issue/PR needs activity from its author (label drives bot activity) and removed Needs: Attention 👋 An issue that had been tagged "Needs: Author Feedback" has received activity (label applied by bot) labels Mar 16, 2023
@microsoft-github-policy-service microsoft-github-policy-service bot added the no-recent-activity Issue/PR has gone stale and may be closed (label applied by bot) label Apr 21, 2023
@microsoft-github-policy-service
Copy link
Contributor

This issue has been automatically marked as stale because it has been marked as requiring author feedback but has not had any activity for 7 days. It will be closed if no further activity occurs within 7 days of this comment.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Needs: Author Feedback The issue/PR needs activity from its author (label drives bot activity) no-recent-activity Issue/PR has gone stale and may be closed (label applied by bot)
Projects
None yet
Development

No branches or pull requests

2 participants