Doko-Demo-Doa / react-native-shake

React Native shake event detector
MIT License
275 stars 65 forks source link

Pod install Failure #49

Closed pristinejudah closed 10 months ago

pristinejudah commented 1 year ago

I got the below error when running Pod install after install this package.

[!] Invalid `Podfile` file: 
[!] Invalid `react-native-shake.podspec` file: undefined method `install_modules_dependencies' for Pod:Module
Did you mean?  install_flipper_dependencies.
egealpay commented 1 year ago

I am having the same problem

hkaras19 commented 1 year ago

@pristinejudah were you able to find a solution? Running into the same issue.

mattjbrill commented 1 year ago

@pristinejudah @egealpay @hkaras19

I encountered the same issue. It is the result of the collaborators upgrading the package to support react native 0.71+ (https://github.com/Doko-Demo-Doa/react-native-shake/commit/d780911e9d09f0d68df30159ae9a8fd5b30d0c65#diff-ee358e99d81f6c94e1ee986756e207dad0502e1e954bbc9f6d32f55070e3dc4d).

You can add backwards compatibility by duplicating react-native-async-storage's backwards resolution: https://github.com/react-native-async-storage/async-storage/pull/1004/files

So in this package's react-native-shake.podspec file, replace

install_modules_dependencies(s)

with

if respond_to?(:install_modules_dependencies, true)
    install_modules_dependencies(s)
  else
    s.dependency 'React'
  end

If you use patch-package, you can use a patch similar to this

diff --git a/node_modules/react-native-shake/react-native-shake.podspec b/node_modules/react-native-shake/react-native-shake.podspec
index e64c25c..9576916 100644
--- a/node_modules/react-native-shake/react-native-shake.podspec
+++ b/node_modules/react-native-shake/react-native-shake.podspec
@@ -15,5 +15,9 @@ Pod::Spec.new do |s|
   s.source        = { :git => "https://github.com/Doko-Demo-Doa/react-native-shake", :tag => "v#{s.version}" }
   s.source_files  = "ios/**/*.{h,m,mm,swift}"

-  install_modules_dependencies(s)
+  if respond_to?(:install_modules_dependencies, true)
+    install_modules_dependencies(s)
+  else
+    s.dependency 'React'
+  end
 end
mattjbrill commented 1 year ago

Opened a PR for it https://github.com/Doko-Demo-Doa/react-native-shake/pull/54