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

[🐛] CocoaPods could not find compatible versions for pod GoogleAppMeasurement #173

Closed
1 of 5 tasks
RodolfoGS opened this issue Jun 23, 2022 · 8 comments · Fixed by #174
Closed
1 of 5 tasks

[🐛] CocoaPods could not find compatible versions for pod GoogleAppMeasurement #173

RodolfoGS opened this issue Jun 23, 2022 · 8 comments · Fixed by #174
Labels

Comments

@RodolfoGS
Copy link

Issue

I'm installing the latest versions of @react-native-firebase (15.0.0) but I receive the following error when I try to update pods (pod update)

[!] CocoaPods could not find compatible versions for pod "GoogleAppMeasurement":
  In Podfile:
    RNFBAnalytics (from `../node_modules/@react-native-firebase/analytics`) was resolved to 15.0.0, which depends on
      Firebase/Analytics (= 9.1.0) was resolved to 9.1.0, which depends on
        Firebase/Core (= 9.1.0) was resolved to 9.1.0, which depends on
          FirebaseAnalytics (~> 9.1.0) was resolved to 9.1.0, which depends on
            FirebaseAnalytics/AdIdSupport (= 9.1.0) was resolved to 9.1.0, which depends on
              GoogleAppMeasurement (= 9.1.0)

    RNGoogleMobileAds (from `../node_modules/react-native-google-mobile-ads`) was resolved to 6.3.0, which depends on
      Google-Mobile-Ads-SDK (= 9.3.0) was resolved to 9.3.0, which depends on
        GoogleAppMeasurement (< 9.0, >= 7.0)

I'm using:

    "@react-native-firebase/analytics": "^15.0.0",
    "@react-native-firebase/app": "^15.0.0",
    "@react-native-firebase/crashlytics": "^15.0.0",
    "@react-native-firebase/dynamic-links": "^15.0.0",
    "@react-native-firebase/remote-config": "^15.0.0",
    "react-native-google-mobile-ads": "^6.3.0",

Project Files

Javascript

Click To Expand

package.json:

    "@react-native-firebase/analytics": "^15.0.0",
    "@react-native-firebase/app": "^15.0.0",
    "@react-native-firebase/crashlytics": "^15.0.0",
    "@react-native-firebase/dynamic-links": "^15.0.0",
    "@react-native-firebase/remote-config": "^15.0.0",
    "react-native-google-mobile-ads": "^6.3.0",

admob.json:

# N/A

iOS

Click To Expand

ios/Podfile:

# N/A

Android

Click To Expand

android/build.gradle:

// N/A

android/app/build.gradle:

// N/A

android/settings.gradle:

// N/A

AndroidManifest.xml:

<!-- N/A -->


Environment

Click To Expand

react-native info output:

 OUTPUT GOES HERE
  • Platform that you're experiencing the issue on:
    • iOS
    • Android
    • iOS but have not tested behavior on Android
    • Android but have not tested behavior on iOS
    • Both
  • Are you using TypeScript?
    • Y/N & VERSION


  • 👉 Check out Invertase on Twitter for updates on the library.
@RodolfoGS RodolfoGS added the help wanted Extra attention is needed label Jun 23, 2022
@mikehardy
Copy link
Collaborator

How does it go when you update this to 9.6.0?

"googleMobileAds": "9.3.0",

https://developers.google.com/admob/ios/rel-notes

I'll do a speculative change to that as a PR here so it will run this action and you can get a patches.zip for patch-package use, in case that's useful, but your testing will be most useful - I won't have time to test it today

@mikehardy
Copy link
Collaborator

patches will show up here, but it is also easy to test locally: https://github.com/invertase/react-native-google-mobile-ads/actions/runs/2550290745

@RodolfoGS
Copy link
Author

I did that change, and seems that will work (maybe solved the issue) but now I'm getting another error.

[!] The following Swift pods cannot yet be integrated as static libraries:

The Swift pod `FirebaseCoreInternal` depends upon `GoogleUtilities`, which does not define modules. To opt into those targets generating module maps (which is necessary to import them from Swift when building as static libraries), you may set `use_modular_headers!` globally in your Podfile, or specify `:modular_headers => true` for particular dependencies.

I found an issue closed related with that invertase/react-native-firebase#6323 and tried the approach pod 'GoogleUtilities', :modular_headers => true
But doesn't work, pod update works but then fails the compile

I'm also using expo: 45.0.6
I'll try to create a reproducible demo

@RodolfoGS
Copy link
Author

The new issue that I'm having is not related with this, so, I think that the upgrade to 9.6.0 will work, but I'm unable to test it since I can't compile because the other issue.

I created an issue in the firebase repository with the steps to reproduce it: invertase/react-native-firebase#6332

@mikehardy
Copy link
Collaborator

Thanks for helping work through this. In my development of react-native-firebase v15, the switch to use_frameworks required by underlying firebase-ios-sdk has been quite difficult yes (for example... reactwg/react-native-releases#21 (reply in thread)) - and the fixes are subtle.

I think we'll be able to find something that works though

I have commented on RNFB 6332 with some ideas on how to move that one forward - I think it's useful to keep this issue open until we're sure we have something that works invertase/react-native-firebase#6323 (comment)

@mikehardy
Copy link
Collaborator

I have this working successfully in a non-Expo setup with react-native-firebase v15 and react-native-google-mobile-ads now

1- you need that patch to the podspec that sets our dependency here to Google-Mobile-Ads-SDK 9.6.0
2- you need a Podfile.properties.json with correct entry so that Podfile gets use_frameworks! :linkage => :dynamic value
3- you need $RNGoogleMobileAdsAsStaticFramework = true set for this module to avoid the error in the title of this issue
4- you need $RNFirebaseAsStaticFramework = true for firebase

Should work

Additionally, if you want to try react-native 0.69.0 (and/or Hermes in combination with that) you'll need this patch - https://github.com/mikehardy/rnfbdemo/blob/main/patches/react-native%2B0.69.0.patch - those changes will be picked for the upcoming react-native 0.69.1 release, they are already merged in react-native main.

In this combination with react-native-firebase v15 where use_frameworks! is required, Flipper will still not work and the new architecture will still not work

I consider this effectively closed since we've got all the parts of the solution together but I will leave it open until we release #174

@mikehardy
Copy link
Collaborator

All of these related changes are landing now - docs update, iOS SDK update, along with an android SDK update and a developer experience change. Will be batched into one release as soon as CI finishes chewing on it all 🚀

@mikehardy
Copy link
Collaborator

🎉 This issue has been resolved in version 7.0.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

@mikehardy mikehardy added released and removed help wanted Extra attention is needed labels Jun 24, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
2 participants