Appcenter-sdk-react-native: Cocoapods warns about incompatible versions when running link after updating SDK

Created on 4 Feb 2018  ·  51Comments  ·  Source: microsoft/appcenter-sdk-react-native

After npm installing version 1.2.0 of appcenter, appcenter-analytics, and appcenter-crashes, when trying to do react-native link, I get the following error:

[!] CocoaPods could not find compatible versions for pod "AppCenter/Core":
  In Podfile:
    AppCenter/Crashes (~> 1.2.0) was resolved to 1.2.0, which depends on
      AppCenter/Core (= 1.2.0)

    AppCenterReactNativeShared (~> 1.2.0) was resolved to 1.2.0, which depends on
      AppCenter/Core (= 1.3.0)

Looks like AppCenterReactNativeShared is erroneously requiring AppCenter/Core version 1.3.0.

My understanding is that CocoaPods does not do dependency resolution with multiple version of the same library, so the situation is intractable.

Here's my pod-file:

platform :ios, '9.0'

target 'MyApp' do

  # Pods for MyApp
  pod 'AppCenter/Crashes', '~> 1.2.0'
  pod 'AppCenter/Analytics', '~> 1.2.0'
  pod 'AppCenterReactNativeShared', '~> 1.2.0'

  pod 'RNDeviceInfo', :path => '../node_modules/react-native-device-info'

  pod 'RNSVG', :path => '../node_modules/react-native-svg'

  target 'MyAppTests' do
    inherit! :search_paths
    # Pods for testing
  end

end

So it looks like I cannot use both appcenter and appcenter-crashes in the current state due to the conflicting AppCenter/Core dependency version.

known issue

Most helpful comment

Ok I got it working...

  • deleted Pods directory
  • deleted Podfile.lock
  • modified my Podfile to look like this:
# Uncomment the next line to define a global platform for your project
# platform :ios, '9.0'

target 'MyApp' do
  platform :ios, '9.0'
  # Uncomment the next line if you're using Swift or would like to use dynamic frameworks
  # use_frameworks!

  # Pods for MyApp
  pod 'AppCenter/Crashes', '~> 1.3.0'
  pod 'AppCenter/Analytics', '~> 1.3.0'
  pod 'AppCenterReactNativeShared', '~> 1.2.0'

  target 'MyAppTests' do
    inherit! :search_paths
    # Pods for testing
  end

end

(note that I moved the platform :ios, '9.0' line INSIDE the target

  • cd ios && pod install ( I had previously already done pod repo update
  • cd ../
  • react-native link

All 51 comments

Same Issue.

# Uncomment the next line to define a global platform for your project
# platform :ios, '9.0'

target 'storywriter' do
  # Uncomment the next line if you're using Swift or would like to use dynamic frameworks
  # use_frameworks!

  # Pods for storywriter
  pod 'AppCenter/Crashes', '~> 1.3.0'
  pod 'AppCenter/Analytics', '~> 1.3.0'
  pod 'AppCenterReactNativeShared', '~> 1.2.0'



  pod 'RNVectorIcons', :path => '../node_modules/react-native-vector-icons'

  pod 'BVLinearGradient', :path => '../node_modules/react-native-linear-gradient'

  target 'storywriterTests' do
    inherit! :search_paths
    # Pods for testing
  end

end

target 'storywriter-tvOS' do
  # Uncomment the next line if you're using Swift or would like to use dynamic frameworks
  # use_frameworks!

  # Pods for storywriter-tvOS

  target 'storywriter-tvOSTests' do
    inherit! :search_paths
    # Pods for testing
  end

end

Hi @andrewzey, after installing npm pacakges, can you remove your ios/Podfile.lock and try react-native link again?

appcenter-* v1.2,0 (e.g. appcenter-crashes) take dependency on AppCenterReactNativeShared v1.2.0 cocoapods, which itself takes dependency on AppCenter/Core and v1.3.0 cocoapods. The error is likely caused by cocoapod confused by different version of the same library (i.e., AppCenter/Core) referenced in the Podfile when react-native link try to upgrade appcenter-* pacakges one by one instead of altogether. When you remove the ios/Podfile.lock file and run react-native link again, cocoapods should resolve to the right version. If you're still not sure, this Podfile of our internal testing app is a good place to refer to.

Let us know if this still doesn't help.

I’ll try this as well.
On Sun, Feb 4, 2018 at 10:20 PM Di Hei notifications@github.com wrote:

Hi @andrewzey https://github.com/andrewzey, after installing npm
pacakges, can you remove your ios/Podfile.lock and try react-native link
again?

appcenter-* v1.2,0 (e.g. appcenter-crashes) take dependency on
AppCenterReactNativeShared v1.2.0 cocoapods, which itself takes
dependency on AppCenter/Core and v1.3.0 cocoapods. The error is likely
caused by cocoapod confused by different version of the same library (i.e.,
AppCenter/Core) referenced in the Podfile when react-native link try to
upgrade appcenter-* pacakges one by one instead of altogether. When
you remove the ios/Podfile.lock file and run react-native link again,
cocoapods should resolve to the right version. If you're still not sure,
this Podfile
https://github.com/Microsoft/AppCenter-SDK-React-Native/blob/1.2.0/DemoApp/ios/Podfileof
our internal testing app is a good place to refer to.

Let us know if this still doesn't help.


You are receiving this because you commented.
Reply to this email directly, view it on GitHub
https://github.com/Microsoft/AppCenter-SDK-React-Native/issues/236#issuecomment-362992034,
or mute the thread
https://github.com/notifications/unsubscribe-auth/AM94FMac6_BbLDOu8HDWWHbHxRNafiMjks5tRp2RgaJpZM4R4c7x
.

@dhei Thanks for the quick reply. I've already cleared the ios/Podfile.lock and tried doing react-native link again, but unfortunately it did not help.

It looks like the reference Podfile you linked is a bit different from mine, so I'll try adjusting mine accordingly and report back if I can resolve the problem.

I have the same issue. Tried one by one update, but no luck.

  pod 'AppCenter/Crashes', '~> 1.3.0'
  pod 'AppCenter/Analytics', '~> 1.3.0'
  pod 'AppCenterReactNativeShared', '~> 1.2.0'

Same issue here. Is required to execute other command like pod repo update or pod install to upgrade the packages?

Analyzing dependencies
Fetching podspec for `CodePush` from `../node_modules/react-native-code-push`
[!] CocoaPods could not find compatible versions for pod "AppCenterReactNativeShared":
  In Podfile:
    AppCenterReactNativeShared (~> 1.2.0)

Specs satisfying the `AppCenterReactNativeShared (~> 1.2.0)` dependency were found, but they required a higher minimum deployment target.

module.js:471
    throw err;
    ^

Error: Cannot find module 'appcenter-link-scripts'
    at Function.Module._resolveFilename (module.js:469:15)
    at Function.Module._load (module.js:417:25)
    at Module.require (module.js:497:17)
    at require (internal/module.js:20:19)
    at Object.<anonymous> (/Users/jdnichollsc/dev/bevyup/reactnative/react-native/node_modules/appcenter-analytics/scripts/prelink.js:1:80)
    at Module._compile (module.js:570:32)
    at Object.Module._extensions..js (module.js:579:10)
    at Module.load (module.js:487:32)
    at tryModuleLoad (module.js:446:12)
    at Function.Module._load (module.js:438:3)
/Users/jdnichollsc/dev/bevyup/reactnative/react-native/node_modules/react-native/local-cli/core/makeCommand.js:29
        throw new Error(`Error occured during executing "${command}" command`);
        ^

Error: Error occured during executing "node node_modules/appcenter-analytics/scripts/prelink" command
    at ChildProcess.prelink (/Users/jdnichollsc/dev/bevyup/reactnative/react-native/node_modules/react-native/local-cli/core/makeCommand.js:29:15)
    at emitTwo (events.js:106:13)
    at ChildProcess.emit (events.js:191:7)
    at maybeClose (internal/child_process.js:920:16)
    at Process.ChildProcess._handle.onexit (internal/child_process.js:230:5)

Thanks in advance, Nicholls

@jdnichollsc
pod install is executed during react-native link command, so you don't have to run anything manually.
Could you please share you Podfile and the output of react-native info command?

@jdnichollsc @thejohnbackes @pkelecom try adding line
platform :ios, '9.0'
to your podfile globally or to the target section.
Note that this line is necessary with versions of AppCenter 1.3.0 and AppCenterReactNativeShared 1.2.0

Ohh thanks for your quickly response, I'm executing react-native link to upgrade the packages, so that was the confusion.

Podfile =>

# Uncomment the next line to define a global platform for your project
# platform :ios, '9.0'

target 'bevyUp' do
  # Uncomment the next line if you're using Swift or would like to use dynamic frameworks
  # use_frameworks!

  # Pods for bevyUp
  pod 'AppCenter/Crashes', '~> 1.1.0'
  pod 'AppCenter/Analytics', '~> 1.1.0'
  pod 'AppCenterReactNativeShared', '~> 1.2.0'

  pod 'CodePush', :path => '../node_modules/react-native-code-push'

  target 'bevyUpTests' do
    inherit! :search_paths
    # Pods for testing
  end

end

target 'bevyUp-tvOS' do
  # Uncomment the next line if you're using Swift or would like to use dynamic frameworks
  # use_frameworks!

  # Pods for bevyUp-tvOS

  target 'bevyUp-tvOSTests' do
    inherit! :search_paths
    # Pods for testing
  end

end

react-native info =>

Scanning folders for symlinks in /Users/jdnichollsc/dev/bevyup/reactnative/react-native/node_modules (15ms)

Environment:
  OS: macOS High Sierra 10.13.3
  Node: 6.11.4
  Yarn: 1.1.0
  npm: 5.6.0
  Watchman: 4.9.0
  Xcode: Xcode 9.2 Build version 9C40b
  Android Studio: 2.3 AI-162.4069837

Packages: (wanted => installed)
  react: 16.2.0 => 16.2.0
  react-native: 0.52.1 => 0.52.1

Thanks in advance!

I'm getting the same issue executing react-native link:

Added code to initialize iOS AppCenter SDK in ios/bevyUp/AppDelegate.m
Analyzing dependencies
Fetching podspec for `CodePush` from `../node_modules/react-native-code-push`
[!] CocoaPods could not find compatible versions for pod "AppCenter/Core":
  In Podfile:
    AppCenter/Analytics (~> 1.1.0) was resolved to 1.1.0, which depends on
      AppCenter/Core (= 1.1.0)

    AppCenterReactNativeShared (~> 1.2.0) was resolved to 1.2.0, which depends on
      AppCenter/Core (= 1.3.0)

I'm going to try removing all references of AppCenter

@jdnichollsc try upgrading AppCenter modules to 1.3.0 and AppCenterReactNativeShared to 1.2.0

@bmourat but the last version of AppCenter from npm is 1.2.0

Running pod repo update is required every time as new pods are published globally on cocoapods, not just our SDK.

Also RN version can be different than the underlying SDKs it wraps (Apple SDK is 1.3.0).

Ok, works removing all references of AppCenter manually again, reinstalling pods, removing and adding the node_modules with npm i and later executing react-native link...

Where did you remove AppCebter references? from Podfile?
On Tue, Feb 6, 2018 at 2:36 PM Juan David Nicholls Cardona <
[email protected]> wrote:

Ok, works removing all references of AppCenter manually again,
reinstalling pods, removing and adding the node_modules with npm i and
later executing react-native link...


You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
https://github.com/Microsoft/AppCenter-SDK-React-Native/issues/236#issuecomment-363588852,
or mute the thread
https://github.com/notifications/unsubscribe-auth/AM94FGc2sVHN3LBCXF4BeQ-MQfbw0vsVks5tSNPSgaJpZM4R4c7x
.

@thejohnbackes have you tried pod repo update before running react-native link again already?

The error from original issue is clearly pod related not resolved because pod repo not up-to-date.

I tried pod repo update but it doesn't work
@thejohnbackes I removed Pods folder and all references of AppCenter in the code of React Native (Not from my code). After execute pod install from ios folder, reinstall npm packages and execute react-native link from the root, the app works well again

sounds like fun 🙄
On Tue, Feb 6, 2018 at 2:53 PM Juan David Nicholls Cardona <
[email protected]> wrote:

I tried pod repo update but it doesn't work
@thejohnbackes https://github.com/thejohnbackes I removed Pods folder
and all references of AppCenter in the code of React Native (Not from my
code). After reinstall npm packages and execute react-native link the app
works well again


You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
https://github.com/Microsoft/AppCenter-SDK-React-Native/issues/236#issuecomment-363593066,
or mute the thread
https://github.com/notifications/unsubscribe-auth/AM94FHL5bRd3BF1Q6jd4Moii4bMQ2dgPks5tSNfbgaJpZM4R4c7x
.

a lot of fun hahaha 😅

Still the same for me even doing pod repo update and removing all references of AppCenter as suggested by @jdnichollsc .

For reference Podfile is

# Uncomment the next line to define a global platform for your project
# platform :ios, '9.0'

target 'abc' do
  # Uncomment the next line if you're using Swift or would like to use dynamic frameworks
  # use_frameworks!

  platform :ios, '8.0'

  # Pods for abc
  pod 'AppCenter/Crashes', '~> 1.3.0'
  pod 'AppCenter/Analytics', '~> 1.3.0'
  pod 'AppCenterReactNativeShared', '~> 1.2.0'

  target 'abcTests' do
    inherit! :search_paths
    # Pods for testing
  end

end

And react-native link show:

[!] CocoaPods could not find compatible versions for pod "AppCenter/Crashes":
  In Podfile:
    AppCenter/Crashes (~> 1.3.0)

Specs satisfying the `AppCenter/Crashes (~> 1.3.0)` dependency were found, but they required a higher minimum deployment target.

@pkelecom I think you need to uncomment the first line with the minimum platform version required as @bmourat says... example:

# Uncomment the next line to define a global platform for your project
platform :ios, '9.0'

target 'bevyUp' do
  # Uncomment the next line if you're using Swift or would like to use dynamic frameworks
  # use_frameworks!

  # Pods for bevyUp
  pod 'AppCenter/Crashes', '~> 1.3.0'
  pod 'AppCenter/Analytics', '~> 1.3.0'
  pod 'AppCenterReactNativeShared', '~> 1.2.0'

  target 'bevyUpTests' do
    inherit! :search_paths
    # Pods for testing
  end

end

target 'bevyUp-tvOS' do
  # Uncomment the next line if you're using Swift or would like to use dynamic frameworks
  # use_frameworks!

  # Pods for bevyUp-tvOS

  target 'bevyUp-tvOSTests' do
    inherit! :search_paths
    # Pods for testing
  end

end

Hi @andrewzey!
Is your issue resolved?

I took the following steps to fix:
pod repo update
react-native link
react-native run-ios --simulator

=== BUILD TARGET AppCenterReactNative OF PROJECT AppCenterReactNative WITH CONFIGURATION Debug ===


Check dependencies

Argument list too long: recursive header expansion failed at /Users/jwbackes/dev/storywriter/node_modules/appcenter/ios/../../../ios/Pods/React/node_modules/xtend.



** BUILD FAILED **



The following commands produced analyzer issues:
        Analyze /Users/jwbackes/dev/storywriter/node_modules/react-native/ReactCommon/yoga/yoga/Yoga.cpp
        Analyze Base/RCTModuleMethod.mm
(2 commands with analyzer issues)

The following build commands failed:
        Check dependencies
(1 failure)

So next I did the following:

  • removed Pods folder
  • removed build folder
    pod repo update
    react-native link
    react-native run-ios --simulator
    ...waited...

Same failure. I'm going to rebuild with entirely fresh app.

Here is my podfile:

# Uncomment the next line to define a global platform for your project
platform :ios, '9.0'

target 'storywriter' do
  # Uncomment the next line if you're using Swift or would like to use dynamic frameworks
  # use_frameworks!

  # Pods for storywriter
  pod 'AppCenter/Crashes', '~> 1.3.0'
  pod 'AppCenter/Analytics', '~> 1.3.0'


  pod 'AppCenterReactNativeShared', '~> 1.2.0'



  pod 'RNVectorIcons', :path => '../node_modules/react-native-vector-icons'

  pod 'BVLinearGradient', :path => '../node_modules/react-native-linear-gradient'

  target 'storywriterTests' do
    inherit! :search_paths
    # Pods for testing
  end

end

target 'storywriter-tvOS' do
  # Uncomment the next line if you're using Swift or would like to use dynamic frameworks
  # use_frameworks!

  # Pods for storywriter-tvOS

  target 'storywriter-tvOSTests' do
    inherit! :search_paths
    # Pods for testing
  end

end

Still having the same issue. I've reproduced with an absolutely fresh installation:

Using the react-native-cli:

react-native init --version="0.51.0" MyApp
cd MyApp
npm i --save appcenter appcenter-analytics appcenter-crashes
pod repo update
react-native link

results in the following:

MyApp - master! ❯ react-native link
Scanning folders for symlinks in /Users/andrewzey/repos/rp/MyApp/node_modules (11ms)
Configuring AppCenter
? What is the Android App Secret?
App Secret for Android written to android/app/src/main/assets/appcenter-config.json
rnpm-install info Linking appcenter android dependency
rnpm-install info Android module appcenter has been successfully linked
rnpm-install info Linking appcenter ios dependency
rnpm-install info iOS module appcenter has been successfully linked
? What is the iOS App Secret?
App Secret for iOS written to ios/MyApp/AppCenter-Config.plist
Added code to initialize iOS AppCenter SDK in ios/MyApp/AppDelegate.m
Analyzing dependencies
[!] CocoaPods could not find compatible versions for pod "AppCenterReactNativeShared":
  In Podfile:
    AppCenterReactNativeShared (~> 1.2.0)

Specs satisfying the `AppCenterReactNativeShared (~> 1.2.0)` dependency were found, but they required a higher minimum deployment target.

[!] Automatically assigning platform `ios` with version `8.0` on target `MyApp` because no platform was specified. Please specify a platform for this target in your Podfile. See `https://guides.cocoapods.org/syntax/podfile.html#platform`.

[!] Automatically assigning platform `tvos` with version `9.2` on target `MyApp-tvOS` because no platform was specified. Please specify a platform for this target in your Podfile. See `https://guides.cocoapods.org/syntax/podfile.html#platform`.
Configuring AppCenter Analytics
? For the Android app, should user tracking be enabled automatically? Enable Automatically
rnpm-install info Linking appcenter-analytics android dependency
rnpm-install info Android module appcenter-analytics has been successfully linked
rnpm-install info Linking appcenter-analytics ios dependency
rnpm-install info iOS module appcenter-analytics has been successfully linked
? What is the iOS App Secret?
App Secret for iOS written to ios/MyApp/AppCenter-Config.plist
? For the iOS app, should user tracking be enabled automatically? Enable Automatically
Added code to initialize iOS Analytics SDK in ios/MyApp/AppDelegate.m
Analyzing dependencies
[!] CocoaPods could not find compatible versions for pod "AppCenter/Analytics":
  In Podfile:
    AppCenter/Analytics (~> 1.3.0)

Specs satisfying the `AppCenter/Analytics (~> 1.3.0)` dependency were found, but they required a higher minimum deployment target.

[!] Automatically assigning platform `ios` with version `8.0` on target `MyApp` because no platform was specified. Please specify a platform for this target in your Podfile. See `https://guides.cocoapods.org/syntax/podfile.html#platform`.

[!] Automatically assigning platform `tvos` with version `9.2` on target `MyApp-tvOS` because no platform was specified. Please specify a platform for this target in your Podfile. See `https://guides.cocoapods.org/syntax/podfile.html#platform`.
Configuring AppCenter Crashes
? What is the Android App Secret?
App Secret for Android written to android/app/src/main/assets/appcenter-config.json
? For the Android app, should crashes be sent automatically or processed in JavaScript before being sent? Automatically
rnpm-install info Linking appcenter-crashes android dependency
rnpm-install info Android module appcenter-crashes has been successfully linked
rnpm-install info Linking appcenter-crashes ios dependency
rnpm-install info iOS module appcenter-crashes has been successfully linked
? What is the iOS App Secret?
App Secret for iOS written to ios/MyApp/AppCenter-Config.plist
? For the iOS app, should crashes be sent automatically or processed in JavaScript before being sent? Automatically
Added code to initialize iOS Crashes SDK in ios/MyApp/AppDelegate.m
Analyzing dependencies
[!] CocoaPods could not find compatible versions for pod "AppCenter/Crashes":
  In Podfile:
    AppCenter/Crashes (~> 1.3.0)

Specs satisfying the `AppCenter/Crashes (~> 1.3.0)` dependency were found, but they required a higher minimum deployment target.

[!] Automatically assigning platform `ios` with version `8.0` on target `MyApp` because no platform was specified. Please specify a platform for this target in your Podfile. See `https://guides.cocoapods.org/syntax/podfile.html#platform`.

[!] Automatically assigning platform `tvos` with version `9.2` on target `MyApp-tvOS` because no platform was specified. Please specify a platform for this target in your Podfile. See `https://guides.cocoapods.org/syntax/podfile.html#platform`.

Ok I got it working...

  • deleted Pods directory
  • deleted Podfile.lock
  • modified my Podfile to look like this:
# Uncomment the next line to define a global platform for your project
# platform :ios, '9.0'

target 'MyApp' do
  platform :ios, '9.0'
  # Uncomment the next line if you're using Swift or would like to use dynamic frameworks
  # use_frameworks!

  # Pods for MyApp
  pod 'AppCenter/Crashes', '~> 1.3.0'
  pod 'AppCenter/Analytics', '~> 1.3.0'
  pod 'AppCenterReactNativeShared', '~> 1.2.0'

  target 'MyAppTests' do
    inherit! :search_paths
    # Pods for testing
  end

end

(note that I moved the platform :ios, '9.0' line INSIDE the target

  • cd ios && pod install ( I had previously already done pod repo update
  • cd ../
  • react-native link

What is your version of Cocoapods? pod --version

Mine is 1.4.0

We were suspecting an issue with 1.4.0 and are making changes to support that Cocoapod version. The problem does not happen with 1.3.1.

@andrewzey solution worked for me. Thanks!

@guperrot I'm on pod version 1.3.1 and experiencing the same issue. @andrewzey s solution is not working for me.

the error:

Argument list too long: recursive header expansion failed at 
/Users/mehdijjz/MY_PROJECT_PATH/node_modules/appcenter-crashes/ios/../../../ios/Pods/React/node_modules/mkdirp/bin.

@mehdijjz I ran into that error as well. It has to do with the node_modules directory in the React pod. If you delete it, the error will go away.

I manually linked the 2 libraries I was using that resulted in the React pod being installed (react-native-device-info and react-native-svg), removed them from my Podfile, and then deleted the Pods directory (to ensure that the React pod would not be installed as a transitive dependency).

Then everything worked for me.

@andrewzey @mehdijjz this is not the same issue, this one is already fixed in #209 and happens because you have not updated successfully to 1.2.0 yet. After you can eventually use 1.2.0 you should not see that one anymore.

@andrewzey suggestion works BUT platform :ios, '9.0' need to be 9.0! I am using 8.0 in my project...

That means that I have to change my project to 9.0 in order to use this new version?

For reference cocoa pod version is 1.4.0

@pkelecom The SDK now requires iOS 9.

See 1.2.0 changelog:

This release contains bugfixes and a breaking change. The SDK now requires iOS 9 or later.

@MatkovIvan Ow, thanks for the confirmation. So it works fine for me if use iOS 9 and doing the @andrewzey suggestion. Thanks!

Any official solution to the issue?

Hi @yaronlevi,

Not sure what exactly you are asking for but

  • make sure your target iOS version is 9.0
  • make sure you run pod repo update

And, in case rn link fails, follow Andrew's workflow of:

  • deleted Pods directory
  • deleted Podfile.lock
  • modified my Podfile to target iOS 9
  • cd ios && pod install
  • cd ../
  • react-native link

Let us know if this helped, and if not, what issues you are seeing.

Best,
Benjamin

Make also sure that SDK 1.3.0 is used instead of 1.2.0 (to fix cocoapod support of version 1.4.0).
We have a known issue with running react-native link with 0.53 that we are currently fixing. So you might need to downgrade to 0.52 before linking then update react-native after.

This is the solution that worked for me

npm install --save appcenter-link-scripts

That's all it took, then everything worked fine

@thejohnbackes your issue is different than other developers here. You will find a work around for that particular header expansion problem at https://github.com/Microsoft/AppCenter-SDK-React-Native/issues/246#issuecomment-369759068

@yaronlevi there are quite different issues discussed in the same thread here. Can you describe exactly the problem you are experiencing. If it does not match another existing comment here, please create a separate issue as this thread starts becoming very complex to follow.

@agates4 what was your exact problem in your case that explicitly installing this package fixed? any appcenter package depends on appcenter-link-scripts and appcenter-link-scripts does not have prelink/poslink scripts on its own, just shared code.

A simpler version of https://github.com/Microsoft/AppCenter-SDK-React-Native/issues/236#issuecomment-363948350 if you have not yet tried updating to SDK 1.3.0 is (from a git status clean version before anything was broken in your project):

After updating npms to 1.3.0, edit preemptively Podfile to match (edit versions of the pods, make sure platform version is 9.0):

# Uncomment the next line to define a global platform for your project
# platform :ios, '9.0'

target 'MyApp' do
  platform :ios, '9.0'
  # Uncomment the next line if you're using Swift or would like to use dynamic frameworks
  # use_frameworks!

  # Pods for MyApp
  pod 'AppCenter/Crashes', '~> 1.4.0'
  pod 'AppCenter/Analytics', '~> 1.4.0'
  pod 'AppCenterReactNativeShared', '~> 1.3.0'

  target 'MyAppTests' do
    inherit! :search_paths
    # Pods for testing
  end

end

Then run react-native link only after that edit and in that case it works in 1 shot. We will need to improve the postlink script to avoid the chicken and egg problem with pods between the different modules.

This workaround requires knowing which pod versions of the Apple SDK our React wrapper depends on though.

Actually react-native link updates App Center modules one by one hence the temporary conflicts, however, the last module to be linked will not display the error.

If you had the conflict error, you can check that it is solved by just running react-native link a second time.

I had a similar error with AppCenter/Push. In my case, the issue was that I had several AppCenter dependencies, but one was pointing to a different version than the others.

So, I had to change:

pod 'AppCenter/Crashes', '~> 1.6.0'
pod 'AppCenter/Analytics', '~> 1.6.0'
pod 'AppCenter/Push', '~> 1.13.2'

to:

pod 'AppCenter/Crashes', '~> 1.13.2'
pod 'AppCenter/Analytics', '~> 1.13.2'
pod 'AppCenter/Push', '~> 1.13.2'

Then run pod install again, and it resolved the issue.

Came across this page on Google for a similar issue; downgrading to [email protected] worked for now.

AppCenterReactNativeShared version must be one point lower than other libs. For example this is my podfile
pod 'AppCenter/Core', '~> 1.10.0'
pod 'AppCenter/Crashes', '~> 1.10.0'
pod 'AppCenter/Analytics', '~> 1.10.0'
pod 'AppCenterReactNativeShared', '~> 1.9.0'

In my case running pod repo update solved the issue.

note: 10.16.3
appcenter 2.1.2
react-native 0.58
for ios
while react-native link appcenter
command not found

@MarvanN this looks like a separate issue, could you open one in our repo?

Was this page helpful?
0 / 5 - 0 ratings

Related issues

rafaelcorreiapoli picture rafaelcorreiapoli  ·  5Comments

newyankeecodeshop picture newyankeecodeshop  ·  4Comments

thomasgazzoni picture thomasgazzoni  ·  5Comments

elnygren picture elnygren  ·  5Comments

CodyBrouwers picture CodyBrouwers  ·  4Comments