错误:无法找到带有哈希字符串"android-28"的目标 [英] Error: Failed to find target with hash string 'android-28'

查看:70
本文介绍了错误:无法找到带有哈希字符串"android-28"的目标的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当我在build.gradle(Project:Allo)中同步我的项目时,我看到此错误

When I sync my project in build.gradle(Project: Allo) I see this error

在以下位置找不到带有哈希字符串'android-28'的目标:C:\ Users \ hacker \ AppData \ Local \ Android \ Sdk

Failed to find target with hash string 'android-28'in: C:\Users\hacker\AppData\Local\Android\Sdk

配置:

apply plugin: 'com.google.gms.google-services'
android {
compileSdkVersion 28
defaultConfig {
    applicationId "com.example.android.allo"
    minSdkVersion 19
    targetSdkVersion 28
    versionCode 1
    versionName "1.0"
    testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
buildTypes {
    release {
        minifyEnabled false
        proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
    }
}
}

dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation 'com.android.support:appcompat-v7:28.0.0 rc2'
implementation 'com.android.support.constraint:constraint-layout:1.1.0'
implementation 'com.google.firebase:firebase-core:15.0.2'
implementation 'com.google.firebase:firebase-messaging:15.0.2'
implementation 'com.android.support:design:28.0.0 rc2'
testImplementation 'junit:junit:4.12'
androidTestImplementation 'com.android.support.test:runner:1.0.2'
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'
}

推荐答案

阅读 .

android {
compileSdkVersion 'android-P'

defaultConfig {
    targetSdkVersion 'P'
}

为了获得Android P Preview SDK的最佳开发体验,我们 建议您安装最新的Android Studio 3.2 Canary.

For the best development experience with the Android P Preview SDK, we recommend that you install the latest Android Studio 3.2 canary.

您应按照以下步骤安装Android P Preview SDK:

You should install the Android P Preview SDK as follows:

  • 点击工具> SDK管理器.

在"SDK平台"标签中,选择 Android P预览.

In the SDK Platforms tab, select Android P Preview.

在"SDK工具"标签中,选择 Android SDK生成工具28-rc2 (或 更高).

In the SDK Tools tab, select Android SDK Build-Tools 28-rc2 (or higher).

单击确定"开始安装.

这篇关于错误:无法找到带有哈希字符串"android-28"的目标的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆