android - 升级到android后无法构建项目-P

标签 android gradle build android-9.0-pie

以下是我遇到的错误

C:\Users\Dell\.gradle\caches\transforms-1\files-1.1\appcompat-v7-28.0.0-alpha1.aar\51cd62c84e9404bd66ab4daf252c48a1\res\values-v28\values-v28.xml
Error:(9, 5) error: resource android:attr/dialogCornerRadius not found.
C:\Users\Dell\.gradle\caches\transforms-1\files-1.1\appcompat-v7-28.0.0-alpha1.aar\51cd62c84e9404bd66ab4daf252c48a1\res\values\values.xml
Error:(252, 5) error: resource android:attr/fontVariationSettings not found.
Error:(252, 5) error: resource android:attr/ttcIndex not found.
E:\20thJune2017_7PM\trunk\app\build\intermediates\incremental\mergeDebugResources\merged.dir\values-v28\values-v28.xml
Error:(11) error: resource android:attr/dialogCornerRadius not found.
Error:(7) resource android:attr/dialogCornerRadius not found.
Error:(11) resource android:attr/dialogCornerRadius not found.
E:\20thJune2017_7PM\trunk\app\build\intermediates\incremental\mergeDebugResources\merged.dir\values\values.xml
Error:(486) resource android:attr/fontVariationSettings not found.
Error:(486) resource android:attr/ttcIndex not found.
Error:failed linking references.
Error:java.util.concurrent.ExecutionException: java.util.concurrent.ExecutionException: com.android.tools.aapt2.Aapt2Exception: AAPT2 error: check logs for details
Error:java.util.concurrent.ExecutionException: com.android.tools.aapt2.Aapt2Exception: AAPT2 error: check logs for details
Error:com.android.tools.aapt2.Aapt2Exception: AAPT2 error: check logs for details
Error:Execution failed for task ':app:processDebugResources'.
> Failed to execute aapt

下面是我的 build.gradle(app level)

   dependencies {
    compile fileTree(include: ['*.jar'], dir: 'libs')
    androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
        exclude group: 'com.android.support', module: 'support-annotations'
    })
    compile 'com.android.support:appcompat-v7:+'
    compile 'com.android.support.constraint:constraint-layout:1.0.0-alpha3'
    compile 'com.android.support:design:+'
    compile 'com.android.support:support-v4:+'
    testCompile 'junit:junit:4.12'
    compile 'com.squareup.retrofit2:retrofit:2.1.0'
    compile 'com.squareup.retrofit2:converter-gson:2.1.0'
    compile 'com.google.code.gson:gson:2.7'
    compile 'de.hdodenhof:circleimageview:2.1.0'
    compile 'com.squareup.picasso:picasso:2.5.2'
    compile 'com.github.fiskurgit:ChipCloud:2.1.1'
    compile 'com.google.android.gms:play-services-maps:11.4.0'
    compile 'com.squareup.okhttp3:logging-interceptor:3.3.0'
    compile 'commons-codec:commons-codec:1.10'
    compile 'com.crittercism:crittercism-android-agent:+'
    compile 'ch.hsr:geohash:1.3.0'
    compile 'com.google.firebase:firebase-messaging:11.4.0'
    compile 'com.google.firebase:firebase-core:11.4.0'
    compile 'com.google.android.gms:play-services-analytics:11.4.0'
    compile 'com.ahmedjazzar.rosetta:rosetta:1.0.1'
}

我尝试了 stackoverflow 的不同解决方案,但没有一个有效。请你帮我解决这个问题。提前致谢。

最佳答案

I already answered a similar question here.

尝试将 compileSdkVersion 更改为:

compileSdkVersion 28

这些属性是在这个版本中添加的。查看 here , herehere

关于android - 升级到android后无法构建项目-P,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/49249713/

相关文章:

android - 在另一个源文件中调用 JNI C 函数

java - Android Studio 无法在 Windows 8 上启动。如何解决?

android - 使用以下命令时,Android资源链接失败:buildFeatures {viewBinding = true}

android - Gradle/Maven/Android : Library-private dependency not found when library is used via maven

C++ header-implementation-header-implementation依赖链

Maven/Tycho 采用错误的捆绑版本

Android 随着时间的推移减慢 TranslateAnimation

android - 如何让 webview Android 应用程序不显示 adsense 广告?

java - Gradle 搜索 Ivy 服务但未定义 Ivy 配置/ repo

c - 如何构建鞋子和ruby 1.9.3?