Git Product home page Git Product logo

Comments (28)

ManAnRuck avatar ManAnRuck commented on May 21, 2024 3

@mrousavy I can confirm, that it was happening only in Release build mode.

Clearing project doesn't solved it.
An upgrade to 0.64.0-rc.3 doesn't solved it.
react-native-mmkv 1.0.4 doesn't solved it.

increase platform target from 10 to 11 solved it πŸ‘πŸΌ
(with both react-native-mmkv versions also with rn 0.63 & 0.64)

For me, the platform target is totally fine. I like this package πŸ˜ƒ thank you

from react-native-mmkv.

gavinmahan avatar gavinmahan commented on May 21, 2024 3

@mrousavy here is a fresh new project with only react-native-mmkv installed, rn v0.64.0.rc.4 https://github.com/KingAmo/test-react-native-mmkv , I can not archive success using XCode

***/ios/Pods/Headers/Public/React-jsi/jsi/jsi.h:934:43: Use of undeclared identifier 'kindOf'

Since I started this issue I figured I'd give your app a try. Changing the iOS Deployment Target to 11 seems to work for your app:

From a fresh download of your app:

npm install
cd ios && pod install && cd ..
open ios/linyue.xcworkspace

IN XCODE

Select pods from the menu on the left
In the targets drop down select react-native-mmkv
Select Build Settings
Change the iOS Deployment Target to 11

Click on linyue at the top and select Edit Scheme
Change Build Configuration to Release

Press the Build & Run button and wait.

Seems like if I do pod install again I have to set the iOS Deployment Target to 11 again.

from react-native-mmkv.

mrousavy avatar mrousavy commented on May 21, 2024 3

@gavinmahan you're a legend.

@KingAmo @frodoe7 I have just published 1.0.6 to npm which specifies iOS 11 in the podspec, let's see if that works for you

from react-native-mmkv.

frodoe7 avatar frodoe7 commented on May 21, 2024 2

Thanks @mrousavy
it solved now in this version 1.0.6 πŸ‘

from react-native-mmkv.

gavinmahan avatar gavinmahan commented on May 21, 2024 1

I have to test it more but changing the iOS Deployment Target to 11.0 seems to have resolved the issue.

from react-native-mmkv.

mrousavy avatar mrousavy commented on May 21, 2024 1

I cannot reproduce this issue, just tried to delete all cache and clean build folder to rebuild in Release mode, and everything works fine on my end (RN 0.64).

What RN version are you on?

Make sure you installed the latest version of react-native-mmkv (1.0.3)

from react-native-mmkv.

gavinmahan avatar gavinmahan commented on May 21, 2024 1

Could just have been my set up. I tried it with a brand new app app installed yesterday so I assume it was the latest version of react. Who knows, it’s working perfectly now, thanks!

from react-native-mmkv.

KingAmo avatar KingAmo commented on May 21, 2024 1

@mrousavy here is a fresh new project with only react-native-mmkv installed, rn v0.64.0.rc.4 https://github.com/KingAmo/test-react-native-mmkv , I can not archive success using XCode

***/ios/Pods/Headers/Public/React-jsi/jsi/jsi.h:934:43: Use of undeclared identifier 'kindOf'

...

from react-native-mmkv.

KingAmo avatar KingAmo commented on May 21, 2024 1

@gavinmahan yes! i build success follow your steps! thanks a lot. but i am curious why this works?

from react-native-mmkv.

focux avatar focux commented on May 21, 2024 1

@mrousavy here is a fresh new project with only react-native-mmkv installed, rn v0.64.0.rc.4 https://github.com/KingAmo/test-react-native-mmkv , I can not archive success using XCode

***/ios/Pods/Headers/Public/React-jsi/jsi/jsi.h:934:43: Use of undeclared identifier 'kindOf'

Since I started this issue I figured I'd give your app a try. Changing the iOS Deployment Target to 11 seems to work for your app:

From a fresh download of your app:

npm install
cd ios && pod install && cd ..
open ios/linyue.xcworkspace

IN XCODE

Select pods from the menu on the left
In the targets drop down select react-native-mmkv
Select Build Settings
Change the iOS Deployment Target to 11

Click on linyue at the top and select Edit Scheme
Change Build Configuration to Release

Press the Build & Run button and wait.

Seems like if I do pod install again I have to set the iOS Deployment Target to 11 again.

That did the trick for me. Thank you. For the others, just make sure to change the deployment target to the Pod and not to the whole app like I was doing first.

from react-native-mmkv.

KingAmo avatar KingAmo commented on May 21, 2024

react-native-mmkv v1.0.0 is ok. v1.0.1 && v1.0.2 has this error

from react-native-mmkv.

mrousavy avatar mrousavy commented on May 21, 2024

I think you have to clean & rebuild. Open Xcode and hit "Clean Build Folder", then run those commands:

rm -rf node_modules/react-native-mmkv
rm -rf package-lock.json
rm -rf ios/Pods
rm -rf ios/Podfile.lock
npm i
cd ios
pod install

and finally build your app

from react-native-mmkv.

gavinmahan avatar gavinmahan commented on May 21, 2024

Tried all of that and have the same issues.

from react-native-mmkv.

mrousavy avatar mrousavy commented on May 21, 2024

Hmm, the compiler options for debug don't seem to have any important changes compared to the options for release except the GCC_PREPROCESSOR_DEFINITIONS = $(inherited) πŸ€”πŸ€”
Could you maybe try playing around with those values? The file you're searching for is in node_modules/react-native-mmkv/ios/Mmkv.xcodeproj/project.pbxproj - after every change you have to pod install

from react-native-mmkv.

mrousavy avatar mrousavy commented on May 21, 2024

Another idea: Open Mmkv.mm in Xcode, go to line 72

            return jsi::String::createFromUtf8(runtime, value.UTF8String);

replace that with:

            return convertNSStringToJSIString(runtime, value);

see if that changes anything.

from react-native-mmkv.

gavinmahan avatar gavinmahan commented on May 21, 2024

Did not seem to change anything. I also tried many attempts at changing the compiler options to no avail.

from react-native-mmkv.

ManAnRuck avatar ManAnRuck commented on May 21, 2024

I've the same issue with RN 0.63.4 and react-native-mmkv 1.0.3

react-native-mmkv Group
Semantic Issue Group
/MY_LOCAL_PATH/App/ios/Pods/Headers/Public/React-jsi/jsi/jsi.h:933:43: Use of undeclared identifier 'kindOf'
/MY_LOCAL_PATH/App/node_modules/react-native-mmkv/ios/Mmkv.mm:2:9: In file included from /MY_LOCAL_PATH/App/node_modules/react-native-mmkv/ios/Mmkv.mm:2:
/MY_LOCAL_PATH/App/node_modules/react-native-mmkv/ios/YeetJSIUtils.h:10:9: In file included from /MY_LOCAL_PATH/App/node_modules/react-native-mmkv/ios/YeetJSIUtils.h:10:
/MY_LOCAL_PATH/App/node_modules/react-native-mmkv/ios/Mmkv.mm:57:16: In instantiation of function template specialization 'facebook::jsi::Value::Value<signed char &>' requested here
/MY_LOCAL_PATH/App/ios/Pods/Headers/Public/React-jsi/jsi/jsi.h:1146:30: Must qualify identifier to find this declaration in dependent base class
/MY_LOCAL_PATH/App/ios/Pods/Headers/Public/React-jsi/jsi/jsi.h:1149:30: Must qualify identifier to find this declaration in dependent base class
/MY_LOCAL_PATH/App/ios/Pods/Headers/Public/React-jsi/jsi/jsi.h:1152:30: Must qualify identifier to find this declaration in dependent base class
/MY_LOCAL_PATH/App/ios/Pods/Headers/Public/React-jsi/jsi/jsi.h:933:43: No matching function for call to 'kindOf'
/MY_LOCAL_PATH/App/node_modules/react-native-mmkv/ios/Mmkv.mm:2:9: In file included from /MY_LOCAL_PATH/App/node_modules/react-native-mmkv/ios/Mmkv.mm:2:
/MY_LOCAL_PATH/App/node_modules/react-native-mmkv/ios/YeetJSIUtils.h:10:9: In file included from /MY_LOCAL_PATH/App/node_modules/react-native-mmkv/ios/YeetJSIUtils.h:10:
/MY_LOCAL_PATH/App/ios/Pods/Headers/Public/React-jsi/jsi/jsi.h:1146:30: Candidate function not viable: no known conversion from 'signed char' to 'const facebook::jsi::Symbol' for 1st argument
/MY_LOCAL_PATH/App/ios/Pods/Headers/Public/React-jsi/jsi/jsi.h:1149:30: Candidate function not viable: no known conversion from 'signed char' to 'const facebook::jsi::String' for 1st argument
/MY_LOCAL_PATH/App/ios/Pods/Headers/Public/React-jsi/jsi/jsi.h:1152:30: Candidate function not viable: no known conversion from 'signed char' to 'const facebook::jsi::Object' for 1st argument
/MY_LOCAL_PATH/App/ios/Pods/Headers/Public/React-jsi/jsi/jsi.h:934:5: Static_assert failed due to requirement 'std::is_base_of<facebook::jsi::Symbol, signed char &>::value || std::is_base_of<facebook::jsi::String, signed char &>::value || std::is_base_of<facebook::jsi::Object, signed char &>::value' "Value cannot be implicitly move-constructed from this type"
/MY_LOCAL_PATH/App/node_modules/react-native-mmkv/ios/Mmkv.mm:2:9: In file included from /MY_LOCAL_PATH/App/node_modules/react-native-mmkv/ios/Mmkv.mm:2:
/MY_LOCAL_PATH/App/node_modules/react-native-mmkv/ios/YeetJSIUtils.h:10:9: In file included from /MY_LOCAL_PATH/App/node_modules/react-native-mmkv/ios/YeetJSIUtils.h:10:
/MY_LOCAL_PATH/App/ios/Pods/Headers/Public/React-jsi/jsi/jsi.h:939:26: Cannot allocate reference type 'signed char &' with new
/MY_LOCAL_PATH/App/node_modules/react-native-mmkv/ios/Mmkv.mm:2:9: In file included from /MY_LOCAL_PATH/App/node_modules/react-native-mmkv/ios/Mmkv.mm:2:
/MY_LOCAL_PATH/App/node_modules/react-native-mmkv/ios/YeetJSIUtils.h:10:9: In file included from /MY_LOCAL_PATH/App/node_modules/react-native-mmkv/ios/YeetJSIUtils.h:10:

from react-native-mmkv.

mrousavy avatar mrousavy commented on May 21, 2024

@ManAnRuck can you confirm that this issue only happens in Release builds? In Debug everything works fine?
Did you try removing all cache (node_modules, Pods, lockfiles and Build Output Folder) and completely rebuilding?

I have just published 1.0.4 on npm, try if that works for you (clean everything before upgrading)

from react-native-mmkv.

KingAmo avatar KingAmo commented on May 21, 2024

increase platform target from 10 to 11 do not solve the problem in my case...

from react-native-mmkv.

alinavaie avatar alinavaie commented on May 21, 2024

@ManAnRuck can you confirm that this issue only happens in Release builds? In Debug everything works fine?
Did you try removing all cache (node_modules, Pods, lockfiles and Build Output Folder) and completely rebuilding?

I have just published 1.0.4 on npm, try if that works for you (clean everything before upgrading)

Yes. It happens only on release build. Increasing platform target to 11 doesn't work for me.

from react-native-mmkv.

mrousavy avatar mrousavy commented on May 21, 2024

@KingAmo @alinavaie

  1. Have you tried the latest version (1.0.5)?
  2. What react-native version are you on?
  3. Have you tried to clean cache & rebuild?:

Clean Xcode caches:

cd ios
killall Xcode
xcrun -k
xcodebuild -alltargets clean
rm -rf "$(getconf DARWIN_USER_CACHE_DIR)/org.llvm.clang/ModuleCache"
rm -rf "$(getconf DARWIN_USER_CACHE_DIR)/org.llvm.clang.$(whoami)/ModuleCache"
rm -rf ~/Library/Developer/Xcode/DerivedData/*
rm -rf ~/Library/Caches/com.apple.dt.Xcode/*

source

Clean local package caches:

rm -rf node_modules
rm -rf package-lock.json
rm -rf ios/Pods
rm -rf ios/Podfile.lock
npm i   # or yarn
cd ios
pod repo update && pod update && pod install

from react-native-mmkv.

alinavaie avatar alinavaie commented on May 21, 2024

@KingAmo @alinavaie

  1. Have you tried the latest version (1.0.5)?
  2. What react-native version are you on?
  3. Have you tried to clean cache & rebuild?:

Clean Xcode caches:

cd ios
killall Xcode
xcrun -k
xcodebuild -alltargets clean
rm -rf "$(getconf DARWIN_USER_CACHE_DIR)/org.llvm.clang/ModuleCache"
rm -rf "$(getconf DARWIN_USER_CACHE_DIR)/org.llvm.clang.$(whoami)/ModuleCache"
rm -rf ~/Library/Developer/Xcode/DerivedData/*
rm -rf ~/Library/Caches/com.apple.dt.Xcode/*

source

Clean local package caches:

rm -rf node_modules
rm -rf package-lock.json
rm -rf ios/Pods
rm -rf ios/Podfile.lock
npm i   # or yarn
cd ios
pod repo update && pod update && pod install
  • Yes, I install the last version (1.0.5)
  • I'm using react native 0.63.0
  • I cleaned cache and rebuild according to your instruction but nothing changed at all.

from react-native-mmkv.

mrousavy avatar mrousavy commented on May 21, 2024

@alinavaie I'm using RN 0.64 and don't have any issues at all. Does it work if you create a new RN 0.63 project with only the react-native-mmkv lib installed?

from react-native-mmkv.

frodoe7 avatar frodoe7 commented on May 21, 2024

increase platform target from 10 to 11 do not solve the problem in my case...

I have the same issue , changing the platform target to 11 did not work with me

react native version : 0.63.4
react native mmkv version : 1.0.5

We were about to publish our app to App store , but after replacing the AsyncStorage with this library; we cannot build in IOS 🀦

from react-native-mmkv.

mrousavy avatar mrousavy commented on May 21, 2024

@frodoe7 again, I cannot reproduce. If you provide me a minimal reproduction (e.g. github repo, only with react-native-mmkv installed) I can help you.

from react-native-mmkv.

baptooo avatar baptooo commented on May 21, 2024

Moving to target 11.0 did the trick ! πŸ™‡

One question about this as I am quite new to the community πŸ‘Ά , shouldn't this be defined here directly to prevent future crash ?

IPHONEOS_DEPLOYMENT_TARGET = 10.0;

Thank you !

from react-native-mmkv.

ryanlntn avatar ryanlntn commented on May 21, 2024

Running into this same error but in my case it builds fine regardless of scheme on iOS but fails with the aforementioned Use of undeclared identifier 'kindOf' when building for macOS using catalyst. So far changing deployment targets hasn't had any effect.

from react-native-mmkv.

dimaportenko avatar dimaportenko commented on May 21, 2024

I'm trying to add macos target to this library and use it with https://github.com/microsoft/react-native-macos. And I got this error. I'm happy to share I found the problem place and solution. I'll do PR with macos target later, meanwhile solution if somebody will need it.

diff --git a/node_modules/react-native-mmkv/ios/MmkvHostObject.mm b/node_modules/react-native-mmkv/ios/MmkvHostObject.mm

@@ -73,7 +85,7 @@
       if (!arguments[0].isString()) throw jsi::JSError(runtime, "First argument ('key') has to be of type string!");
 
       auto keyName = convertJSIStringToNSString(runtime, arguments[0].getString(runtime));
-      auto value = [instance getBoolForKey:keyName];
+      bool value = [instance getBoolForKey:keyName];
       return jsi::Value(value);
     });
   }

from react-native-mmkv.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.