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

pod install fail on RN 0.70.x & New Arch #997

Closed
1 of 5 tasks
retyui opened this issue Aug 3, 2023 · 5 comments · Fixed by #1004
Closed
1 of 5 tasks

pod install fail on RN 0.70.x & New Arch #997

retyui opened this issue Aug 3, 2023 · 5 comments · Fixed by #1004
Labels
bug Something isn't working released

Comments

@retyui
Copy link
Contributor

retyui commented Aug 3, 2023

What happened?

install_modules_dependencies available in rn 0.71+

RCT_NEW_ARCH_ENABLED=1 npx pod-install


[!] Invalid `Podfile` file: 
[!] Invalid `RNCAsyncStorage.podspec` file: undefined method `install_modules_dependencies' for Pod:Module.

 #  from /Users/i/tmp/Rn70New/node_modules/@react-native-async-storage/async-storage/RNCAsyncStorage.podspec:29
 #  -------------------------------------------
 #  
 >      install_modules_dependencies(s)
 #    else
 #  -------------------------------------------

Version

1.19.1

What platforms are you seeing this issue on?

  • Android
  • iOS
  • macOS
  • Windows
  • web

System Information

System:
    OS: macOS 13.5
    CPU: (10) arm64 Apple M1 Pro
    Memory: 8.00 GB / 32.00 GB
    Shell: 3.6.1 - /opt/homebrew/bin/fish
  Binaries:
    Node: 18.17.0 - /usr/local/bin/node
    Yarn: 1.22.19 - /opt/homebrew/bin/yarn
    npm: 9.7.2 - /opt/homebrew/bin/npm
    Watchman: 2023.07.10.00 - /opt/homebrew/bin/watchman
  Managers:
    CocoaPods: 1.12.1 - /opt/homebrew/bin/pod
  SDKs:
    iOS SDK:
      Platforms: DriverKit 22.4, iOS 16.4, macOS 13.3, tvOS 16.4, watchOS 9.4
    Android SDK: Not Found
  IDEs:
    Android Studio: Flamingo 2022.2.1 Patch 2 Flamingo 2022.2.1 Patch 2
    Xcode: 14.3.1/14E300c - /usr/bin/xcodebuild
  Languages:
    Java: 11.0.19 - /usr/bin/javac
  npmPackages:
    @react-native-community/cli: Not Found
    react: 18.1.0 => 18.1.0 
    react-native: 0.70.13 => 0.70.13 
    react-native-macos: Not Found
  npmGlobalPackages:
    *react-native*: Not Found

Steps to Reproduce

cd MyRn70
yarn add @react-native-async-storage/async-storage
RCT_NEW_ARCH_ENABLED=1 npx pod-install
@retyui retyui added the bug Something isn't working label Aug 3, 2023
@retyui
Copy link
Contributor Author

retyui commented Aug 3, 2023

create-react-native-library the template with backward compatibility

  # Use install_modules_dependencies helper to install the dependencies if React Native version >=0.71.0.
  # See https://github.com/facebook/react-native/blob/febf6b7f33fdb4904669f99d795eba4c0f95d7bf/scripts/cocoapods/new_architecture.rb#L79.
  if respond_to?(:install_modules_dependencies, true)
    install_modules_dependencies(s)
  else
  s.dependency "React-Core"

  # Don't install the dependencies when we run `pod install` in the old architecture.
  if ENV['RCT_NEW_ARCH_ENABLED'] == '1' then
    s.compiler_flags = folly_compiler_flags + " -DRCT_NEW_ARCH_ENABLED=1"
    s.pod_target_xcconfig    = {
        "HEADER_SEARCH_PATHS" => "\"$(PODS_ROOT)/boost\"",
        "OTHER_CPLUSPLUSFLAGS" => "-DFOLLY_NO_CONFIG -DFOLLY_MOBILE=1 -DFOLLY_USE_LIBCPP=1",
        "CLANG_CXX_LANGUAGE_STANDARD" => "c++17"
    }
    s.dependency "React-Codegen"
    s.dependency "RCT-Folly"
    s.dependency "RCTRequired"
    s.dependency "RCTTypeSafety"
    s.dependency "ReactCommon/turbomodule/core"
   end
  end  

@krizzu
Copy link
Member

krizzu commented Aug 21, 2023

@tido64 I think we should get this in for backward compatibility? Or is there something I'm missing?

@tido64
Copy link
Member

tido64 commented Aug 22, 2023

@tido64 I think we should get this in for backward compatibility? Or is there something I'm missing?

We should. I just haven't had time for this. 😕

@retyui
Copy link
Contributor Author

retyui commented Aug 22, 2023

@tido64 fixed in #1004

@tido64 tido64 linked a pull request Aug 24, 2023 that will close this issue
tido64 pushed a commit that referenced this issue Aug 24, 2023
@AsyncStorageBot
Copy link
Collaborator

🎉 This issue has been resolved in version 1.19.3 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working released
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants
@tido64 @retyui @krizzu @AsyncStorageBot and others