它因为 xml 文件中的一行而对我大喊大叫(这一行是完全有效的,而且在我整个项目工作过程中从未出现过问题)。我删除了这一行,即使在重新运行、清理和重建之后,它还是不停地对我大喊大叫,说这一行是完全空白的。我重新启动了 android 工作室,并删除了。终于成功了。希望有人站在我的立场,在这个线程中有所有其他的答案失败,他们会看到这个答案,并节省了几个小时。
我遇到了这个问题(在我完美有效的工作项目上点击一个提示“ sync with gradle”,它扼杀了一切) ,我研究了几个小时,试图找到解决这个问题的方法,包括这个帖子和其他许多帖子。我终于找到了我的解决方案,所以希望它能帮到某些人(希望他们能修复这个糟糕的系统)
在 Gradle 3.5.3到5.4.1之间出现了这个错误(Android Studio 提示我点击“升级”)
格拉德继续升级,但出现了一些错误,如:
ONFIGURE SUCCESSFUL in 1m 27s
ERROR: The Android Gradle plugin supports only Crashlytics Gradle plugin version 1.25.4 and higher.
The following dependencies do not satisfy the required version:
root project 'Android%20App' -> io.fabric.tools:gradle:1.25.1
Update plugins
Affected Modules: app
INFO: API 'variant.getExternalNativeBuildTasks()' is obsolete and has been replaced with 'variant.getExternalNativeBuildProviders()'.
It will be removed at the end of 2019.
For more information, see https://d.android.com/r/tools/task-configuration-avoidance.
To determine what is calling variant.getExternalNativeBuildTasks(), use -Pandroid.debug.obsoleteApi=true on the command line to display more information.
Affected Modules: app
INFO: The specified Android SDK Build Tools version (27.0.3) is ignored, as it is below the minimum supported version (28.0.3) for Android Gradle Plugin 3.5.3.
Android SDK Build Tools 28.0.3 will be used.
To suppress this warning, remove "buildToolsVersion '27.0.3'" from your build.gradle file, as each version of the Android Gradle Plugin now has a default version of the build tools.
Install Build Tools 28.0.3, update version in build file and sync project
Affected Modules: app