BUG-解决Plugin with id 'com.android.application' not found.问题

问题产生背景:
很久之前的项目,今天由于新的需求需要翻出来,但是同步之后发现出现以下问题:

FAILURE: Build failed with an exception.

* Where:
Build file 'E:\posApp\posapp\app\build.gradle' line: 1

* What went wrong:
A problem occurred evaluating project ':app'.
> Plugin with id 'com.android.application' not found.

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.

* Get more help at https://help.gradle.org

CONFIGURE FAILED in 0s
ERROR: Plugin with id 'com.android.application' not found.
Open File

解决方法:
本地什么都没有修改,以前是正常的,显示就出错了。网上一顿百度,都说是无法找到项目Projectbuild.gradle里面的classpath,但是我根据网上的方法试了下将相应的拷贝到modulebuild.gradle还是无效,最后实在没辙,只能自己考虑到底哪里出现问题,项目代码肯定没有问题,那就只能是AS配置出现问题了,而且还是依赖的问题,最终想到了,刷新gradle,重新刷新项目的依赖,在AS命令行执行以下代码:

./gradlew --refresh-dependencies
或者
gradlew --refresh-dependencies

成功

你可能感兴趣的:(BUG-解决Plugin with id 'com.android.application' not found.问题)