react-native-gesture-handler
react-native-gesture-handler copied to clipboard
Add initial Windows implementation.
Description
Adds initial support for react-native-windows.
The more advanced customization options for each gesture recognizer were not implemented as part of this initial pass.
They will be implemented later as needed.
Also this implementation is being done on behalf of Microsoft.
For context: https://github.com/microsoft/react-native-windows/issues/4140
Test plan
Testing was done manually via the UWP simulator.
I've attached some screen recordings of the gestures working under the emulator.
These test examples will be added to react-native-gallery too.
Examples

I partially reviewed it but I have limited knowledge about C++ and RN bindings for it.
Thanks for the review, I have addressed your feedback and also fixed some other issues with the fling gesture as well as some edge cases in the end states for some gestures.
Let me know if there is anything else and I'll be glad to fix it.
- Why do we have 2 files like
RNGestureHandler62.sln,RNGestureHandler63.sln? I'm not familiar with VS, it was autogenerated with two RN versions?
It needs different solutions depending on which react-native-windows version we are using. It's my understanding that the newer versions provide extra MSBuild files which we include for the automatic build setup. These are part of the template we have been using for bootstrapping these modules.
Last push was to address a Yarn vs NPM issue on the lock file, should be good to go.
Just realized I had missed some comments due to them being hidden by GitHub by default, pushed a fix.
I see, it'd be nice to have this automated since I assume this only can be done from a Windows machine.
The solution files should never need to be modified going forward so I don't think this is a big concern. Alternatively, I can just remove the one for 0.62, and we can just leave the one for 0.63+ going forward.
One request from me: could you please avoid force pushing? We already use squash & merge and filtering by new commits is really helpful.
Sure.
Update: We want to merge it but I need to test it on my local machine before that. I'm planning to do that in the next week.
Hi, sorry for the delay. I was unable to run rngallery project so I'm not able to check if your PR is working. Would you mind adding windows specific files and quick instruction to the Example README about generating those files? Also, I think README from windows/ directory should be moved directly into documentation, maybe on the installation page.
Below is a list of compile errors from rngallery, maybe you know why those happen? (I was building via Build > Build rngallery)
Severity Code Description Project File Line Suppression State
Error C2220 the following warning is treated as an error (compiling source file C:\Users\jgonet\Documents\Projects\react-native-gallery\node_modules\react-native\ReactCommon\cxxreact\Instance.cpp) ReactCommon C:\Users\jgonet\Documents\Projects\react-native-gallery\node_modules\react-native\ReactCommon\runtimeexecutor\ReactCommon\RuntimeExecutor.h 42
Warning C4834 discarding return value of function with 'nodiscard' attribute (compiling source file C:\Users\jgonet\Documents\Projects\react-native-gallery\node_modules\react-native\ReactCommon\cxxreact\Instance.cpp) ReactCommon C:\Users\jgonet\Documents\Projects\react-native-gallery\node_modules\react-native\ReactCommon\runtimeexecutor\ReactCommon\RuntimeExecutor.h 42
Error C2220 the following warning is treated as an error (compiling source file C:\Users\jgonet\Documents\Projects\react-native-gallery\node_modules\react-native\ReactCommon\cxxreact\CxxNativeModule.cpp) ReactCommon C:\Users\jgonet\Documents\Projects\react-native-gallery\node_modules\react-native\ReactCommon\runtimeexecutor\ReactCommon\RuntimeExecutor.h 42
Warning C4834 discarding return value of function with 'nodiscard' attribute (compiling source file C:\Users\jgonet\Documents\Projects\react-native-gallery\node_modules\react-native\ReactCommon\cxxreact\CxxNativeModule.cpp) ReactCommon C:\Users\jgonet\Documents\Projects\react-native-gallery\node_modules\react-native\ReactCommon\runtimeexecutor\ReactCommon\RuntimeExecutor.h 42
Error C2220 the following warning is treated as an error (compiling source file C:\Users\jgonet\Documents\Projects\react-native-gallery\node_modules\react-native\ReactCommon\cxxreact\NativeToJsBridge.cpp) ReactCommon C:\Users\jgonet\Documents\Projects\react-native-gallery\node_modules\react-native\ReactCommon\runtimeexecutor\ReactCommon\RuntimeExecutor.h 42
Warning C4834 discarding return value of function with 'nodiscard' attribute (compiling source file C:\Users\jgonet\Documents\Projects\react-native-gallery\node_modules\react-native\ReactCommon\cxxreact\NativeToJsBridge.cpp) ReactCommon C:\Users\jgonet\Documents\Projects\react-native-gallery\node_modules\react-native\ReactCommon\runtimeexecutor\ReactCommon\RuntimeExecutor.h 42
Error MSB4181 The "CompileXaml" task returned false but did not log an error. ReactCommon C:\Program Files (x86)\Windows Kits\10\bin\10.0.18362.0\XamlCompiler\Microsoft.Windows.UI.Xaml.Common.targets 482
Error C2220 the following warning is treated as an error (compiling source file C:\Users\jgonet\Documents\Projects\react-native-gallery\node_modules\react-native-windows\Shared\InstanceManager.cpp) Microsoft.ReactNative C:\Users\jgonet\Documents\Projects\react-native-gallery\node_modules\react-native\ReactCommon\runtimeexecutor\ReactCommon\RuntimeExecutor.h 42
Warning C4834 discarding return value of function with 'nodiscard' attribute (compiling source file C:\Users\jgonet\Documents\Projects\react-native-gallery\node_modules\react-native-windows\Shared\InstanceManager.cpp) Microsoft.ReactNative C:\Users\jgonet\Documents\Projects\react-native-gallery\node_modules\react-native\ReactCommon\runtimeexecutor\ReactCommon\RuntimeExecutor.h 42
Error C2220 the following warning is treated as an error (compiling source file C:\Users\jgonet\Documents\Projects\react-native-gallery\node_modules\react-native-windows\Shared\Modules\NetworkingModule.cpp) Microsoft.ReactNative C:\Users\jgonet\Documents\Projects\react-native-gallery\node_modules\react-native\ReactCommon\runtimeexecutor\ReactCommon\RuntimeExecutor.h 42
Warning C4834 discarding return value of function with 'nodiscard' attribute (compiling source file C:\Users\jgonet\Documents\Projects\react-native-gallery\node_modules\react-native-windows\Shared\Modules\NetworkingModule.cpp) Microsoft.ReactNative C:\Users\jgonet\Documents\Projects\react-native-gallery\node_modules\react-native\ReactCommon\runtimeexecutor\ReactCommon\RuntimeExecutor.h 42
Error C2220 the following warning is treated as an error (compiling source file C:\Users\jgonet\Documents\Projects\react-native-gallery\node_modules\react-native-windows\Shared\Modules\WebSocketModule.cpp) Microsoft.ReactNative C:\Users\jgonet\Documents\Projects\react-native-gallery\node_modules\react-native\ReactCommon\runtimeexecutor\ReactCommon\RuntimeExecutor.h 42
Warning C4834 discarding return value of function with 'nodiscard' attribute (compiling source file C:\Users\jgonet\Documents\Projects\react-native-gallery\node_modules\react-native-windows\Shared\Modules\WebSocketModule.cpp) Microsoft.ReactNative C:\Users\jgonet\Documents\Projects\react-native-gallery\node_modules\react-native\ReactCommon\runtimeexecutor\ReactCommon\RuntimeExecutor.h 42
Error C2220 the following warning is treated as an error (compiling source file C:\Users\jgonet\Documents\Projects\react-native-gallery\node_modules\react-native-windows\Shared\OInstance.cpp) Microsoft.ReactNative C:\Users\jgonet\Documents\Projects\react-native-gallery\node_modules\react-native\ReactCommon\runtimeexecutor\ReactCommon\RuntimeExecutor.h 42
Warning C4834 discarding return value of function with 'nodiscard' attribute (compiling source file C:\Users\jgonet\Documents\Projects\react-native-gallery\node_modules\react-native-windows\Shared\OInstance.cpp) Microsoft.ReactNative C:\Users\jgonet\Documents\Projects\react-native-gallery\node_modules\react-native\ReactCommon\runtimeexecutor\ReactCommon\RuntimeExecutor.h 42
Error C2220 the following warning is treated as an error (compiling source file Modules\Animated\NativeAnimatedModule.cpp) Microsoft.ReactNative C:\Users\jgonet\Documents\Projects\react-native-gallery\node_modules\react-native\ReactCommon\runtimeexecutor\ReactCommon\RuntimeExecutor.h 42
Warning C4834 discarding return value of function with 'nodiscard' attribute (compiling source file Modules\Animated\NativeAnimatedModule.cpp) Microsoft.ReactNative C:\Users\jgonet\Documents\Projects\react-native-gallery\node_modules\react-native\ReactCommon\runtimeexecutor\ReactCommon\RuntimeExecutor.h 42
Error C2220 the following warning is treated as an error (compiling source file Modules\LinkingManagerModule.cpp) Microsoft.ReactNative C:\Users\jgonet\Documents\Projects\react-native-gallery\node_modules\react-native\ReactCommon\runtimeexecutor\ReactCommon\RuntimeExecutor.h 42
Warning C4834 discarding return value of function with 'nodiscard' attribute (compiling source file Modules\LinkingManagerModule.cpp) Microsoft.ReactNative C:\Users\jgonet\Documents\Projects\react-native-gallery\node_modules\react-native\ReactCommon\runtimeexecutor\ReactCommon\RuntimeExecutor.h 42
Error C2220 the following warning is treated as an error (compiling source file Modules\LogBoxModule.cpp) Microsoft.ReactNative C:\Users\jgonet\Documents\Projects\react-native-gallery\node_modules\react-native\ReactCommon\runtimeexecutor\ReactCommon\RuntimeExecutor.h 42
Warning C4834 discarding return value of function with 'nodiscard' attribute (compiling source file Modules\LogBoxModule.cpp) Microsoft.ReactNative C:\Users\jgonet\Documents\Projects\react-native-gallery\node_modules\react-native\ReactCommon\runtimeexecutor\ReactCommon\RuntimeExecutor.h 42
Error C2220 the following warning is treated as an error (compiling source file Modules\TimingModule.cpp) Microsoft.ReactNative C:\Users\jgonet\Documents\Projects\react-native-gallery\node_modules\react-native\ReactCommon\runtimeexecutor\ReactCommon\RuntimeExecutor.h 42
Warning C4834 discarding return value of function with 'nodiscard' attribute (compiling source file Modules\TimingModule.cpp) Microsoft.ReactNative C:\Users\jgonet\Documents\Projects\react-native-gallery\node_modules\react-native\ReactCommon\runtimeexecutor\ReactCommon\RuntimeExecutor.h 42
Error C2220 the following warning is treated as an error (compiling source file Modules\WebSocketModuleUwp.cpp) Microsoft.ReactNative C:\Users\jgonet\Documents\Projects\react-native-gallery\node_modules\react-native\ReactCommon\runtimeexecutor\ReactCommon\RuntimeExecutor.h 42
Warning C4834 discarding return value of function with 'nodiscard' attribute (compiling source file Modules\WebSocketModuleUwp.cpp) Microsoft.ReactNative C:\Users\jgonet\Documents\Projects\react-native-gallery\node_modules\react-native\ReactCommon\runtimeexecutor\ReactCommon\RuntimeExecutor.h 42
Error C2220 the following warning is treated as an error (compiling source file ReactHost\ReactContext.cpp) Microsoft.ReactNative C:\Users\jgonet\Documents\Projects\react-native-gallery\node_modules\react-native\ReactCommon\runtimeexecutor\ReactCommon\RuntimeExecutor.h 42
Warning C4834 discarding return value of function with 'nodiscard' attribute (compiling source file ReactHost\ReactContext.cpp) Microsoft.ReactNative C:\Users\jgonet\Documents\Projects\react-native-gallery\node_modules\react-native\ReactCommon\runtimeexecutor\ReactCommon\RuntimeExecutor.h 42
Error C2220 the following warning is treated as an error (compiling source file ReactHost\ReactInstanceWin.cpp) Microsoft.ReactNative C:\Users\jgonet\Documents\Projects\react-native-gallery\node_modules\react-native\ReactCommon\runtimeexecutor\ReactCommon\RuntimeExecutor.h 42
Warning C4834 discarding return value of function with 'nodiscard' attribute (compiling source file ReactHost\ReactInstanceWin.cpp) Microsoft.ReactNative C:\Users\jgonet\Documents\Projects\react-native-gallery\node_modules\react-native\ReactCommon\runtimeexecutor\ReactCommon\RuntimeExecutor.h 42
Error MSB4181 The "CompileXaml" task returned false but did not log an error. Microsoft.ReactNative C:\Program Files (x86)\Windows Kits\10\bin\10.0.18362.0\XamlCompiler\Microsoft.Windows.UI.Xaml.Common.targets 482
Error MSB3030 Could not copy the file "C:\Users\jgonet\Documents\Projects\react-native-gallery\node_modules\react-native-windows\build\ARM\Debug\Microsoft.ReactNative\Generated Files\DevMenuControl.xbf" because it was not found. RNDeviceInfoCPP C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\Microsoft\WindowsXaml\v16.0\8.21\Microsoft.Windows.UI.Xaml.Common.targets 131
Warning MSB3088 Could not read state file "ARM\Debug\DateTimePickerWindows.vcxprojAssemblyReference.cache". Attempting to deserialize an empty stream. DateTimePickerWindows C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\Current\Bin\Microsoft.Common.CurrentVersion.targets 2182
Error MSB3030 Could not copy the file "C:\Users\jgonet\Documents\Projects\react-native-gallery\node_modules\react-native-windows\build\ARM\Debug\Microsoft.ReactNative\Generated Files\DevMenuControl.xbf" because it was not found. SliderWindows C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\Microsoft\WindowsXaml\v16.0\8.21\Microsoft.Windows.UI.Xaml.Common.targets 131
Error MSB3030 Could not copy the file "C:\Users\jgonet\Documents\Projects\react-native-gallery\node_modules\react-native-windows\build\ARM\Debug\Microsoft.ReactNative\Generated Files\DevMenuControl.xbf" because it was not found. DateTimePickerWindows C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\Microsoft\WindowsXaml\v16.0\8.21\Microsoft.Windows.UI.Xaml.Common.targets 131
Error MSB3030 Could not copy the file "C:\Users\jgonet\Documents\Projects\react-native-gallery\node_modules\react-native-windows\build\ARM\Debug\Microsoft.ReactNative\Generated Files\DevMenuControl.xbf" because it was not found. Clipboard C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\Microsoft\WindowsXaml\v16.0\8.21\Microsoft.Windows.UI.Xaml.Common.targets 131
Error MSB3030 Could not copy the file "C:\Users\jgonet\Documents\Projects\react-native-gallery\node_modules\react-native-windows\build\ARM\Debug\Microsoft.ReactNative\Generated Files\DevMenuControl.xbf" because it was not found. CheckboxWindows C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\Microsoft\WindowsXaml\v16.0\8.21\Microsoft.Windows.UI.Xaml.Common.targets 131
Error MSB3030 Could not copy the file "C:\Users\jgonet\Documents\Projects\react-native-gallery\node_modules\react-native-windows\build\ARM\Debug\Microsoft.ReactNative\Generated Files\DevMenuControl.xbf" because it was not found. ReactNativePicker C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\Microsoft\WindowsXaml\v16.0\8.21\Microsoft.Windows.UI.Xaml.Common.targets 131
Error C1070 mismatched #if/#endif pair in file 'C:\Users\jgonet\Documents\Projects\react-native-gallery\node_modules\@terrylinla\react-native-sketch-canvas\windows\RNSketchCanvas\Generated Files\winrt\impl\Windows.UI.Xaml.Controls.2.h' RNSketchCanvas C:\Users\jgonet\Documents\Projects\react-native-gallery\node_modules\@terrylinla\react-native-sketch-canvas\windows\RNSketchCanvas\Generated Files\winrt\impl\Windows.UI.Xaml.Controls.2.h 59
Error MSB4181 The "CompileXaml" task returned false but did not log an error. RNSketchCanvas C:\Program Files (x86)\Windows Kits\10\bin\10.0.18362.0\XamlCompiler\Microsoft.Windows.UI.Xaml.Common.targets 482
Error MSB3030 Could not copy the file "C:\Users\jgonet\Documents\Projects\react-native-gallery\node_modules\react-native-windows\build\ARM\Debug\Microsoft.ReactNative\Generated Files\DevMenuControl.xbf" because it was not found. RNCConfig C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\Microsoft\WindowsXaml\v16.0\8.21\Microsoft.Windows.UI.Xaml.Common.targets 131
Error MIDL2011 [msg]unresolved type declaration [context]: Windows.UI.Xaml.Controls.Page [ RuntimeClass 'rngallery.MainPage' ] rngallery C:\Users\jgonet\Documents\Projects\react-native-gallery\windows\rngallery\MainPage.idl 5
I am not sure about those errors, but it seems like it is related to RNSketchCanvas. I also noticed you are compiling for ARM based on the output paths, that could be the issue.
Would you mind adding windows specific files and quick instruction to the Example README about generating those files?
Could you elaborate on this? I am not sure which files you refer to.
By the way, for testing the PR, you need to launch the gallery example inside the UWP Simulator. You can switch to it as a device target in VS.
@jakub-gonet I can try to help you get past the build errors with gallery. A couple of things to check....
- After you cloned the repo, did you run
yarnat the root of the repo? - When you open rngallery.sln in VS are you able to see the other projects loaded such as Microsoft.ReactNative or CheckboxWindows in addition to the rngallery project?
- Make sure you are building x86 or x64 as RNW no longer support ARM
I'm having some difficulty testing this on my local windows machine. I'm testing it through the example page in RNGallery - the solution is building fine and the examples are rendering as expected, however they don't seem to respond to touch interaction at all. I tried testing both on local machine and through the Simulator with no luck.
@tritao Any ideas as to what might be going on? Were you able to get this working in RNGallery?
Did you change the touch interaction modes in the Simulator side toolbar?
It's expected that it won't do anything on local machine with mouse pointing device.
You need to use the Simulator and select appropriate tool for each different gesture handler, see which ones I used for each on the screenshots.
Did you change the touch interaction modes in the Simulator side toolbar?
It's expected that it won't do anything on local machine with mouse pointing device.
You need to use the Simulator and select appropriate tool for each different gesture handler, see which ones I used for each on the screenshots.
@tritao I did and still nothing. Also tried on my local machine that has a touch screen but that didn't seem to work either.
I spent more time checking this and couldn't get it to work.
Errors I'm getting in VS:
- "One or more projects in the solution were not loaded correctly. Please see the Output Window for details."
- Ouput window:
C:\Users\jgonet\Documents\Projects\react-native-gesture-handler\windows\node_modules\react-native-windows\Common\Common.vcxproj : error : The project file could not be loaded. Could not find a part of the path 'C:\Users\jgonet\Documents\Projects\react-native-gesture-handler\windows\node_modules\react-native-windows\Common\Common.vcxproj'. C:\Users\jgonet\Documents\Projects\react-native-gesture-handler\windows\node_modules\react-native-windows\Common\Common.vcxproj C:\Users\jgonet\Documents\Projects\react-native-gesture-handler\windows\node_modules\react-native-windows\Folly\Folly.vcxproj : error : The project file could not be loaded. Could not find a part of the path 'C:\Users\jgonet\Documents\Projects\react-native-gesture-handler\windows\node_modules\react-native-windows\Folly\Folly.vcxproj'. C:\Users\jgonet\Documents\Projects\react-native-gesture-handler\windows\node_modules\react-native-windows\Folly\Folly.vcxproj C:\Users\jgonet\Documents\Projects\react-native-gesture-handler\windows\node_modules\react-native-windows\JSI\Universal\JSI.Universal.vcxproj : error : The project file could not be loaded. Could not find a part of the path 'C:\Users\jgonet\Documents\Projects\react-native-gesture-handler\windows\node_modules\react-native-windows\JSI\Universal\JSI.Universal.vcxproj'. C:\Users\jgonet\Documents\Projects\react-native-gesture-handler\windows\node_modules\react-native-windows\JSI\Universal\JSI.Universal.vcxproj C:\Users\jgonet\Documents\Projects\react-native-gesture-handler\windows\node_modules\react-native-windows\JSI\Shared\JSI.Shared.vcxitems : error : Project "C:\Users\jgonet\Documents\Projects\react-native-gesture-handler\windows\node_modules\react-native-windows\JSI\Shared\JSI.Shared.vcxitems" could not be found. C:\Users\jgonet\Documents\Projects\react-native-gesture-handler\windows\node_modules\react-native-windows\Chakra\Chakra.vcxitems : error : Project "C:\Users\jgonet\Documents\Projects\react-native-gesture-handler\windows\node_modules\react-native-windows\Chakra\Chakra.vcxitems" could not be found. C:\Users\jgonet\Documents\Projects\react-native-gesture-handler\windows\node_modules\react-native-windows\Microsoft.ReactNative\Microsoft.ReactNative.vcxproj : error : The project file could not be loaded. Could not find a part of the path 'C:\Users\jgonet\Documents\Projects\react-native-gesture-handler\windows\node_modules\react-native-windows\Microsoft.ReactNative\Microsoft.ReactNative.vcxproj'. C:\Users\jgonet\Documents\Projects\react-native-gesture-handler\windows\node_modules\react-native-windows\Microsoft.ReactNative\Microsoft.ReactNative.vcxproj C:\Users\jgonet\Documents\Projects\react-native-gesture-handler\windows\node_modules\react-native-windows\Mso\Mso.vcxitems : error : Project "C:\Users\jgonet\Documents\Projects\react-native-gesture-handler\windows\node_modules\react-native-windows\Mso\Mso.vcxitems" could not be found. C:\Users\jgonet\Documents\Projects\react-native-gesture-handler\windows\node_modules\react-native-windows\ReactCommon\ReactCommon.vcxproj : error : The project file could not be loaded. Could not find a part of the path 'C:\Users\jgonet\Documents\Projects\react-native-gesture-handler\windows\node_modules\react-native-windows\ReactCommon\ReactCommon.vcxproj'. C:\Users\jgonet\Documents\Projects\react-native-gesture-handler\windows\node_modules\react-native-windows\ReactCommon\ReactCommon.vcxproj C:\Users\jgonet\Documents\Projects\react-native-gesture-handler\windows\node_modules\react-native-windows\Microsoft.ReactNative.Cxx\Microsoft.ReactNative.Cxx.vcxitems : error : Project "C:\Users\jgonet\Documents\Projects\react-native-gesture-handler\windows\node_modules\react-native-windows\Microsoft.ReactNative.Cxx\Microsoft.ReactNative.Cxx.vcxitems" could not be found. C:\Users\jgonet\Documents\Projects\react-native-gesture-handler\windows\node_modules\react-native-windows\Shared\Shared.vcxitems : error : Project "C:\Users\jgonet\Documents\Projects\react-native-gesture-handler\windows\node_modules\react-native-windows\Shared\Shared.vcxitems" could not be found. C:\Users\jgonet\Documents\Projects\react-native-gesture-handler\windows\node_modules\react-native- windows\include\Include.vcxitems : error : Project "C:\Users\jgonet\Documents\Projects\react-native- gesture-handler\windows\node_modules\react-native-windows\include\Include.vcxitems" could not be found.
Things I tried:
- Reinstalling dependencies needed by RNW:
$ iex (New-Object System.Net.WebClient).DownloadString('https://aka.ms/rnw-deps.ps1') Cannot use file stream for [C:\Program Files\dotnet\shared\Microsoft.NETCore.App\5.0.5\Microsoft.NETCore.App.deps.json]: Invalid argument A fatal error was encountered. The library 'hostpolicy.dll' required to execute the application was not found in 'C:\Program Files\dotnet\shared\Microsoft.NETCore.App\5.0.5'. Checking Free space on C: > 15 GB Failed (warn) Checking Installed memory >= 16 GB Failed (warn) Checking Windows version > 10.0.16299.0 OK Checking Developer mode is on OK Checking Long path support is enabled OK Checking Choco OK Checking git OK Checking Compilers, build tools, SDKs and Visual Studio OK Checking NodeJS lts installed OK Checking Chrome OK Checking Yarn OK Checking .net core 3.1 OK All mandatory requirements met yarn add -D [email protected]in thewindows/directory (README inwindows/directory is a bit unclear where this command should be run. Note that RNW wasn't installed there.- Errors are from missing
windows/node_modules/react-native-windows/dir so I copied it there and got a little bit further with errors below. I think this may be related to RN being in node_modules in the root of the repo and not inwindows/node_modules, but I didn't investigate that further.Severity Code Description Project File Line Suppression State Error MSB4181 The "CompileXaml" task returned false but did not log an error. RNGestureHandler C:\Program Files (x86)\Windows Kits\10\bin\10.0.18362.0\XamlCompiler\Microsoft.Windows.UI.Xaml.Common.targets 482 Error C1083 Cannot open include file: 'folly/portability/Config.h': No such file or directory (compiling source file C:\Users\jgonet\Documents\Projects\react-native-gesture-handler\windows\node_modules\react-native-windows\build\x64\Debug\ReactCommon\react-native-patched\ReactCommon\cxxreact\CxxNativeModule.cpp) ReactCommon C:\Users\jgonet\Documents\Projects\react-native-gesture-handler\node_modules\.folly\folly-2020.09.14.00\folly\CPortability.h 22 Error C1083 Cannot open include file: 'folly/portability/Config.h': No such file or directory (compiling source file C:\Users\jgonet\Documents\Projects\react-native-gesture-handler\windows\node_modules\react-native-windows\build\x64\Debug\ReactCommon\react-native-patched\ReactCommon\cxxreact\JSBundleType.cpp) ReactCommon C:\Users\jgonet\Documents\Projects\react-native-gesture-handler\node_modules\.folly\folly-2020.09.14.00\folly\CPortability.h 22 Error C1083 Cannot open include file: 'folly/portability/Config.h': No such file or directory (compiling source file C:\Users\jgonet\Documents\Projects\react-native-gesture-handler\windows\node_modules\react-native-windows\build\x64\Debug\ReactCommon\react-native-patched\ReactCommon\cxxreact\Instance.cpp) ReactCommon C:\Users\jgonet\Documents\Projects\react-native-gesture-handler\node_modules\.folly\folly-2020.09.14.00\folly\CPortability.h 22 Error C1083 Cannot open include file: 'folly/portability/Config.h': No such file or directory (compiling source file C:\Users\jgonet\Documents\Projects\react-native-gesture-handler\windows\node_modules\react-native-windows\build\x64\Debug\ReactCommon\react-native-patched\ReactCommon\cxxreact\JSExecutor.cpp) ReactCommon C:\Users\jgonet\Documents\Projects\react-native-gesture-handler\node_modules\.folly\folly-2020.09.14.00\folly\CPortability.h 22 Error C1083 Cannot open include file: 'folly/portability/Config.h': No such file or directory (compiling source file C:\Users\jgonet\Documents\Projects\react-native-gesture-handler\windows\node_modules\react-native-windows\build\x64\Debug\ReactCommon\react-native-patched\ReactCommon\cxxreact\JSIndexedRAMBundle.cpp) ReactCommon C:\Users\jgonet\Documents\Projects\react-native-gesture-handler\node_modules\.folly\folly-2020.09.14.00\folly\CPortability.h 22 Error C1083 Cannot open include file: 'folly/portability/Config.h': No such file or directory (compiling source file C:\Users\jgonet\Documents\Projects\react-native-gesture-handler\windows\node_modules\react-native-windows\build\x64\Debug\ReactCommon\react-native-patched\ReactCommon\cxxreact\ModuleRegistry.cpp) ReactCommon C:\Users\jgonet\Documents\Projects\react-native-gesture-handler\node_modules\.folly\folly-2020.09.14.00\folly\CPortability.h 22 Error C1083 Cannot open include file: 'folly/portability/Config.h': No such file or directory (compiling source file C:\Users\jgonet\Documents\Projects\react-native-gesture-handler\windows\node_modules\react-native-windows\build\x64\Debug\ReactCommon\react-native-patched\ReactCommon\cxxreact\NativeToJsBridge.cpp) ReactCommon C:\Users\jgonet\Documents\Projects\react-native-gesture-handler\node_modules\.folly\folly-2020.09.14.00\folly\CPortability.h 22 Error C1083 Cannot open include file: 'folly/portability/Config.h': No such file or directory (compiling source file C:\Users\jgonet\Documents\Projects\react-native-gesture-handler\windows\node_modules\react-native-windows\build\x64\Debug\ReactCommon\react-native-patched\ReactCommon\cxxreact\RAMBundleRegistry.cpp) ReactCommon C:\Users\jgonet\Documents\Projects\react-native-gesture-handler\node_modules\.folly\folly-2020.09.14.00\folly\CPortability.h 22 Error C1083 Cannot open include file: 'folly/portability/Config.h': No such file or directory (compiling source file C:\Users\jgonet\Documents\Projects\react-native-gesture-handler\windows\node_modules\react-native-windows\build\x64\Debug\ReactCommon\react-native-patched\ReactCommon\jsi\jsi\JSIDynamic.cpp) ReactCommon C:\Users\jgonet\Documents\Projects\react-native-gesture-handler\node_modules\.folly\folly-2020.09.14.00\folly\CPortability.h 22 Error C1083 Cannot open include file: 'folly/portability/Config.h': No such file or directory (compiling source file C:\Users\jgonet\Documents\Projects\react-native-gesture-handler\windows\node_modules\react-native-windows\build\x64\Debug\ReactCommon\react-native-patched\ReactCommon\jsiexecutor\jsireact\JSIExecutor.cpp) ReactCommon C:\Users\jgonet\Documents\Projects\react-native-gesture-handler\node_modules\.folly\folly-2020.09.14.00\folly\CPortability.h 22 Error C1083 Cannot open include file: 'folly/portability/Config.h': No such file or directory (compiling source file C:\Users\jgonet\Documents\Projects\react-native-gesture-handler\windows\node_modules\react-native-windows\build\x64\Debug\ReactCommon\react-native-patched\ReactCommon\jsiexecutor\jsireact\JSINativeModules.cpp) ReactCommon C:\Users\jgonet\Documents\Projects\react-native-gesture-handler\node_modules\.folly\folly-2020.09.14.00\folly\CPortability.h 22 Error C1083 Cannot open include file: 'folly/portability/Config.h': No such file or directory (compiling source file C:\Users\jgonet\Documents\Projects\react-native-gesture-handler\windows\node_modules\react-native-windows\build\x64\Debug\ReactCommon\react-native-patched\ReactCommon\turbomodule\core\TurboCxxModule.cpp) ReactCommon C:\Users\jgonet\Documents\Projects\react-native-gesture-handler\node_modules\.folly\folly-2020.09.14.00\folly\CPortability.h 22 Error C1083 Cannot open include file: 'folly/portability/Config.h': No such file or directory (compiling source file C:\Users\jgonet\Documents\Projects\react-native-gesture-handler\windows\node_modules\react-native-windows\build\x64\Debug\ReactCommon\react-native-patched\ReactCommon\turbomodule\core\TurboModuleUtils.cpp) ReactCommon C:\Users\jgonet\Documents\Projects\react-native-gesture-handler\node_modules\.folly\folly-2020.09.14.00\folly\CPortability.h 22 Error C1083 Cannot open include file: 'folly/portability/Config.h': No such file or directory (compiling source file C:\Users\jgonet\Documents\Projects\react-native-gesture-handler\windows\node_modules\react-native-windows\build\x64\Debug\ReactCommon\react-native-patched\ReactCommon\turbomodule\samples\SampleTurboCxxModule.cpp) ReactCommon C:\Users\jgonet\Documents\Projects\react-native-gesture-handler\node_modules\.folly\folly-2020.09.14.00\folly\CPortability.h 22 Error MSB4181 The "CompileXaml" task returned false but did not log an error. ReactCommon C:\Program Files (x86)\Windows Kits\10\bin\10.0.18362.0\XamlCompiler\Microsoft.Windows.UI.Xaml.Common.targets 482 Error LNK1104 cannot open file 'C:\Users\jgonet\Documents\Projects\react-native-gesture-handler\windows\node_modules\react-native-windows\target\x64\Debug\ReactCommon\ReactCommon.lib' Microsoft.ReactNative C:\Users\jgonet\Documents\Projects\react-native-gesture-handler\windows\node_modules\react-native-windows\Microsoft.ReactNative\LINK 1 Error C2065 'handlerKind': undeclared identifier RNGestureHandler C:\Users\jgonet\Documents\Projects\react-native-gesture-handler\windows\RNGestureHandler\RNGestureHandler\RNGestureHandlerModule.cpp 76
- If RNW doesn't support the ARM arch, please remove it from solutions.
- I don't think we need RN@62 solution so feel free to remove it.
- Windows should be runnable from
examples/Exampledirectory so we can test it on existing examples. How we can achieve that? - Installation instructions should be updated since it's not that straightforward to set up and run Windows examples.
- We shouldn't need to test it by running against Gallery app.
Facing similar issues. One thing I had to do was change:
<ReactNativeWindowsDir Condition="'$(ReactNativeWindowsDir)' == ''">$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), 'node_modules\react-native-windows\package.json'))\node_modules\react-native-windows\</ReactNativeWindowsDir>
To:
<ReactNativeWindowsDir Condition="'$(ReactNativeWindowsDir)' == ''">$([MSBuild]::GetDirectoryNameOfFileAbove($(SolutionDir), 'node_modules\react-native-windows\package.json'))\node_modules\react-native-windows\</ReactNativeWindowsDir>
This is a patch that we've had to do on quite a few Microsoft react-native-windows library implementations. Wondering if there is a reason you are using MSBuildThisFileDirectory over SolutionDir.
After fixing that, the error is now:
node_modules\react-native-gesture-handler\windows\RNGestureHandler\RNGestureHandler\RNGestureHandlerModule.cpp(76,21): error C2065: 'handlerKind': undeclared identifier