Android Studio/IDEA Gradle wrapper/tools/plugins config errors

ERROR 1:

 File 'D:\work\as_project\TestAs\app\build\intermediates\merged_manifest\debug\out\AndroidManifest.xml' specified for property 'mainMergedManifest' does not exist.

解决方案:

我将Android Gradle插件版本从4.1.0降级到4.0.2,并将Gradle版本从6.5降级到6.4.1后,现在可以正常工作了.因此,我的结论是Android Gradle插件4.1。+和Gradle 6.5。+中存在一个错误。

gradle 4.0.2更改为:/build.gradle

  1. dependencies {
  2. classpath 'com.android.tools.build:gradle:4.0.2'
  3. // NOTE: Do not place your application dependencies here; they belong
  4. // in the individual module build.gradle files
  5. }

gradle 6.4.1:gradle-wrapper.properties

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

https://codebug.vip/questions-3036339.htm

refs:

This video solved my query.

https://www.youtube.com/watch?v=U420dx6C60I

Apparently, this is a bug in the new gradle 6.5

 

ERROR 2:

FAILURE: Build failed with an exception.

* Where:
Initialization script 'C:\Users\cmm\AppData\Local\Temp\ijinit1.gradle' line: 4

* What went wrong:
Could not compile initialization script 'C:\Users\cmm\AppData\Local\Temp\ijinit1.gradle'.
> startup failed:
initialization script 'C:\Users\cmm\AppData\Local\Temp\ijinit1.gradle': 4: unable to resolve class org.jetbrains.plugins.gradle.tooling.internal.ExtraModelBuilder
@ line 4, column 1.
import org.jetbrains.plugins.gradle.tooling.internal.ExtraModelBuilder
^

1 error

 

说明:

上面的问题和磁盘是否为ntfs格式,as/idea是否在C盘没有任何关系!!

纯粹是gradle这个傻批自己的bug,恶心死了,恶心死人了

一堆垃圾!没有做到好的扩展性和兼容性,前面的功能后面就出问题了,ε=(´ο`*)))唉,去吃xxxx

gradle plugin,

gradle wrapper

gradle tools

如上三者的版本要匹配,都有对应关系,详细对应关系见谷歌官方文档:https://developer.android.google.cn/studio/releases/gradle-plugin#updating-plugin

4.0.0+ 6.1.1+
4.1.0+ 6.5+

而且4.1.* tool和gradle wrapper 6.5的版本匹配的确有bug,可以临时做降级处理

 

posted @ 2021-05-12 19:06  petercao  阅读(43)  评论(0编辑  收藏  举报