Unable to build React-Native-Windows App that forces a target SDK >= 10.0.15063
Environment
react-native -v: react-native-cli: 2.0.1, react-native: 0.52.0npm ls rnpm-plugin-windows: 0.2.8npm ls react-native-windows: 0.52.0-rc.0node -v: v9.4.0npm -v: 5.6.0yarn --version: 1.3.2
Then, specify:
-
Target Platform: UWP
-
Target Platform Version(s): Target SDK: 10.0.16299 Min SDK: 10.0.15063
-
Target Device(s): Desktop
-
Development Operating System: Windows
-
Visual Studio Version: Visual Studio 2017 (15.5.5)
Steps to Reproduce
(Write your steps here:)
- Trying to run MSBuild /t:restore /t:Rebuild /p:Configuration=Release /p:Platform=x64
Expected Behavior
(Write what you thought would happen.) The project should successfully build and generate an Appxbundle
Actual Behavior
error NU1201: Project ReactNative is not compatible with uap10.0 (UAP,Version=v10.0). Project ReactNative supports: uap10.0.10240 (UAP,Version=v10.0.10240)
(Write what happened. Add screenshots!)
Reproducible Demo
Potential fix would be to retarget react-native-windows to have a target SDK Version of 10.0.15063.
Create a new react-native windows app and change the target sdk for the UWP to RS3 and the min tested SDK to RS2. Then try to run MSBuild /t:restore
@adam-bratin - can you try upgrading Visual Studio to 15.5.6? I can't seem to reproduce the issue.
@rozele - So when I go to visual studio installer there is no update for 15.5.6
What is the output for msbuild /version? Maybe 15.5.6 is internal preview right now.
15.5.180.51428
Okay - that's the same as what's available in 15.5.6 - also, should be generally available https://thewincentral.com/visual-studio-2017-version-15-5-6-released-full-changelog/
@adam-bratin can you try to repro w/ [email protected] and [email protected]rc.2?
@rozele So the wierd thing is if I try to create a react-native project from scratch and retarget the UWP to be max RS3 and min RS2 everything is fine. When I look at the logs from MSBuild more carefully it specifically is giving me the error in relation to react-native-code-push so it might be an issue with their code.
@rozele When I update their target SDK version to RS2 everything restore correctly. I think the major issue still applies as was discussed in offline conversation. It might be a good practice to update SDK target for React Native code to keep up with the currently shipped OS version available to customers. This will also trigger 3rd party developers to try and follow the cadence pattern set by react-native-windows. All of this will allow application developers to specifically need to add UWP features only available in newer SDK versions to still be able to build their application without issue.
@rozele If you want to see a easy repro of this issue I create a bare bones project at https://github.com/adam-bratin/ReactNativeTest
I had the same issue with two modules I was using. For some reason "uap10.0" doesn't seem to be valid. Instead I had to modify the project.json files for those modules to point to something slightly higher like 10240 or 10586. I'm not sure if this is the proper way to fix it but that's exactly what I did. https://github.com/craftzdog/react-native-sqlite-2/pull/24 https://github.com/itinance/react-native-fs/pull/447
@adam-bratin I have a pending PR fix for react-native-code-push. If you look at the pattern there, any other modules that give you trouble can be fixed in a similar way. I still wasn't able to get your app running because the generated signing cert was not valid on my machine (I probably just need to add it from Visual Studio). I also published the test fix to your test repo.
@rozele Great. Thanks.
@rozele The question still remains how to handle increasing the SDK target versions to support future windows 10 SDKs?
@adam-bratin I don't think there's any issue with the SDK target versions not aligning. The changes I made to code-push to fix your branch were only to the relative path for the dependency from react-native-code-push to react-native-windows. I happened to also remove the use of project.json in the same go, but if you notice, react-native-code-push still targets TH2.
Should it work with newer SDK than Anniversary Update or you're talking about something else? For me it is still complaining about lack of 14393. [email protected]
I believe this is fixed now that a newer version of react-native-code-push has been released.