1. 程式人生 > >Android Studio新增AAR檔案報錯:the versions of the android gradle plugin and gradle are not compatible,plea

Android Studio新增AAR檔案報錯:the versions of the android gradle plugin and gradle are not compatible,plea

   在專案新增AAR檔案報錯:Error:Execution failed for task ':app:prepareAlivcPlayerLibrary'.

> Could not expand ZIP '/xxxx/app/libs/AlivcPlayer.aar'.

報錯原因:本地gradle版本過低,

因此修改 工程根目錄-->gradle-->wrapper--->gradle-wrapper.properties檔案:

distributionUrl=https\://services.gradle.org/distributions/gradle-4.1-all.zip

這時報錯,提示版本不相容:

the versions of the android gradle plugin and gradle are not compatible,please do one of the followig 如圖:


修改 工程根目錄--->build.gradle檔案 即可


修改版本號為:

dependencies {
    classpath 'com.android.tools.build:gradle:3.0.1'