简体   繁体   English

Android Studio-Gradle-无法使用哈希字符串'Google Inc.:Glass Development Kit Preview:19'找到目标

[英]Android studio - gradle - failed to find target with hash string 'Google Inc.:Glass Development Kit Preview:19'

Failed to sync Gradle Project ‚HelloGlass' 无法同步Gradle项目“ HelloGlass”
Error: Cause: failed to find target with hash string 'Google Inc.: Glass Development Kit Preview:19' in D:\\Project\\Android-SDK 错误:原因:无法在D:\\ Project \\ Android-SDK中使用哈希字符串'Google Inc .: Glass Development Kit Preview:19'找到目标

Strangly, this error didn't appear 3 days ago when I last built the project. 遗憾的是,我上次构建项目3天前没有出现此错误。 I haven't changed anything or used Android Studio since then. 从那时起,我什么都没改变或使用Android Studio。

These are the steps that I've tried to solve the issue: 这些是我尝试解决此问题的步骤:

  • restarted Android Studio and tried to build again 重新启动Android Studio并尝试再次构建
  • made sure that both gradle and my project use the same path for the Android SDK 确保gradle和我的项目都使用相同的Android SDK路径
  • made sure that I have the Google Glass Development Kit Installed in the SDK Manager (and all other packages for API 19 as well), also deleted and re-installed it 确保我在SDK Manager中安装了Google Glass Development Kit(以及API 19的所有其他软件包),并且也将其删除并重新安装
  • installed the latest Build Tools via the SDK Manager and consequently changed buildToolsVersion „23.0.1“ to „23.0.2“ in my gradle file 通过SDK Manager安装了最新的Build Tools,因此在我的gradle文件中将buildToolsVersion“ 23.0.1”更改为“ 23.0.2”
  • Replaced 'com.android.tools.build:gradle:2.0.0-alpha3' in my top-level gradle file with 'com.android.tools.build:gradle:2.0.0-alpha6' since this is the latest version 将我的顶级Gradle文件中的'com.android.tools.build:gradle:2.0.0-alpha3'替换为'com.android.tools.build:gradle:2.0.0-alpha6',因为这是最新版本
  • in gradle-wrapper.properties changed this line distributionUrl=https://services.gradle.org/distributions/gradle-2.8-all.zip to this line: distributionUrl=https://services.gradle.org/distributions/gradle-2.10-all.zip and chose „use default gradle wrapper“ in the project options 在gradle-wrapper.properties中,将以下行distributionUrl = https://services.gradle.org/distributions/gradle-2.8-all.zip更改为以下行:distributionUrl = https://services.gradle.org/distributions/gradle- 2.10-all.zip,然后在项目选项中选择“使用默认gradle包装器”
  • cleared gradle caches in project/gradle and %HOME%/gradle 清除了项目/等级和%HOME%/等级中的gradle缓存
  • tried to build a new Google Glass Project from scratch in Android Studio – same problem 试图在Android Studio中从头开始构建新的Google Glass项目-同样的问题

This is the relevant part of my gradle file: 这是我的gradle文件的相关部分:

android {
    compileSdkVersion "Google Inc.:Glass Development Kit Preview:19"
    buildToolsVersion "23.0.2"

    defaultConfig {
        applicationId "com.helloglass"
        minSdkVersion 19
        targetSdkVersion 23
        versionCode 1
        versionName "1.0"
    }
    ...

And my top-level gradle file: 还有我的顶级gradle文件:

buildscript {
    repositories {
        jcenter()
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:2.0.0-alpha6'
    }
}

I don't know what else to do. 我不知道该怎么办 Any help is greatly appreciated! 任何帮助是极大的赞赏!

我还没有找到问题的原因,但是在重新安装Android Studio和Android SDK之后,我终于可以构建项目了。

Replace 更换

compileSdkVersion "Google Inc.:Glass Development Kit Preview:19"

with

              compileSdkVersion 23

then rebuild the project, hope it will work 然后重建项目,希望它能工作

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 Google Glass SDK:Gradle同步失败:原因:无法找到目标Google Inc.:Glass Development Kit预览:19 - Google Glass SDK: Gradle sync failed: Cause: failed to find target Google Inc.:Glass Development Kit Preview:19 找不到“ Gradle Sync failed”,带有“ Google Inc.:Glass Development Kit Preview:19” - “Gradle Sync failed” with 'Google Inc.:Glass Development Kit Preview:19' not found 错误:原因:无法使用哈希字符串'Google Inc.:Google API:23'查找目标:E:\ AndroidStudio \ SDK - Error:Cause: failed to find target with hash string 'Google Inc.:Google APIs:23' in: E:\AndroidStudio\SDK 为什么android studio显示错误:错误:无法找到目标Google Inc.:Google API:15? - Why android studio show error: Error:failed to find target Google Inc.:Google APIs:15? 发布的开发套件预览版使用SDK 19时如何定位Google Glass 4.0.4 SDK 15 - How to target Google Glass 4.0.4 SDK 15 when released development kit preview uses SDK 19 无法解析目标'google inc.:google APIs:19 - Unable to resolve target 'google inc.:google apis:19 已安装Glass开发工具包预览版,但在Android Studio 3.0中找不到 - Glass development kit preview installed but not found in Android studio 3.0 在Android Studio 2.0预览版Beta 2中找不到带有哈希字符串'android-23'的目标 - Failed to find target with hash string 'android-23' in Android Studio 2.0 preview beta 2 Android Studio-Gradle Sync项目失败-无法找到目标哈希字符串 - Android Studio - Gradle Sync Project Failed - Failed to find target hash string 即使未使用android 19,也无法找到带有哈希标记字符串“ android-19”的目标 - Failed to find target with hash tag string 'android-19' even when android 19 has not used
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM