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

When building for iOS, error: "CocoaPods could not find compatible versions for pod "EXDevice"" #163

Closed
realfresh opened this issue Dec 26, 2020 · 14 comments

Comments

@realfresh
Copy link

realfresh commented Dec 26, 2020

Good news is I worked out the issue. Figured I'd post it here in case someone else is struggling.

I'm using expos build service + managed workflow for expo app (SDK 40) + yarn package manager.

Initially, my builds were fine but after I added sentry-expo, the iOS builds started failing with this:

....
....
Make sure following dependencies of your project are resolving to one specific version:
 expo-updates, expo-device
Auto-linking React Native modules for target `BNODrivers`: RNCMaskedView, RNGestureHandler, RNReanimated, RNScreens, and react-native-safe-area-context
Analyzing dependencies
Fetching podspec for `DoubleConversion` from `../node_modules/react-native/third-party-podspecs/DoubleConversion.podspec`
Fetching podspec for `Folly` from `../node_modules/react-native/third-party-podspecs/Folly.podspec`
Fetching podspec for `glog` from `../node_modules/react-native/third-party-podspecs/glog.podspec`
[!] CocoaPods could not find compatible versions for pod "EXDevice":
  In Podfile:
    EXDevice (from `../node_modules/sentry-expo/node_modules/expo-device/ios`)
Specs satisfying the `EXDevice (from `../node_modules/sentry-expo/node_modules/expo-device/ios`)` dependency were found, but they required a higher minimum deployment target.
Xcode build logs not found
Build failed: pod exited with non-zero code: 1

The issue is that expo SDK 40.0.1 seems to only be compatible with the package expo-device (2.4.0). However, when installing Sentry expo, yarn installs expo-device (3.0.0) causing the build issue.

To fix this, what you must do is add the following to your package.json file.

{
  "dependencies": {...}
  "resolutions": {
    "expo-device": "~2.4.0"
  }
}

This will force yarn to resolve the correct version thereby fixing the problem.

@realfresh
Copy link
Author

So as it turns out, this was only the start of an endless stream of problems. Seems to be a lot of dependency related issues when using this library and expo sdk 40. On android is fine but iOS it always crashes after calling Sentry.init when the app starts.

Literally can't get it to work no matter what I try.

@celsoernani
Copy link

Its work

@realfresh
Copy link
Author

Good to hear you got it working. I'm still struggling to get it to work. I don't understand exactly what's going wrong but I'm pretty sure its something dependency related. I think sentry-expo is installing expo packages with versions that are not compatible with expo 40 SDK. I've tried going through the dependencies but I was unable to pinpoint the issue.

Not sure if anyone can make sense of this but here's one of the iOS crash logs from the iPhone.

image

@LRNZ09
Copy link

LRNZ09 commented Dec 29, 2020

It seems to be a problem with unimodules searching within sentry-expo node_modules folder too.

@CLASHERBROs
Copy link

CLASHERBROs commented Jan 1, 2021

Try changing platform to a higher ios in podflie

@roger-ngx
Copy link

changing platform from 10 to 11 fixed

@alex-grover
Copy link

I had to pin both expo-device=~2.3.0 and expo-constants=~9.2.0 to fix the build issues with SDK v39. Found those versions by expo installing those packages and seeing what compatible version was chosen. For expo-constants this meant adding it to the resolutions section of the package.json, even though it was already pinned to a single version in the dependencies section.

I'm also still getting a crash on app startup, before sentry is initialized, with my EAS builds. I don't think it's related to sentry-expo though as it was happening before I added that to my app

@LRNZ09
Copy link

LRNZ09 commented Jan 27, 2021

Changing platform to a higher iOS version in Podfile is NOT a solution.

@cruzach
Copy link
Contributor

cruzach commented Jan 27, 2021

Hi all, sorry about this! It should be fixed in [email protected] which is currently published as next

Please install that, and re-run pod install, and you can keep your deployment target at 10. (Will probably release a new version of sentry-expo soon that drops support for iOS 10)

@cruzach cruzach closed this as completed Jan 27, 2021
@cruzach
Copy link
Contributor

cruzach commented Jan 29, 2021

Just wanted to follow-up here and see how that fix was working for those that have implemented it?

@allan-simon
Copy link

I just got the problem, I'm going to tell you very soon it that fix the issue :)

@allan-simon
Copy link

I confirm to you now the build pass

@alcidesbsilvaneto
Copy link

I was having the same problem with managed app when trying to build with eas build --local. My problem was I installed "expo-device" package with yarn instead of expo install. Running expo install expo-device worked.

@bartemb
Copy link

bartemb commented Feb 6, 2024

I had this problem with expo-system-ui. Version 2.4.0 showed a minimal version 12.0 in podspec, which matched the platform in the Podfile. I downgraded with npm i [email protected], did pod install at it's working now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

10 participants