diff --git a/samples/cocoapods/build.sh b/samples/cocoapods/build.sh index 46483b3dc07..322e9cf4ba3 100755 --- a/samples/cocoapods/build.sh +++ b/samples/cocoapods/build.sh @@ -5,6 +5,17 @@ DIR=$(cd "$(dirname "${BASH_SOURCE[0]}" )" && pwd ) KOTLIN_DIR="$DIR/kotlin-library" IOS_DIR="$DIR/ios-app" +#Check CocoaPods version. +REQUIRED_POD_VERSION="1.6.1" +POD_VERSION=`pod --version` +EARLIER_VERSION=`echo "$POD_VERSION $REQUIRED_POD_VERSION" | tr " " "\n" | sort -V | head -1` + +if [ "$EARLIER_VERSION" != "$REQUIRED_POD_VERSION" ]; then + echo "ERROR: This version of CocoaPods is unsupported. Current version is $POD_VERSION. Minimal required version is $REQUIRED_POD_VERSION." + echo "See update instructions at https://guides.cocoapods.org/using/getting-started.html#updating-cocoapods" + exit 1 +fi + # Prepare Kotlin/Native project to be consumed by CocoaPods. "$KOTLIN_DIR/gradlew" -p "$KOTLIN_DIR" podspec