安装存储库并同步项目

Install repository and sync project

我正在尝试为 android wear 创建一个新项目,但此错误一直出现,我认为这是因为我没有在之前创建的位置创建新项目,而是改回定位无效。

但是我在为 android 手机制作常规项目时没有这样的问题

26.0.0 版本对我也不起作用。 尝试使用版本 25.3.1.

尝试执行 中提供的建议步骤。

  1. in Android Studio, open Tools -> Android -> SDK Manager
  2. under tab "SDK Tools" un-check the libraries causing problems
  3. click "apply" to uninstall them
  4. re-check the same libraries click "apply" to reinstall them
  5. close SDK Manager and run Gradle sync / build

还需要注意 2017 年 7 月的 update

Important: The support libraries are now available through Google's Maven repository. You do not need to download the support repository from the SDK Manager. For more information, see Support Library Setup.

这里是 google maven 需要的一些要点,取自 :

在您的 root build.gradle 中,您必须像这样添加 google maven:

allprojects {
    repositories {
        jcenter()
        maven {
            url "https://maven.google.com"
        }
    }
}

首先禁用您的防病毒软件(如果有的话)。 其次按照步骤

    In Android Studio, open Tool > Android > SDK Manager
    under tab "SDK Tools" un-check the libraries that are previously   checked
    click "apply" to uninstall them

    re-check the same libraries click "apply" to reinstall them
    close SDK Manager and run Gradle sync / build

如果这不起作用,那么有工作的人 A.S 从应用程序数据中获取他的 SDK 文件