错误:找不到资源 android:attr/fontVariationSettings

新手上路,请多包涵

警告: android.dexOptions.incremental 属性已弃用,它对构建过程没有影响。 /home/midhilaj/.gradle/caches/transforms-1/files-1.1/appcompat-v7-26.1.0.aar/be3106efb0df111fe5a3f7b356dd070b/res/values/values.xml 错误:(246、5)错误:资源android:attr /fontVariationSettings 未找到。 /project/bkup/7_march_2018/hyshoper/milla/build/intermediates/incremental/mergeDebugAndroidTestResources/merged.dir/values/values.xml 错误:(246, 5) 错误:找不到资源 android:attr/ttcIndex。错误:(269) 资源 android:attr/ttcIndex 未找到。错误:(269) 资源 android:attr/fontVariationSettings 未找到。错误:java.util.concurrent.ExecutionException:java.util.concurrent.ExecutionException:com.android.tools.aapt2.Aapt2Exception:AAPT2 错误:检查日志以获取详细信息错误:链接引用失败。错误:java.util.concurrent.ExecutionException:com.android.tools.aapt2.Aapt2Exception:AAPT2 错误:检查日志以获取详细信息错误:com.android.tools.aapt2.Aapt2Exception:AAPT2 错误:检查日志以获取详细信息错误:执行失败对于任务’:milla:processDebugAndroidTestResources’。

无法执行 aapt 信息:9 错误信息:2 秒内构建失败信息:1 警告信息:查看控制台中的完整输出

如何解决这个问题?我的依赖

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 'de.hdodenhof:circleimageview:2.2.0'

    compile('com.alibaba.android:ultraviewpager:1.0.6.1@aar') {
        transitive = true
    }
    compile('org.apache.httpcomponents:httpmime:4.3.6') {
        exclude module: 'httpclient'
    }
    compile 'com.synnapps:carouselview:0.1.4'
    compile 'com.sun.mail:android-mail:1.5.5'
    compile 'com.sun.mail:android-activation:1.5.5'
    implementation 'com.muddzdev:styleabletoast:2.0.2'
    compile 'javax.annotation:javax.annotation-api:1.2'

    compile 'me.grantland:autofittextview:0.2.+'
    // base library
     //slider
    compile 'com.ss.bannerslider:bannerslider:1.8.0'
    //noinspection GradleCompatible
    compile 'jp.wasabeef:recyclerview-animators:2.2.7'
    compile 'com.android.support:multidex:1.0.1'
    compile 'com.squareup.picasso:picasso:2.5.2'
    compile 'com.google.code.gson:gson:2.6.2'
    compile 'com.github.satyan:sugar:1.4'
    compile 'com.android.support:multidex:1.0.1'
    compile 'com.squareup.picasso:picasso:2.5.2'
    compile 'com.android.support:percent:26.1.0'
    compile 'com.google.code.gson:gson:2.6.2'
    compile 'com.github.satyan:sugar:1.4'
    compile 'jp.wasabeef:recyclerview-animators:2.2.6'
    compile 'pl.droidsonroids.gif:android-gif-drawable:1.1.+'
    compile 'com.afollestad.material-dialogs:core:0.9.4.2'
    compile 'com.google.android.gms:play-services:9.8.0'
    compile 'com.google.android.gms:play-services-auth:9.8.0'
    compile 'com.google.android.gms:play-services-location:9.8.0'
    compile 'com.google.firebase:firebase-core:9.8.0'
    compile 'com.google.firebase:firebase-auth:9.8.0'
    compile 'com.google.firebase:firebase-database:9.8.0'
    compile 'com.google.firebase:firebase-config:9.8.0'
    compile 'com.google.firebase:firebase-crash:9.8.0'
    compile 'com.google.firebase:firebase-invites:9.8.0'
    compile 'com.google.firebase:firebase-storage:9.8.0'
    compile 'cn.pedant.sweetalert:library:1.3'
    compile 'at.blogc:expandabletextview:1.0.3'
    compile 'com.joanzapata.iconify:android-iconify-fontawesome:2.1.+'
    compile 'com.android.support:appcompat-v7:26.1.0'

    implementation 'com.github.bumptech.glide:glide:4.6.1'
    annotationProcessor 'com.github.bumptech.glide:compiler:4.6.1'
    compile 'com.android.support:design:26.1.0'
    compile 'com.android.support:cardview-v7:26.1.0'
    compile 'com.android.support:support-v4:26.1.0'
    compile 'com.android.support:recyclerview-v7:26.1.0'
    compile 'com.nineoldandroids:library:2.4.0'
    compile 'com.daimajia.slider:library:1.1.5@aar'
    compile 'com.android.support.constraint:constraint-layout:1.0.2'
    testCompile 'junit:junit:4.12'
    implementation 'com.android.support:design:26.1.0'

}

原文由 Midhilaj 发布,翻译遵循 CC BY-SA 4.0 许可协议

阅读 488
2 个回答

尝试将 compileSdkVersion 更改为:

 compileSdkVersion 28

在 api 级别 28 中添加的 fontVariationSettings. Api doc here

原文由 zyc zyc 发布,翻译遵循 CC BY-SA 4.0 许可协议

我有同样的问题,我安装了这个cordova插件并解决了问题。

 cordova plugin add cordova-android-support-gradle-release --save

原文由 Miguel Peguero 发布,翻译遵循 CC BY-SA 4.0 许可协议

撰写回答
你尚未登录,登录后可以
  • 和开发者交流问题的细节
  • 关注并接收问题和回答的更新提醒
  • 参与内容的编辑和改进,让解决方法与时俱进
推荐问题