This version of android studio is incompatible with the gradle version used.Try disabling the instant run

前端 未结 10 1081
长发绾君心
长发绾君心 2020-12-07 20:05

I am able to build the app properly, but when I run it I get this error:

This version of android studio is incompatible with the gradle version used.Try dis         


        
相关标签:
10条回答
  • 2020-12-07 20:13

    As commented by sjd: Just cleaning the project and build again might help if you, just like me, have used the automatic update applied by android studio.

    0 讨论(0)
  • 2020-12-07 20:14

    I had easy steps & correct way also

    1 - In Settings -> Build, Execution, Deployment option -> Instant Run

    2 - Clear Enable instant run to hot swap code

    3 - Clean project

    p/s : It should totally work.

    0 讨论(0)
  • 2020-12-07 20:20

    I did fix by this way.

    Update your classpath to classpath 'com.android.tools.build:gradle:2.0.0' in your top level build.gradle file.

    Done

    0 讨论(0)
  • 2020-12-07 20:25

    The Gradle Plugin used is typically the same as the version of Android studio you are using.

    Check the Android Studio version

    Help → About

    and the version will read Android Studio Version X.Y.Z

    Then, go to

    Project → Gradle Scripts → build.gradle(Project)

    and under dependencies change the classpath to

    classpath 'com.android.tools.build:gradle:X.Y.Z'

    and rebuild/sync the project.

    0 讨论(0)
  • 2020-12-07 20:29

    I wanted to run the app in debug mode and got the same message, so I tried:

    • File > Invalidate caches and restart...
    • Clean project
    • Build project

    Nothing worked...

    Then, I just clicked on the green arrow to run the project without debugging...

    Worked!

    So then I just added a debugging session with the option left of the stop button in Android Studio.

    0 讨论(0)
  • 2020-12-07 20:30

    You can disable instant run by follow these steps in Android Studio:

    File → Settings → Preferences dialog → Build → Execution → Deployment → Instant Run → Update Project

    This feature introduced in Android Studio 2. however, when you disable it, next time when you try to push new app to your emulator is running much slower.

    In my case I just update Android Studio to the latest build from canary channel and it's works without disable this feature.

    Hope it's help

    0 讨论(0)
提交回复
热议问题