react-native-windows icon indicating copy to clipboard operation
react-native-windows copied to clipboard

Unable to build React-Native-Windows App that forces a target SDK >= 10.0.15063

Open adam-bratin opened this issue 8 years ago • 16 comments

Environment

  1. react-native -v: react-native-cli: 2.0.1, react-native: 0.52.0
  2. npm ls rnpm-plugin-windows: 0.2.8
  3. npm ls react-native-windows: 0.52.0-rc.0
  4. node -v: v9.4.0
  5. npm -v: 5.6.0
  6. yarn --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:)

  1. 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 avatar Feb 14 '18 21:02 adam-bratin

@adam-bratin - can you try upgrading Visual Studio to 15.5.6? I can't seem to reproduce the issue.

rozele avatar Feb 16 '18 19:02 rozele

@rozele - So when I go to visual studio installer there is no update for 15.5.6

adam-bratin avatar Feb 16 '18 19:02 adam-bratin

What is the output for msbuild /version? Maybe 15.5.6 is internal preview right now.

rozele avatar Feb 16 '18 19:02 rozele

15.5.180.51428

adam-bratin avatar Feb 16 '18 19:02 adam-bratin

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/

rozele avatar Feb 16 '18 19:02 rozele

@adam-bratin can you try to repro w/ [email protected] and [email protected]rc.2?

rozele avatar Feb 16 '18 19:02 rozele

@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.

adam-bratin avatar Feb 16 '18 20:02 adam-bratin

@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.

adam-bratin avatar Feb 16 '18 20:02 adam-bratin

@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

adam-bratin avatar Feb 19 '18 22:02 adam-bratin

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

eastcoastcoder avatar Feb 20 '18 14:02 eastcoastcoder

@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 avatar Feb 20 '18 19:02 rozele

@rozele Great. Thanks.

adam-bratin avatar Feb 20 '18 21:02 adam-bratin

@rozele The question still remains how to handle increasing the SDK target versions to support future windows 10 SDKs?

adam-bratin avatar Feb 20 '18 22:02 adam-bratin

@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.

rozele avatar Feb 22 '18 16:02 rozele

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]

mak3 avatar Feb 22 '18 18:02 mak3

I believe this is fixed now that a newer version of react-native-code-push has been released.

rozele avatar Jul 23 '18 22:07 rozele