Skip to content
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

Example project not building iOS #632

Open
Cancercookie opened this issue Apr 17, 2024 · 4 comments
Open

Example project not building iOS #632

Cancercookie opened this issue Apr 17, 2024 · 4 comments

Comments

@Cancercookie
Copy link

Cancercookie commented Apr 17, 2024

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)
@vladbelozertsev
Copy link

vladbelozertsev commented Apr 19, 2024

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

@vladbelozertsev
Copy link

vladbelozertsev commented Apr 19, 2024

But now i cant run my project (npx react-native run-ios) so i have to downgrade keychain to 8.1.2

  1. npm uninstall react-native-keychain
  2. npm install [email protected]

@xavieramoros
Copy link
Contributor

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"

@nickwelp
Copy link

Right now, 8.1.2 worked for me

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants