2

I'm using OjbectBox for the first time in my Flutter project. After I wrote the basic code to read and right user data, I'm getting this error:

[!] CocoaPods could not find compatible versions for pod "ObjectBox":
  In Podfile:
    objectbox_flutter_libs (from `.symlinks/plugins/objectbox_flutter_libs/ios`) was resolved to 0.0.1, which depends on
      ObjectBox (= 1.6.0)

    objectbox_sync_flutter_libs (from `.symlinks/plugins/objectbox_sync_flutter_libs/ios`) was resolved to 0.0.1, which depends on
      ObjectBox (= 1.6.0-sync)

I did what's recommended in this answer (first one) but I'm getting the same error when I try to update with pod install --repo-update.

Any idea how to solve this?

Lee Maan
  • 699
  • 3
  • 10
  • 30
  • Please check this answer. May be It will be your answer [url](https://stackoverflow.com/questions/69336969/flutter-cocoapods-could-not-find-compatible-version-cache-and-betterplayer/69341182#69341182) – Tushar Moradiya Oct 29 '21 at 04:55
  • @TusharMoradiya Thanks but it didn't work for me. There is something wrong with ObjectBox library itself. I better go them. – Lee Maan Oct 29 '21 at 12:39

2 Answers2

1

The way I solved this is by doing 3 things:

1- Deleting the sync library objectbox_sync_flutter_libs entirely (I don't necessarily want to sync between devices. I just thought it would be cool to use it in the future but it's not a must). 2- Changing the version of objectbox_flutter_libs to 'any'. 3- Using a version for objectbox_generator that's similar to ObjectBox version, which is 1.2.0 in my case.

There was no need for any flutter clean or deleting podfile_lock and re-getting or so, at least for my case.

Lee Maan
  • 699
  • 3
  • 10
  • 30
1

You needed to have platform :ios, '11.0' top of the Podfile, along with the other setup instructions.