Java Android Studio中gradle的同步问题

Java Android Studio中gradle的同步问题,java,android,Java,Android,我正在开发一款太空射击游戏,直到昨天一切都很完美,但今天,当我尝试运行我的应用程序时,我发现以下错误 Execution failed for task ':android:mergeDebugResources'. > Could not resolve all files for configuration ':android:_internal_aapt2_binary'. > Could not resolve com.android.tools.build:aapt2

我正在开发一款太空射击游戏,直到昨天一切都很完美,但今天,当我尝试运行我的应用程序时,我发现以下错误

Execution failed for task ':android:mergeDebugResources'.
> Could not resolve all files for configuration ':android:_internal_aapt2_binary'.
   > Could not resolve com.android.tools.build:aapt2:4.1.0-6503028.
     Required by:
         project :android
      > No cached version of com.android.tools.build:aapt2:4.1.0-6503028 available for offline mode.
      > No cached version of com.android.tools.build:aapt2:4.1.0-6503028 available for offline mode.
      > No cached version of com.android.tools.build:aapt2:4.1.0-6503028 available for offline mode.
      > No cached version of com.android.tools.build:aapt2:4.1.0-6503028 available for offline mode.
      > No cached version of com.android.tools.build:aapt2:4.1.0-6503028 available for offline mode.

Possible solution:
 - Disable offline mode and rerun the build


作为sugest Android Studio,我禁用脱机模式,然后运行,得到以下错误:

``
Could not GET 'https://dl.google.com/dl/android/maven2/com/android/tools/build/aapt2/4.1.0-6503028/aapt2-4.1.0-6503028.pom'. Received status code 405 from server: Method Not Allowed
Disable Gradle 'offline mode' and sync project


你猜怎么着?当我禁用Gradle离线模式时,我又返回到firts错误,所以我完全迷失了方向

如果你知道解决问题的方法,我祝福你


谢谢你的进步

从“构建”菜单中选择“清理项目”并尝试运行您的项目

您是否同步了项目?是的,并始终返回到以前的错误您是否遵循了这些说明?)当然,但我不知道为什么我的Android Studio界面上没有这些按钮。。。我只是从gradle窗口向右禁用了这样做的实例。在gradle属性文件中是否使用代理?