mobile_scanner icon indicating copy to clipboard operation
mobile_scanner copied to clipboard

iOS: version conflict with Firebase libs

Open hnvn opened this issue 3 years ago • 5 comments

The current version of this lib is conflicted with the latest version of Firebase libs, here's log:

[!] CocoaPods could not find compatible versions for pod "GTMSessionFetcher/Core":
  In Podfile:
    firebase_storage (from `.symlinks/plugins/firebase_storage/ios`) was resolved to 11.0.1, which depends on
      Firebase/Storage (= 10.0.0) was resolved to 10.0.0, which depends on
        FirebaseStorage (~> 10.0.0) was resolved to 10.0.0, which depends on
          GTMSessionFetcher/Core (~> 2.1)

    mobile_scanner (from `.symlinks/plugins/mobile_scanner/ios`) was resolved to 0.0.1, which depends on
      GoogleMLKit/BarcodeScanning (~> 2.6.0) was resolved to 2.6.0, which depends on
        MLKitBarcodeScanning (~> 1.7.0) was resolved to 1.7.0, which depends on
          MLKitVision (~> 3.0) was resolved to 3.0.0, which depends on
            GTMSessionFetcher/Core (~> 1.1)

hnvn avatar Oct 19 '22 02:10 hnvn

pod repo update
pod update GTMSessionFetcher/Core

solved it for me. However, the problem for me was firebase_auth not firebase_storage.

oerni74 avatar Oct 20 '22 12:10 oerni74

pod repo update
pod update GTMSessionFetcher/Core

solved it for me. However, the problem for me was firebase_auth not firebase_storage.

If this does not work try:

rm -rf ios/Pods
rm ios/Pdofile.lock
flutter clean
pod repo update

Then try again.

peukerjonathan avatar Oct 20 '22 15:10 peukerjonathan

This did not work for me, sadly so is a PR to update the package spec better?

kyeshmz avatar Oct 21 '22 01:10 kyeshmz

From the pod output, the issue appears to be with the Podspec for MLKitVision. Even the latest version (4.2.0) is still locked to GTMSessionFetcher/Core 1.1. Since the ML Kit SDK appears to be closed source, I amended the open ticket in Google's issue tracker: https://issuetracker.google.com/issues/254418199

bgetsug avatar Oct 21 '22 01:10 bgetsug

Nice catch @bgetsug !

kyeshmz avatar Oct 21 '22 02:10 kyeshmz

Is there any workaround on this? I try both oerni74 & peukerjonathan solution, still no luck

uzuki-P avatar Oct 25 '22 09:10 uzuki-P

Same issue here, tried @oerni74 and @peukerjonathan solutions but no luck.

PedroTicGal avatar Oct 25 '22 09:10 PedroTicGal

  • 1

kekko7072 avatar Oct 28 '22 14:10 kekko7072

The Google team has assigned the MLKit bug ticket https://issuetracker.google.com/issues/254418199 with a Priority level of P4. P4 is the lowest priority they are working with, described as:

P4 | An issue that should be addressed eventually. Such an issue is not relevant to core organizational functions or the work of other teams, or else it relates only to the attractiveness or pleasantness of the system.

All of you who are experiencing this Google bug, could you please browse to the https://issuetracker.google.com/issues/254418199 issue, and click on the "+1" blue button on the top right to make Google aware that it is affecting people. Thanks.

MagnusJohansson avatar Oct 30 '22 10:10 MagnusJohansson

https://issuetracker.google.com/issues/254418199#comment22

Currently the next release is planned at the end of Q4.

Will we have to wait a few months for this issue...

motucraft avatar Oct 31 '22 16:10 motucraft

Same issue here, any solution?

github-brave avatar Nov 02 '22 02:11 github-brave

+1 Same here ...

uynguyen avatar Nov 02 '22 11:11 uynguyen

I roll-backed firebase_storage version, and it worked around

  • firebase_storage: ^11.0.3
  • firebase_storage: ^10.3.7

isairz avatar Nov 02 '22 19:11 isairz

I'm almost done with a new update of this package which will introduce some new functions and update the dependencies as well. With these new dependencies, i did not encounter this error.

juliansteenbakker avatar Nov 02 '22 20:11 juliansteenbakker

I'm almost done with a new update of this package which will introduce some new functions and update the dependencies as well. With these new dependencies, i did not encounter this error.

Thank you for the efffort! We are looking forward to the update

Theunodb avatar Nov 04 '22 05:11 Theunodb

From the pod output, the issue appears to be with the Podspec for MLKitVision. Even the latest version (4.2.0) is still locked to GTMSessionFetcher/Core 1.1. Since the ML Kit SDK appears to be closed source, I amended the open ticket in Google's issue tracker: https://issuetracker.google.com/issues/254418199


The Google team has assigned the MLKit bug ticket https://issuetracker.google.com/issues/254418199 with a Priority level of P4. P4 is the lowest priority they are working with, described as:

P4 | An issue that should be addressed eventually. Such an issue is not relevant to core organizational functions or the work of other teams, or else it relates only to the attractiveness or pleasantness of the system.

All of you who are experiencing this Google bug, could you please browse to the https://issuetracker.google.com/issues/254418199 issue, and click on the "+1" blue button on the top right to make Google aware that it is affecting people. Thanks.


@bgetsug @MagnusJohansson I cannot access the IssueTracker. Why is that?

ghost avatar Nov 05 '22 01:11 ghost

I don't know why, but Issue Tracker is now accessible.

ghost avatar Nov 08 '22 09:11 ghost

Helle guys, I would share with you a possible solution:

  1. Create MLKitVision.podspec.json in ios folder taking content from https://github.com/CocoaPods/Specs/blob/master/Specs/8/1/e/MLKitVision/4.2.0/MLKitVision.podspec.json

  2. Create MLKitCommon.podspec.json in ios folder taking content from https://github.com/CocoaPods/Specs/blob/master/Specs/c/c/6/MLKitCommon/8.0.0/MLKitCommon.podspec.json

  3. Modify in both files the GTMSessionFetcher/Core definition from 1.1 to version 2.1.

  4. Inside your Podfile you have to search for "target 'Runner'" and inside it you have to add the following lines:

      pod 'MLKitVision', :podspec => 'MLKitVision.podspec.json'
      pod 'MLKitCommon', :podspec => 'MLKitCommon.podspec.json'
  1. Run pod install

  2. build the app

That solved my issue.

I hope the same to you.

antoninobajeli avatar Nov 09 '22 14:11 antoninobajeli

I'm facing a similar problem, but between MobileScanner and GoogleMLKitTextRecognition.

[!] CocoaPods could not find compatible versions for pod "GoogleMLKit/MLKitCore":
  In Podfile:
    google_mlkit_text_recognition (from `.symlinks/plugins/google_mlkit_text_recognition/ios`) was resolved to 0.5.0, which depends on
      GoogleMLKit/TextRecognition (~> 3.2.0) was resolved to 3.2.0, which depends on
        GoogleMLKit/MLKitCore (= 3.2.0)

    mobile_scanner (from `.symlinks/plugins/mobile_scanner/ios`) was resolved to 0.0.1, which depends on
      GoogleMLKit/BarcodeScanning (~> 2.6.0) was resolved to 2.6.0, which depends on
        GoogleMLKit/MLKitCore (= 2.6.0)

psatler avatar Nov 11 '22 00:11 psatler

@juliansteenbakker thank you for your effort, does the new version ready or its still in progress?

vikt0r40 avatar Nov 11 '22 09:11 vikt0r40

It's still in progress. I'm hoping i can release a new beta version this weekend. You can track the progress in #362

juliansteenbakker avatar Nov 11 '22 14:11 juliansteenbakker

I have applied the above workaround and referred to the podfile shared here. It worked for me. Thanks to those who shared their information.

  firebase_core: ^2.2.0
  firebase_auth: ^4.1.2
  cloud_firestore: ^4.0.5
  cloud_firestore_odm: ^1.0.0-dev.40
  firebase_storage: ^11.0.5
  firebase_crashlytics: ^3.0.5
  firebase_messaging: ^14.1.0

  mobile_scanner: ^3.0.0-beta.1
My Podfile here
# Override Firebase SDK Version
$FirebaseSDKVersion = '10.1.0'
# Uncomment this line to define a global platform for your project
platform :ios, '15.0'

# CocoaPods analytics sends network stats synchronously affecting flutter build latency.
ENV['COCOAPODS_DISABLE_STATS'] = 'true'

project 'Runner', {
  'Debug' => :debug,
  'Profile' => :release,
  'Release' => :release,
}

def flutter_root
  generated_xcode_build_settings_path = File.expand_path(File.join('..', 'Flutter', 'Generated.xcconfig'), __FILE__)
  unless File.exist?(generated_xcode_build_settings_path)
    raise "#{generated_xcode_build_settings_path} must exist. If you're running pod install manually, make sure flutter pub get is executed first"
  end

  File.foreach(generated_xcode_build_settings_path) do |line|
    matches = line.match(/FLUTTER_ROOT\=(.*)/)
    return matches[1].strip if matches
  end
  raise "FLUTTER_ROOT not found in #{generated_xcode_build_settings_path}. Try deleting Generated.xcconfig, then run flutter pub get"
end

require File.expand_path(File.join('packages', 'flutter_tools', 'bin', 'podhelper'), flutter_root)

flutter_ios_podfile_setup

target 'Runner' do
  # see...
  #   https://github.com/juliansteenbakker/mobile_scanner/issues/335#issuecomment-1308829103
  #   https://issuetracker.google.com/issues/254418199#comment48
  pod 'MLKitVision', :podspec => 'MLKitVision.podspec.json'
  pod 'MLKitCommon', :podspec => 'MLKitCommon.podspec.json'

  use_frameworks!
  use_modular_headers!

  # see...
  #   https://github.com/firebase/flutterfire/issues/9761#issuecomment-1301997595
  pod 'FirebaseFirestore', :git => 'https://github.com/invertase/firestore-ios-sdk-frameworks.git', :tag => $FirebaseSDKVersion

  flutter_install_all_ios_pods File.dirname(File.realpath(__FILE__))
end

post_install do |installer|
  installer.pods_project.targets.each do |target|
    flutter_additional_ios_build_settings(target)
  end
end

motucraft avatar Nov 15 '22 05:11 motucraft

I#ve done the same but got this error then with Firebase 10.2.0:

[!] CocoaPods could not find compatible versions for pod "MLKitCommon": In Podfile: MLKitCommon (from MLKitCommon.podspec.json)

MLKitVision (from `MLKitVision.podspec.json`) was resolved to 4.2.0, which depends on
  MLKitCommon (~> 8.0)

mobile_scanner (from `.symlinks/plugins/mobile_scanner/ios`) was resolved to 0.0.1, which depends on
  GoogleMLKit/BarcodeScanning (~> 2.6.0) was resolved to 2.6.0, which depends on
    GoogleMLKit/MLKitCore (= 2.6.0) was resolved to 2.6.0, which depends on
      MLKitCommon (~> 5.0.0)

// edit: works with 3.0.0.beta-1, but this version is a little bit buggy (white square on the topleft when starting the scanner)

t-kietzmann avatar Nov 17 '22 20:11 t-kietzmann

Hi all, it took a little longer than i wanted but ive published v3.0.0-beta.2 with lots of improvements. Please checkout the changelog for all changes. I myself did not encounter any firebase issues with this version.

juliansteenbakker avatar Nov 18 '22 08:11 juliansteenbakker

Besides updating the latest beta version, i've also fixed the current stable version with v2.1.0.

This version updates firebase on iOS to the latest version which fixes this issue.

juliansteenbakker avatar Nov 18 '22 09:11 juliansteenbakker

Thanks for releasing v3.0.0-beta.2. I have worked with the following versions without problems.

  firebase_core: ^2.3.0
  firebase_auth: ^4.1.3
  cloud_firestore: ^4.1.0
  cloud_firestore_odm: ^1.0.0-dev.41
  firebase_storage: ^11.0.6
  firebase_crashlytics: ^3.0.6
  firebase_messaging: ^14.1.1
  google_sign_in: ^5.4.2

  mobile_scanner: ^3.0.0-beta.2
My Podfile (Firebase 10.2.0)
# Override Firebase SDK Version
$FirebaseSDKVersion = '10.2.0'
# Uncomment this line to define a global platform for your project
platform :ios, '15.0'

# CocoaPods analytics sends network stats synchronously affecting flutter build latency.
ENV['COCOAPODS_DISABLE_STATS'] = 'true'

project 'Runner', {
  'Debug' => :debug,
  'Profile' => :release,
  'Release' => :release,
}

def flutter_root
  generated_xcode_build_settings_path = File.expand_path(File.join('..', 'Flutter', 'Generated.xcconfig'), __FILE__)
  unless File.exist?(generated_xcode_build_settings_path)
    raise "#{generated_xcode_build_settings_path} must exist. If you're running pod install manually, make sure flutter pub get is executed first"
  end

  File.foreach(generated_xcode_build_settings_path) do |line|
    matches = line.match(/FLUTTER_ROOT\=(.*)/)
    return matches[1].strip if matches
  end
  raise "FLUTTER_ROOT not found in #{generated_xcode_build_settings_path}. Try deleting Generated.xcconfig, then run flutter pub get"
end

require File.expand_path(File.join('packages', 'flutter_tools', 'bin', 'podhelper'), flutter_root)

flutter_ios_podfile_setup

target 'Runner' do
  # see...
  #   https://github.com/juliansteenbakker/mobile_scanner/issues/335#issuecomment-1308829103
  #   https://issuetracker.google.com/issues/254418199#comment48
  pod 'MLKitVision', :podspec => 'MLKitVision.podspec.json'
  pod 'MLKitCommon', :podspec => 'MLKitCommon.podspec.json'

  use_frameworks!
  use_modular_headers!

  # see...
  #   https://github.com/firebase/flutterfire/issues/9761#issuecomment-1301997595
  pod 'FirebaseFirestore', :git => 'https://github.com/invertase/firestore-ios-sdk-frameworks.git', :tag => $FirebaseSDKVersion

  flutter_install_all_ios_pods File.dirname(File.realpath(__FILE__))
end

post_install do |installer|
  installer.pods_project.targets.each do |target|
    flutter_additional_ios_build_settings(target)
  end
end

However, removing this workaround will result in an error.

  # see...
  #   https://github.com/juliansteenbakker/mobile_scanner/issues/335#issuecomment-1308829103
  #   https://issuetracker.google.com/issues/254418199#comment48
  pod 'MLKitVision', :podspec => 'MLKitVision.podspec.json'
  pod 'MLKitCommon', :podspec => 'MLKitCommon.podspec.json'
[!] CocoaPods could not find compatible versions for pod "GTMSessionFetcher/Core":
  In Podfile:
    firebase_storage (from `.symlinks/plugins/firebase_storage/ios`) was resolved to 11.0.6, which depends on
      Firebase/Storage (= 10.2.0) was resolved to 10.2.0, which depends on
        FirebaseStorage (~> 10.2.0) was resolved to 10.2.0, which depends on
          GTMSessionFetcher/Core (< 4.0, >= 2.1)

    google_sign_in_ios (from `.symlinks/plugins/google_sign_in_ios/ios`) was resolved to 0.0.1, which depends on
      GoogleSignIn (~> 6.2) was resolved to 6.2.4, which depends on
        GTMSessionFetcher/Core (< 3.0, >= 1.1)

    mobile_scanner (from `.symlinks/plugins/mobile_scanner/ios`) was resolved to 3.0.0, which depends on
      GoogleMLKit/BarcodeScanning (~> 3.2.0) was resolved to 3.2.0, which depends on
        MLKitBarcodeScanning (~> 2.2.0) was resolved to 2.2.0, which depends on
          MLKitCommon (~> 8.0) was resolved to 8.0.0, which depends on
            GTMSessionFetcher/Core (~> 1.1)

I hope this helps.

motucraft avatar Nov 18 '22 09:11 motucraft

Well in that case it really is a problem with firebase rather than this plugin.

juliansteenbakker avatar Nov 18 '22 09:11 juliansteenbakker

Ultimately, I recognize that this is the fundamental problem. https://issuetracker.google.com/issues/254418199

motucraft avatar Nov 18 '22 09:11 motucraft

Ultimately, I recognize that this is the fundamental problem. https://issuetracker.google.com/issues/254418199

have you found any solution?

steven230500 avatar Nov 22 '22 18:11 steven230500

@steven230500 Workaround. https://github.com/juliansteenbakker/mobile_scanner/issues/335#issuecomment-1314796725

motucraft avatar Nov 23 '22 01:11 motucraft