a7medev / react-native-ml-kit

React Native On-Device Machine Learning w/ Google ML Kit
MIT License
396 stars 58 forks source link

GTMSessionFetcher/Core version error with latest firebase #24

Closed priyankjaintechnetto closed 1 year ago

priyankjaintechnetto commented 1 year ago

What happened?

pod update is failing with latest firebase version. Versions:

"@react-native-firebase/app": "^17.0.0",
"@react-native-firebase/auth": "^17.0.0",
"@react-native-firebase/database": "^17.0.0",
"@react-native-ml-kit/text-recognition": "^1.2.1",

Error with pod update for ios:

Command `pod install` failed.
└─ Cause: CocoaPods could not find compatible versions for pod "GTMSessionFetcher/Core":
  In snapshot (Podfile.lock):
    GTMSessionFetcher/Core (< 4.0, = 3.1.0, >= 2.1)

  In Podfile:
    RNFBAuth (from `../node_modules/@react-native-firebase/auth`) was resolved to 17.0.0, which depends on
      Firebase/Auth (= 10.4.0) was resolved to 10.4.0, which depends on
        FirebaseAuth (~> 10.4.0) was resolved to 10.4.0, which depends on
          GTMSessionFetcher/Core (< 4.0, >= 2.1)

    RNMLKitTextRecognition (from `../node_modules/@react-native-ml-kit/text-recognition`) was resolved to 1.2.1, which depends on
      GoogleMLKit/TextRecognitionJapanese (= 2.6.0) was resolved to 2.6.0, which depends on
        MLKitTextRecognitionJapanese (~> 1.0.0-beta3) was resolved to 1.0.0-beta3, which depends on
          MLKitVision (~> 3.0) was resolved to 3.0.0, which depends on
            GTMSessionFetcher/Core (~> 1.1)

You have either:
 * changed the constraints of dependency `GTMSessionFetcher/Core` inside your development pod `RNMLKitTextRecognition`.
   You should run `pod update GTMSessionFetcher/Core` to apply changes you've made.

Version

1.2.1

Which ML Kit packages do you use?

What platforms are you seeing this issue on?

System Information

System: OS: macOS 13.1 CPU: (8) x64 Apple M1 Memory: 50.62 MB / 16.00 GB Shell: 5.8.1 - /bin/zsh Binaries: Node: 16.13.0 - ~/.nvm/versions/node/v16.13.0/bin/node Yarn: 1.22.19 - /usr/local/bin/yarn npm: 8.1.0 - ~/.nvm/versions/node/v16.13.0/bin/npm Watchman: 2023.01.09.00 - /usr/local/bin/watchman Managers: CocoaPods: 1.11.3 - /Users/priyankjain/.rvm/rubies/ruby-2.7.5/bin/pod SDKs: iOS SDK: Platforms: DriverKit 22.2, iOS 16.2, macOS 13.1, tvOS 16.1, watchOS 9.1 Android SDK: Not Found IDEs: Android Studio: Not Found Xcode: 14.2/14C18 - /usr/bin/xcodebuild Languages: Java: 11.0.8 - /usr/bin/javac npmPackages: @react-native-community/cli: Not Found react: 18.2.0 => 18.2.0 react-native: 0.71.2 => 0.71.2 react-native-macos: Not Found npmGlobalPackages: react-native: Not Found

Steps to Reproduce

Add latest packages of react native firebase and text recognition and do pod install

juanvegab commented 1 year ago

Is there a solution for this? I'm facing the same problem.

[!] CocoaPods could not find compatible versions for pod "GTMSessionFetcher/Core":
  In Podfile:
    GTMSessionFetcher/Core (~> 1.1)

    RNFBAuth (from `../node_modules/@react-native-firebase/auth`) was resolved to 18.0.0, which depends on
      Firebase/Auth (= 10.10.0) was resolved to 10.10.0, which depends on
        FirebaseAuth (~> 10.10.0) was resolved to 10.10.0, which depends on
          GTMSessionFetcher/Core (< 4.0, >= 2.1)

Specs satisfying the `GTMSessionFetcher/Core (~> 1.1), GTMSessionFetcher/Core (< 4.0, >= 2.1)` dependency were found, but they required a higher minimum deployment target.

This is the top of my Podfile:

require_relative '../node_modules/react-native/scripts/react_native_pods'
require_relative '../node_modules/@react-native-community/cli-platform-ios/native_modules'

# platform :ios, min_ios_version_supported
platform :ios, '13.0'

pod 'Firebase', :modular_headers => true
pod 'FirebaseCore', :modular_headers => true
pod 'FirebaseCoreInternal', :modular_headers => true
pod 'GTMSessionFetcher', :modular_headers => true
pod 'GTMSessionFetcher/Core', '~> 1.1'
pod 'GoogleUtilities', :modular_headers => true
pod 'GoogleSignIn', '~> 5.0.0'

and these are my dependencies:

  "dependencies": {
    "@react-native-community/google-signin": "^5.0.0",
    "@react-native-firebase/analytics": "^18.0.0",
    "@react-native-firebase/app": "^18.0.0",
    "@react-native-firebase/auth": "^18.0.0",
    "@react-native-firebase/firestore": "^18.0.0",
    "@react-native-google-signin/google-signin": "^10.0.1",
    "react": "18.2.0",
    "react-native": "0.71.9"
  }
mhuretski commented 1 year ago

had same problem, updated node_modules/@react-native-ml-kit/text-recognition/RNMLKitTextRecognition.podspec to have

  # To recognize Latin script
  s.dependency 'GoogleMLKit/TextRecognition', '4.0.0'
  # To recognize Chinese script
  s.dependency 'GoogleMLKit/TextRecognitionChinese', '4.0.0'
  # To recognize Devanagari script
  s.dependency 'GoogleMLKit/TextRecognitionDevanagari', '4.0.0'
  # To recognize Japanese script
  s.dependency 'GoogleMLKit/TextRecognitionJapanese', '4.0.0'
  # To recognize Korean script
  s.dependency 'GoogleMLKit/TextRecognitionKorean', '4.0.0'

and

s.platforms    = { :ios => "12.0" }
enchorb commented 1 year ago

Using this patch file and works for now, @a7medev can you update the package

diff --git a/node_modules/@react-native-ml-kit/text-recognition/RNMLKitTextRecognition.podspec b/node_modules/@react-native-ml-kit/text-recognition/RNMLKitTextRecognition.podspec
index b6436d5..620d34e 100644
--- a/node_modules/@react-native-ml-kit/text-recognition/RNMLKitTextRecognition.podspec
+++ b/node_modules/@react-native-ml-kit/text-recognition/RNMLKitTextRecognition.podspec
@@ -14,7 +14,7 @@ Pod::Spec.new do |s|
   # optional - use expanded license entry instead:
   # s.license    = { :type => "MIT", :file => "LICENSE" }
   s.authors      = { "Ahmed Mahmoud" => "a7med.mahmoud2004@gmail.com" }
-  s.platforms    = { :ios => "9.0" }
+  s.platforms    = { :ios => "12.0" }
   s.source       = { :git => "https://github.com/a7med-mahmoud/react-native-ml-kit.git", :tag => "#{s.version}" }

   s.source_files = "ios/**/*.{h,c,cc,cpp,m,mm,swift}"
@@ -22,14 +22,14 @@ Pod::Spec.new do |s|

   s.dependency "React"
   # To recognize Latin script
-  s.dependency 'GoogleMLKit/TextRecognition', '2.6.0'
+  s.dependency 'GoogleMLKit/TextRecognition', '4.0.0'
   # To recognize Chinese script
-  s.dependency 'GoogleMLKit/TextRecognitionChinese', '2.6.0'
+  s.dependency 'GoogleMLKit/TextRecognitionChinese', '4.0.0'
   # To recognize Devanagari script
-  s.dependency 'GoogleMLKit/TextRecognitionDevanagari', '2.6.0'
+  s.dependency 'GoogleMLKit/TextRecognitionDevanagari', '4.0.0'
   # To recognize Japanese script
-  s.dependency 'GoogleMLKit/TextRecognitionJapanese', '2.6.0'
+  s.dependency 'GoogleMLKit/TextRecognitionJapanese', '4.0.0'
   # To recognize Korean script
-  s.dependency 'GoogleMLKit/TextRecognitionKorean', '2.6.0'
+  s.dependency 'GoogleMLKit/TextRecognitionKorean', '4.0.0'
 end
a7medev commented 1 year ago

Hi everyone, sorry for the late reply, and thanks for reporting this bug. I haven't had much time to work on these packages lately. There's a PR (#32) open for updating the dependencies so I'll review it and hopefully we get to resolve these issues.

a7medev commented 1 year ago

Hi there, v1.3.0 of @react-native-ml-kit/text-recognition is out with updated dependencies which hopefully resolves this issue. I'll close this one for now but feel free to reopen it if things still break.

wilav-dev commented 1 year ago

Hello, please update GoogleMLKit in RNMLKitFaceDetection .podspec to 4.0.0

a7medev commented 1 year ago

Hi @wilav-dev! I'm working on upgrading all native dependencies for the upcoming release which will be out very soon!

a7medev commented 1 year ago

@wilav-dev All React Native ML Kit packages are now on v4.0.0 on iOS! 🎉