Skip to content

Can't use with windows. #448

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

Closed
Jablett opened this issue Sep 27, 2020 · 16 comments · Fixed by #463
Closed

Can't use with windows. #448

Jablett opened this issue Sep 27, 2020 · 16 comments · Fixed by #463
Labels
bug Something isn't working platform: Windows This is Windows specific

Comments

@Jablett
Copy link

Jablett commented Sep 27, 2020

Current behavior

Inside of the pch.h file its states it cant open source file: #include "winrt/ReactNativeAsyncStorage.h"

nope that sorted it self out now I get: ReactNativeAsyncStorage.vcxproj : error MSB4057: The target "Deploy" does not exist in the project

@albertoaayala
Copy link

I too am experiencing this issue

@krizzu
Copy link
Member

krizzu commented Oct 2, 2020

cc @kaiguo

@exotexot
Copy link

exotexot commented Oct 9, 2020

ReactNativeAsyncStorage.vcxproj : error MSB4057: The target "Deploy" does not exist in the project

Please check under Solution Properties ->Configuration Properties -> Uncheck "Deploy" from AsyncStorage

@kaiguo
Copy link
Contributor

kaiguo commented Oct 9, 2020

@chrisglein

@chrisglein
Copy link
Contributor

Can you run the following commands so we know more about the environment you're running this in?
npx react-native --version
npx react-native run-windows --info

@LionelHoudelier
Copy link

For me:

  1. RN : 4.13.0
  2. System:
    OS: Windows 10 10.0.19041
    CPU: (24) x64 AMD Ryzen 9 3900XT 12-Core Processor
    Memory: 20.82 GB / 31.91 GB
    Binaries:
    Node: 12.9.1 - C:\Program Files\nodejs\node.EXE
    Yarn: 2.0.0-rc.36 - C:\Program Files (x86)\Yarn\bin\yarn.CMD
    npm: 6.10.2 - C:\Program Files\nodejs\npm.CMD
    npmPackages:
    @react-native-community/cli: ^4.10.0 => 4.13.0
    react: ^16.13.1 => 16.13.1
    react-native: ^0.63.3 => 0.63.3
    react-native-windows: ^0.63.0-0 => 0.63.4
    Installed UWP SDKs:
    10.0.18362.0

@albertoaayala
Copy link

@exotexot unable to check deploy and it's also not selected
@chrisglein
npx react-native --version:
4.13.0
npx react-native run-windows --info:
System:
OS: Windows 10 10.0.19041
CPU: (8) x64 Intel(R) Core(TM) i7-8565U CPU @ 1.80GHz
Memory: 1.54 GB / 15.77 GB
Binaries:
Node: 12.9.1 - C:\Program Files\nodejs\node.EXE
npm: 6.10.2 - C:\Program Files\nodejs\npm.CMD
npmPackages:
react: 16.13.1 => 16.13.1
react-native: 0.63.2 => 0.63.2
react-native-windows: ^0.63.0-0 => 0.63.3
Installed UWP SDKs:
10.0.17763.0
10.0.18362.0

@andreleon
Copy link

andreleon commented Oct 14, 2020

I am having the same issue as @albertoaayala. And I am also unable to change "deploy" on asyncstorage in the solution properties.

I am however able to run the project with AsyncStorage working when I build my solution with Visual Studio 2019, not the command line npx react-native run-windows

@tido64
Copy link
Member

tido64 commented Oct 14, 2020

@chrisglein: Correct me if I'm wrong but this looks like we need to add support for RNW 0.62+. Is this something you (or your team) can handle?

@chrisglein
Copy link
Contributor

@chrisglein: Correct me if I'm wrong but this looks like we need to add support for RNW 0.62+. Is this something you (or your team) can handle?

I've created a tracking issue in the RNW repo and we'll get someone to look at it.

@asklar
Copy link

asklar commented Oct 15, 2020

Can you add the following to the project (just anywhere towards the bottom, right before </Project>:

<Target Name="Deploy"/>

@chrisglein
Copy link
Contributor

@andreleon and @albertoaayala and @LionelHoudelier does that fix unblock you?
We're also trying to figure out if something broke alongside an upgrade so if you have any context on when you hit this that'd be helpful.

@LionelHoudelier
Copy link

LionelHoudelier commented Oct 15, 2020

@exotexot : Uncheck "Deploy" from AsyncStorage did not work for me.

@ALL : I've fixed it like that (all steps): this works on RN 0.62.2, I am not sure on 63.3

  • create a C# based project through react-native-windows-init --language cs
    I find it better than a C++ (default) because you can add C++ projects in your C# based project, but not C# projects in C++ based project. And the Nuget library I was looking for exists only for C#, for example.
  • add then a C++/WinRT project in Visual Studio in your solution.
  • in App.xaml.cs: add PackageProviders.Add(new ReactNativeAsyncStorage.ReactPackageProvider()); under Microsoft.ReactNative.Managed.AutolinkedNativeModules.RegisterAutolinkedNativeModulePackages(PackageProviders); . That line was missing for me and gave the "... target "Deploy"..." error.
  • in App.cpp: add PackageProviders().Append(winrt::ReactNativeAsyncStorage::ReactPackageProvider());just before InitializeComponent();
  • in pch.h: add #include "winrt/ReactNativeAsyncStorage.h"
  • clean and build

find another description here #367

@exotexot
Copy link

@exotexot : Uncheck "Deploy" from AsyncStorage did not work for me.

@ALL : I've fixed it like that (all steps): this works on RN 0.62.2, I am not sure on 63.3

  • create a C# based project through react-native-windows-init --language cs
    I find it better than a C++ (default) because you can add C++ projects in your C# based project, but not C# projects in C++ based project. And the Nuget library I was looking for exists only for C#, for example.

That’s incorrect. you Should use c++ based projects as they perform much better and you CAN add c# modules within a c++ environment.

@LionelHoudelier
Copy link

Yes you're right. but the problem was installing the C# Couchbase.Lite Package from NuGet in my C++ solution, even with a C# subproject in the solution but i mess something maybe. I tried this long, a long time ago and with the c# it was direct fine. Do you know if it would work?

@albertoaayala
Copy link

@chrisglein Yes what @asklar said to try has unblocked me. I am able to build my react-native windows project.
Issue occurred when handling the manual linking found here

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working platform: Windows This is Windows specific
Projects
None yet
Development

Successfully merging a pull request may close this issue.

10 participants