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

Cannot read property 'setCookie' of undefined

Open vigneshprabhu20 opened this issue 7 years ago • 5 comments

I get this Unhandled JS Exception: Cannot read property 'setCookie' of undefined after upgrading to "react-native": "0.51.0", "react-native-cookie": "^0.2.0",

screen shot 2017-12-14 at 1 07 26 pm

vigneshprabhu20 avatar Dec 14 '17 07:12 vigneshprabhu20

  1. Close simulator
  2. link by: "react-native link react-native-cookie"
  3. run your app and the error should be gone!

alielmajdaoui avatar Dec 26 '17 22:12 alielmajdaoui

my build fails after doing "react-native link react-native-cookie", had to unlink to build successfully.

Any insight?

kevin074 avatar Apr 20 '18 20:04 kevin074

@kevin074 Please share the error log from console so that I can help you to figure out the solution.

vigneshprabhu20 avatar Apr 21 '18 12:04 vigneshprabhu20

I am getting a similar error. Below are the error log

** BUILD FAILED **

The following build commands failed: ProcessInfoPlistFile /Users/ipv/workspace/cookieTestApp/ios/build/Build/Products/Debug-iphonesimulator/RNCookieManagerTests.xctest/Info.plist RNCookieManagerTests/Info.plist (1 failure)

princesust avatar Apr 23 '18 10:04 princesust

In our iOS project we are using different schemes. Linking the react-native-cookie project did only link the library for the main scheme so I had to add it to the orthers manually:

In Xcode, click on your project, select your target -> Build Phases-> link Binary With Libraries and add libRNCookieManager.a

That did the trick for us.

BeHotSiii avatar Jun 04 '18 14:06 BeHotSiii