Example project not building iOS
I tried building the Example project on latest master but I got an error when launching
bundle exec pod install --project-directory=ios
warn Multiple Podfiles were found: ios/Podfile,macos/Podfile,vendor/bundle/ruby/2.7.0/gems/cocoapods-core-1.11.3/lib/cocoapods-core/Podfile. Choosing ios/Podfile automatically. If you would like to select a different one, you can configure it via "project.ios.sourceDir". You can learn more about it here: https://github.com/react-native-community/cli/blob/master/docs/configuration.md
[!] Invalid `Podfile` file:
[!] Invalid `RNKeychain.podspec` file: undefined method `visionos' for #<Pod::Specification name="RNKeychain">.
There's a problem with 15:RNKeychain.podspecs, deleting s.visionos.deployment_target = '1.0' fixes the issue.
But either after the fix or using cocoapods 13 the app build yarn ios failed with
The following build commands failed:
CompileC /Users/cancercookie/Library/Developer/Xcode/DerivedData/KeychainExample-bygzekmhcudfxlhdcoqfyyqoitda/Build/Intermediates.noindex/Pods.build/Debug-iphonesimulator/RCT-Folly.build/Objects-normal/arm64/json.o /Users/cancercookie/WebstormProjects/react-native-keychain/KeychainExample/ios/Pods/RCT-Folly/folly/json.cpp normal arm64 c++ com.apple.compilers.llvm.clang.1_0.compiler (in target 'RCT-Folly' from project 'Pods')
(1 failure)
Same for me. But after reinstalling the lib latest version: (1.npm uninstall react-native-keychain 2.npm install react-native-keychain) and updating cocoapods (terminal commands 1.brew cleanup -d -v and then 2.brew install cocoapods) and pod install works fine
But now i cant run my project (npx react-native run-ios) so i have to downgrade keychain to 8.1.2
npm uninstall react-native-keychainnpm install [email protected]
You can fix this issue modifying the RNKeychain.podspec file, using patch-package, with the following diff
diff --git a/node_modules/react-native-keychain/RNKeychain.podspec b/node_modules/react-native-keychain/RNKeychain.podspec
index 9a5347d..3959368 100644
--- a/node_modules/react-native-keychain/RNKeychain.podspec
+++ b/node_modules/react-native-keychain/RNKeychain.podspec
@@ -12,7 +12,7 @@ Pod::Spec.new do |s|
s.ios.deployment_target = '9.0'
s.tvos.deployment_target = '9.0'
s.osx.deployment_target = '10.13'
- s.visionos.deployment_target = '1.0'
+ s.visionos.deployment_target = '1.0' if s.respond_to?(:visionos)
s.source = { :git => "https://github.com/oblador/react-native-keychain.git", :tag => "v#{s.version}" }
s.source_files = 'RNKeychainManager/**/*.{h,m}'
s.preserve_paths = "**/*.js"
Right now, 8.1.2 worked for me
Fixed with 9.0.0