标签:android android-studio synchronization
当我在build.gradle(Project:Allo)中同步我的项目时,我看到了这个错误
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'
}
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:
>点击工具> SDK Manager.
>在SDK平台选项卡中,选择Android P预览.
>在SDK工具选项卡中,选择Android SDK Build-Tools 28-rc2(或
更高).
>单击“确定”开始安装.
标签:android,android-studio,synchronization 来源: https://codeday.me/bug/20190716/1473961.html
本站声明: 1. iCode9 技术分享网(下文简称本站)提供的所有内容,仅供技术学习、探讨和分享; 2. 关于本站的所有留言、评论、转载及引用,纯属内容发起人的个人观点,与本站观点和立场无关; 3. 关于本站的所有言论和文字,纯属内容发起人的个人观点,与本站观点和立场无关; 4. 本站文章均是网友提供,不完全保证技术分享内容的完整性、准确性、时效性、风险性和版权归属;如您发现该文章侵犯了您的权益,可联系我们第一时间进行删除; 5. 本站为非盈利性的个人网站,所有内容不会用来进行牟利,也不会利用任何形式的广告来间接获益,纯粹是为了广大技术爱好者提供技术内容和技术思想的分享性交流网站。