Mohan Gopi
Mohan Gopi

Reputation: 7724

The Task.leftShift(Closure) method has been deprecated and is scheduled to be removed in Gradle 5.0. Please use Task.doLast(Action) instead

I have created an blank project and successfully build and run in my device

but when i add this plugin ionic cordova plugin add cordova-plugin-geofence and give ionic cordova run android i am getting the error as

i have not written any code

below

Upvotes: 2

Views: 8570

Answers (5)

kautikmistry
kautikmistry

Reputation: 746

getting same problem in ionic 5 build and solved by running the following commands

cordova clean android
cordova plugin add cordova-android-support-gradle-release

Upvotes: 0

Sumant Singh
Sumant Singh

Reputation: 1020

Change the Package.json file

"cordova-android": "6.2.0"

Upvotes: 0

Anand_5050
Anand_5050

Reputation: 1159

go to ionic_folder/platforms/android/build.gradle

If you see this lines of code in your file

buildscript {
    repositories {
        jcenter()
        maven {
            url "https://maven.google.com"
        }

    }
Change the order of the executions

  buildscript {
    repositories {

        maven {
            url "https://maven.google.com"
        }
        jcenter()

    }
Then go again and run your application by doing ionic cordova run android

Upvotes: 0

Anand_5050
Anand_5050

Reputation: 1159

Just to clarify, I changed my package.json to:

"cordova-android": "6.2.0",

which fixed the problem for me.

Upvotes: 0

Gandhi
Gandhi

Reputation: 11935

You gotta open your Andoroid SDK Manager and install the following components as mentioned in the error:

  1. SDK Patch Applier V4
  2. Google repositoty
  3. Android Support Library

Upvotes: 0

Related Questions