I’m trying to add `cocoapods` plugin to my very si...
# multiplatform
k
I’m trying to add
cocoapods
plugin to my very simple library project and it fails at:
Copy code
Execution failed for task ':podspec'.
> The Gradle wrapper is required to run the build from Xcode.

Please run the same command with `-Pkotlin.native.cocoapods.generate.wrapper=true` or run the `:wrapper` task to generate the wrapper manually.
As suggested I tried to run
gradle wrapper
and it fails:
Copy code
An exception occurred applying plugin request [id: 'org.jetbrains.kotlin.multiplatform', version: '1.4.10']
> Failed to apply plugin [id 'org.jetbrains.kotlin.multiplatform']
   > The current Gradle version 5.4.1 is not compatible with the Kotlin Multiplatform plugin. Please use Gradle 6.0 or newer, or the previous version of the Kotlin plugin.
Why is that happening? In my
gradle-wrapper.properties
I’m using
distributionUrl=https\:<//services.gradle.org/distributions/gradle-6.6.1-bin.zip>
w
is there a particular version defined in a gradle file somewhere?
also maybe try
./gradlew --gradle-version 6.6.1
or whatever the upgrade command is
k
No, when I’m trying to
find in path
5.4.1 there is no results
I also checked
gradle --version
and it indeed shows
5.4.1
The thing is I can’t find a command to upgrade
gradle
Trying to install wrapper in the project directory with the command you recommended also fails:
Copy code
gradle wrapper --gradle-version 6.6.1

FAILURE: Build failed with an exception.

* Where:
Build file 'PROJECT_PATH' line: 2

* What went wrong:
An exception occurred applying plugin request [id: 'org.jetbrains.kotlin.multiplatform', version: '1.4.10']
> Failed to apply plugin [id 'org.jetbrains.kotlin.multiplatform']
   > The current Gradle version 5.4.1 is not compatible with the Kotlin Multiplatform plugin. Please use Gradle 6.0 or newer, or the previous version of the Kotlin plugin.
OK, I finally solved it by updating
gradle
via `brew`:
Copy code
brew upgrade gradle
then running
Copy code
gradle wrapper
to install wrapper in the project directory and finally synchronizing project
w
do you have a gradle wrapper in your project?
k
It turned out I didn’t have because it seems like
gradle
couldn’t install it in the project because it was on too low version. After manually upgrading system-wise gradle to 6.1.1 it installed gradle wraper in the project properly