Async-storage: Can't use with windows.

Created on 27 Sep 2020  Â·  16Comments  Â·  Source: react-native-async-storage/async-storage

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

bug Windows

All 16 comments

I too am experiencing this issue

cc @kaiguo

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

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

@chrisglein

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

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 Filesnodejsnode.EXE
    Yarn: 2.0.0-rc.36 - C:Program Files (x86)Yarnbinyarn.CMD
    npm: 6.10.2 - C:Program Filesnodejsnpm.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

@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 Filesnodejsnode.EXE
npm: 6.10.2 - C:Program Filesnodejsnpm.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

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

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

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

<Target Name="Deploy"/>

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

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

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?

@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

Was this page helpful?
0 / 5 - 0 ratings

Related issues

cohawk picture cohawk  Â·  28Comments

muhammadn picture muhammadn  Â·  58Comments

StevenMasini picture StevenMasini  Â·  22Comments

dominiczaq picture dominiczaq  Â·  22Comments

mxmzb picture mxmzb  Â·  19Comments