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

TypeError: Cannot read property 'setItem' of undefined #3

Open
trungkhtn opened this Issue May 15, 2018 · 5 comments

Comments

Projects
None yet
5 participants
@trungkhtn
Copy link

trungkhtn commented May 15, 2018

TypeError: Cannot read property 'setItem' of undefined
at blob:http://localhost:8081/bd2a2115-02cc-483d-ab32-573d0bc91e36:87762:55
at tryCallTwo (blob:http://localhost:8081/bd2a2115-02cc-483d-ab32-573d0bc91e36:3524:7)
at doResolve (blob:http://localhost:8081/bd2a2115-02cc-483d-ab32-573d0bc91e36:3688:15)
at new Promise (blob:http://localhost:8081/bd2a2115-02cc-483d-ab32-573d0bc91e36:3547:5)
at Function.setItem$ (blob:http://localhost:8081/bd2a2115-02cc-483d-ab32-573d0bc91e36:87757:51)
at tryCatch (blob:http://localhost:8081/bd2a2115-02cc-483d-ab32-573d0bc91e36:16751:19)
at Generator.invoke [as _invoke] (blob:http://localhost:8081/bd2a2115-02cc-483d-ab32-573d0bc91e36:16924:24)
at Generator.prototype.(anonymous function) [as next] (blob:http://localhost:8081/bd2a2115-02cc-483d-ab32-573d0bc91e36:16794:23)
at tryCatch (blob:http://localhost:8081/bd2a2115-02cc-483d-ab32-573d0bc91e36:16751:19)
at invoke (blob:http://localhost:8081/bd2a2115-02cc-483d-ab32-573d0bc91e36:16827:22)

react native info:

Environment:
OS: macOS High Sierra 10.13.4
Node: 9.8.0
Yarn: 1.5.1
npm: 5.6.0
Watchman: 4.9.0
Xcode: Xcode 9.3 Build version 9E145
Android Studio: 3.1 AI-173.4697961

Packages: (wanted => installed)
react: 16.3.1 => 16.3.1
react-native: 0.55.3 => 0.55.3

package.json:
"react": "16.3.1",
"react-native": "0.55.3",
"react-native-shared-group-preferences": "^1.0.6",

@trungkhtn

This comment has been minimized.

Copy link
Author

trungkhtn commented May 17, 2018

help me!!!

@KjellConnelly

This comment has been minimized.

Copy link
Owner

KjellConnelly commented May 17, 2018

You haven’t given enough of a description to help you. I don’t know what the problem is. You’ve given one vague error message and not even described what you’re trying to do and what you’ve tried/haven’t tried.

Btw: this package works for me for my React Native app on version 0.41. If you look through the logs, you’ll see that this never changed. So if there are conflicts with a newer version of RN, I won’t be able to test it as my codebase is stuck far behind the current version.

@MartXXIII

This comment has been minimized.

Copy link

MartXXIII commented Jul 24, 2018

You probably didn't link the library through Xcode under build phases!
React-native link does not link the library properly so you need to link it under "Link binary with Libraries"! Hope this helps! Cheers

@antonkovernik

This comment has been minimized.

Copy link

antonkovernik commented Nov 12, 2018

TypeError: Cannot read property 'setItem' of undefined
at blob:http://localhost:8081/bd2a2115-02cc-483d-ab32-573d0bc91e36:87762:55
at tryCallTwo (blob:http://localhost:8081/bd2a2115-02cc-483d-ab32-573d0bc91e36:3524:7)
at doResolve (blob:http://localhost:8081/bd2a2115-02cc-483d-ab32-573d0bc91e36:3688:15)
at new Promise (blob:http://localhost:8081/bd2a2115-02cc-483d-ab32-573d0bc91e36:3547:5)
at Function.setItem$ (blob:http://localhost:8081/bd2a2115-02cc-483d-ab32-573d0bc91e36:87757:51)
at tryCatch (blob:http://localhost:8081/bd2a2115-02cc-483d-ab32-573d0bc91e36:16751:19)
at Generator.invoke [as _invoke] (blob:http://localhost:8081/bd2a2115-02cc-483d-ab32-573d0bc91e36:16924:24)
at Generator.prototype.(anonymous function) [as next] (blob:http://localhost:8081/bd2a2115-02cc-483d-ab32-573d0bc91e36:16794:23)
at tryCatch (blob:http://localhost:8081/bd2a2115-02cc-483d-ab32-573d0bc91e36:16751:19)
at invoke (blob:http://localhost:8081/bd2a2115-02cc-483d-ab32-573d0bc91e36:16827:22)

react native info:

Environment:
OS: macOS High Sierra 10.13.4
Node: 9.8.0
Yarn: 1.5.1
npm: 5.6.0
Watchman: 4.9.0
Xcode: Xcode 9.3 Build version 9E145
Android Studio: 3.1 AI-173.4697961

Packages: (wanted => installed)
react: 16.3.1 => 16.3.1
react-native: 0.55.3 => 0.55.3

package.json:
"react": "16.3.1",
"react-native": "0.55.3",
"react-native-shared-group-preferences": "^1.0.6",

TypeError: Cannot read property 'setItem' of undefined
at blob:http://localhost:8081/bd2a2115-02cc-483d-ab32-573d0bc91e36:87762:55
at tryCallTwo (blob:http://localhost:8081/bd2a2115-02cc-483d-ab32-573d0bc91e36:3524:7)
at doResolve (blob:http://localhost:8081/bd2a2115-02cc-483d-ab32-573d0bc91e36:3688:15)
at new Promise (blob:http://localhost:8081/bd2a2115-02cc-483d-ab32-573d0bc91e36:3547:5)
at Function.setItem$ (blob:http://localhost:8081/bd2a2115-02cc-483d-ab32-573d0bc91e36:87757:51)
at tryCatch (blob:http://localhost:8081/bd2a2115-02cc-483d-ab32-573d0bc91e36:16751:19)
at Generator.invoke [as _invoke] (blob:http://localhost:8081/bd2a2115-02cc-483d-ab32-573d0bc91e36:16924:24)
at Generator.prototype.(anonymous function) [as next] (blob:http://localhost:8081/bd2a2115-02cc-483d-ab32-573d0bc91e36:16794:23)
at tryCatch (blob:http://localhost:8081/bd2a2115-02cc-483d-ab32-573d0bc91e36:16751:19)
at invoke (blob:http://localhost:8081/bd2a2115-02cc-483d-ab32-573d0bc91e36:16827:22)

react native info:

Environment:
OS: macOS High Sierra 10.13.4
Node: 9.8.0
Yarn: 1.5.1
npm: 5.6.0
Watchman: 4.9.0
Xcode: Xcode 9.3 Build version 9E145
Android Studio: 3.1 AI-173.4697961

Packages: (wanted => installed)
react: 16.3.1 => 16.3.1
react-native: 0.55.3 => 0.55.3

package.json:
"react": "16.3.1",
"react-native": "0.55.3",
"react-native-shared-group-preferences": "^1.0.6",

Dude you have to invoke: react-native link react-native-shared-group-preferences

@JonJee

This comment has been minimized.

Copy link

JonJee commented Jan 26, 2019

@MartXXIII Thanks. It works

In my case, the error happens in today widget extension.
TypeError: Cannot read property 'setItem' of undefined

I linked libRNReactNativeSharedGroupPreferences.a library directly in today widget extension TARGETS, then the error disappeared.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment