Comments (14)
Good news, you can get MMKV working with use_framework!
if you utilise Microsoft's CocoaPods Pod Linkage plugin.
You'll need to follow their setup instructions and then modify this project's Podspec to include .:linkage => :dynamic
as in my fork
Then install via bundle exec pod install
.
@mrousavy I believe this linkage
flag I added to the Podspec won't affect pod installations that don't use the cocoapods-pod-linkage
extension (I tested by commenting out the plugin inclusion in my Podfile, deintegrated and reinstalled with no installation errors).
Update: Even simpler, you don't need to edit the Podspec of this library, you can just default the linkage to static in your target:
use_frameworks! :linkage => :static
This will then use static libraries for MMKV whilst still using frameworks for Swift pods that require them 🎉
from react-native-mmkv.
@oferRounds yes, unfortunately. I could only make my project run by removing react-native-mmkv
and using regular AsyncStorage
:(
as I understand, react-native-mmkv
is based on JSI which is getting broken after using use_framework!
. Also it was breaking some Pods which had s.dependency 'React'
in .podspec
file. But it has to be s.dependency 'React-Core'
.
from react-native-mmkv.
Perhaps it’s due to the fact my pod file includes use_frameworks!
?
from react-native-mmkv.
Are you using Apple Silicone (M1 chip)? Can you build the example app?
from react-native-mmkv.
Ahmmm, yes, I use the Apple Silicone (M1 chip), can this be related?
from react-native-mmkv.
hey guys @oferRounds @mrousavy
I started getting this error when I turned hermes
engine off
in Pods.
And also, I couldn't make the project run when I was using use_frameworks!
and hermes
engine on
. Some libraries, like @react-native-community/netinfo
and react-native-fbsdk-next
, couldn't import hermes.h
and something like that. If anybody knows why it happens could you share an explanation? 😅
"react-native": "^0.64.2"
"react-native-mmkv": "^1.1.6"
from react-native-mmkv.
Hi @kanzitelli, thanks for this! I actually still on react-native 0.63, so hermes is not available for me
But as you said, it seems to me that the use_frameworks!
is the one causing the issues
from react-native-mmkv.
@brod-ie nice! Thank you! Will try
from react-native-mmkv.
@oferRounds Even simpler! Updated my comment 😀
from react-native-mmkv.
OMG thank you!!! Will soon check and update
from react-native-mmkv.
Let me know if v2.0.0 still has that error :)
from react-native-mmkv.
Good news, you can get MMKV working with
use_framework!
if you utilise Microsoft's CocoaPods Pod Linkage plugin.You'll need to follow their setup instructions
and then modify this project's Podspec to include.:linkage => :dynamic
as in my forkThen install via
bundle exec pod install
.
@mrousavy I believe thislinkage
flag I added to the Podspec won't affect pod installations that don't use thecocoapods-pod-linkage
extension (I tested by commenting out the plugin inclusion in my Podfile, deintegrated and reinstalled with no installation errors).Update: Even simpler, you don't need to edit the Podspec of this library, you can just default the linkage to static in your target:
use_frameworks! :linkage => :static
This will then use static libraries for MMKV whilst still using frameworks for Swift pods that require them 🎉
Thanks! We should add this to the README
from react-native-mmkv.
There is a simpler fix which does not require installing a plugin:
pre_install do |installer|
installer.pod_targets.each do |pod|
if pod.name.eql?('react-native-mmkv')
def pod.build_type;
Pod::BuildType.static_library
end
end
end
end
Put this in the block defining the pod somewhere under the use_frameworks!
call.
from react-native-mmkv.
There is a simpler fix which does not require installing a plugin:
pre_install do |installer| installer.pod_targets.each do |pod| if pod.name.eql?('react-native-mmkv') def pod.build_type; Pod::BuildType.static_library end end end endPut this in the block defining the pod somewhere under the
use_frameworks!
call.
@felixSchl
exactly where should I put those codes..? still getting build error
$RNFirebaseAsStaticFramework = true
require_relative '../node_modules/react-native/scripts/react_native_pods'
require_relative '../node_modules/@react-native-community/cli-platform-ios/native_modules'
platform :ios, '11.0'
target 'fondee' do
use_frameworks!
config = use_native_modules!
use_react_native!(
:path => config[:reactNativePath],
# to enable hermes on iOS, change `false` to `true` and then install pods
:hermes_enabled => false
)
target 'fondeeTests' do
use_frameworks!
inherit! :complete
# Pods for testing
end
# Enables Flipper.
#
# Note that if you have use_frameworks! enabled, Flipper will not work and
# you should disable the next line.
# use_flipper!()
post_install do |installer|
react_native_post_install(installer)
__apply_Xcode_12_5_M1_post_install_workaround(installer)
end
permissions_path = '../node_modules/react-native-permissions/ios'
pod 'Permission-Camera', :path => "#{permissions_path}/Camera"
pod 'Permission-PhotoLibrary', :path => "#{permissions_path}/PhotoLibrary"
pod 'Permission-Microphone', :path => "#{permissions_path}/Microphone"
# pod 'Permission-Notifications', :path => "#{permissions_path}/Notifications"
end
from react-native-mmkv.
Related Issues (20)
- Error: react-native-mmkv is not supported in Expo Go! Use EAS HOT 5
- com.facebook.react.JavaScript (17): EXC_BAD_ACCESS (code=1, address=0xcf9b17) from bytes[m_position++]; HOT 2
- EXC_BAD_ACCESS on IOS with codepush restart
- detox throws error when metro is run with mocks HOT 2
- mmkv관련 로그 발생 해결
- iOS crash: malloc: *** error for object 0x282611260: pointer being freed was not allocated EXC_CRASH (SIGABRT)
- Crash reports after switching to use AppGroups due to 0xdead10cc HOT 2
- Cannot run in react-native 0.73.x HOT 1
- use expo go ,start with this error: CommandError: No development build (com.anonymous.***) for this project is installed. Please make and install a development build on the device first. HOT 3
- Unable to resolve module ./createMMKV.mock HOT 1
- Apple Privacy Manifest HOT 6
- Unable to make react-native-mmkv work with firebase auth persistence HOT 2
- duplicate symbols when used with react-native-quick-crypto HOT 1
- Storage breaks when calling storage.clearStore() on empty storage HOT 1
- `getString` fails on reload after calling `delete` with `encyptionKey` set in config HOT 7
- Crashing on bundle reload in beta version HOT 1
- Bug on RN 0.74 HOT 10
- How to Implement iCloud Sync to Keep Reinstalled Apps to Recover Data?
- Building for 'iOS-simulator', but linking in dylib (/opt/local/lib/libz.1.3.1.dylib) built for 'macOS' HOT 2
- After defining the path for the MMKV instance, an empty 'MMKV' directory is still generated under $(Documents) HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from react-native-mmkv.