react-native-documents / document-picker

Document Picker for React Native
https://react-native-documents.github.io/
MIT License
1.35k stars 437 forks source link

Add NuGet AssetTargetFallback #578

Open MaxPMagee opened 2 years ago

MaxPMagee commented 2 years ago

I'm taking a stab at resolving the issue https://github.com/microsoft/react-native-windows/issues/10059#issuecomment-1147939186

Summary

Currently, RNDocumentPicker doesn't build against react-native 0.69.1/react-native-windows 0.69.1 because of a bug in the way that r-n-w handles older dependencies (built with a previous target version)—see the discussion on the thread mentioned above.

One of the suggestions was to update the csproj's AssetTargetFallback handling, which is what this PR does.

I'm hoping this PR will resolve https://github.com/rnmods/react-native-document-picker/issues/562

Test Plan

I can't figure out how to build the RNDocumentPicker project on my vscode 2019 (and I could use some help verifying that this PR resolves the 0.69.1 issues). For now, I'm punting and asking for someone who knows how to build/deploy to try building this so I can see if it resolves the issues.

What's required for testing (prerequisites)?

Try to build a UWP app that references RNDocumentPicker with react-native-windows 0.69.1 and no longer see builds fail due to issue 562.

What are the steps to reproduce (after prerequisites)?

Compatibility

OS Implemented
iOS
Android
WINDOWS!

Checklist

I'm getting 1>...\react-native-document-picker\windows\ReactNativeDocumentPicker\ReactNativeDocumentPicker.csproj(144,5): error : This project references targets in your node_modules\react-native-windows folder that are missing. The missing file is \node_modules\react-native-windows\\PropertySheets\External\Microsoft.ReactNative.Uwp.CSharpLib.props. and have no clue where or how to resolve that, for the project.

tero-paananen commented 2 years ago

AssetTargetFallback is removed, it was not needed then? Does this really build?

tero-paananen commented 2 years ago

My C# module builds with this kind of hacks on c# app (react-native-windows 0.68)

    <TargetPlatformVersion>10.0.19041.0</TargetPlatformVersion>
    <TargetPlatformMinVersion>10.0.18362.0</TargetPlatformMinVersion>

    <WindowsTargetPlatformVersion>10.0.19041.0</WindowsTargetPlatformVersion>
    <WindowsTargetPlatformMinVersion>10.0.18362.0</WindowsTargetPlatformMinVersion>

 <PropertyGroup Label="NuGet">
    <AssetTargetFallback>$(AssetTargetFallback);native</AssetTargetFallback>
  </PropertyGroup>

but i am not really sure what is valid solution.

EDIT: this is not yet final solution to get c# module build on c# app

EDIT: some kind of solution found https://github.com/microsoft/react-native-windows/issues/10059#issuecomment-1203531122