首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >Gradle:构建失败: error: resource :attr/fontVariationSettings添加api依赖项com.microsoft.service后找不到

Gradle:构建失败: error: resource :attr/fontVariationSettings添加api依赖项com.microsoft.service后找不到
EN

Stack Overflow用户
提问于 2018-05-31 10:53:35
回答 2查看 1.9K关注 0票数 1

我正在尝试为列表构建客户端。为了做到这一点,我使用了Office365服务库和API。我的梯度依赖如下所示:

代码语言:javascript
复制
dependencies {
    implementation fileTree(include: ['*.jar'], dir: 'libs')
    implementation 'com.android.support:appcompat-v7:27.1.1'
    implementation 'com.android.support.constraint:constraint-layout:1.0.2'
    implementation 'org.jbundle.util.osgi.wrapped:org.jbundle.util.osgi.wrapped.org.apache.http.client:4.1.2'
    testImplementation 'junit:junit:4.12'
    androidTestImplementation 'com.android.support.test:runner:1.0.1'
    androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.1'
    api 'com.microsoft.aad:adal:2.0.4-alpha'
    api 'com.microsoft.services:sharepoint-services:1.0.0@aar'
    api 'com.microsoft.services.orc:orc-android:1.3.1'
    api 'com.google.guava:guava:25.1-android'
}

在分级同步过程中,由于错误,它失败了:

代码语言:javascript
复制
    error: resource android:attr/fontVariationSettings not found.
    Message{kind=ERROR, text=error: resource android:attr/fontVariationSettings not found., sources=[C:\Users\rahul.deshmukh\.gradle\caches\transforms-1\files- 
   1.1\appcompat-v7-27.1.1.aar\014d6f324620f9879a964fbd74e0b4be\res\values\values.xml:251:5-69], 
   original message=, tool name=Optional.of(AAPT)}

Gradle文件显示鼠标超出错误的位置:

implementation 'com.android.support:appcompat-v7:27.1.1'

All com.android.support libraries must use the exact same version specification (mixing versions can lead to runtime crashes).<br> Found versions 28.0.0-alpha1, 27.1.1. Examples include com.android.support:asynclayoutinflater:28.0.0-alpha1 and com.android.support:animated-vector-drawable:27.1.1 more... (Ctrl+F1)

不确定哪个库与哪个库冲突。任何帮助都将不胜感激。

谢谢。

EN

回答 2

Stack Overflow用户

回答已采纳

发布于 2018-06-05 04:32:10

我必须更改实现顺序,并按照Izabela Orlowska在她的答复中的建议,减少某些依赖项的版本。

下面是我的依赖项现在的样子:

代码语言:javascript
复制
dependencies {
    implementation fileTree(include: ['*.jar'], dir: 'libs')
    api 'com.google.guava:guava:25.1-android'
    api 'com.microsoft.aad:adal:1.14.0'
    api 'com.microsoft.services:sharepoint-services:1.0.0@aar'
    api 'com.microsoft.services:odata-engine-core:0.11.1'
    api 'com.microsoft.services:odata-engine-android-impl:0.11.1@aar'
    api 'com.microsoft.services.orc:orc-android:1.3.1'
    implementation 'com.android.support:appcompat-v7:27.1.1'
    implementation 'com.android.support.constraint:constraint-layout:1.1.0'
    implementation 'org.jbundle.util.osgi.wrapped:org.jbundle.util.osgi.wrapped.org.apache.http.client:4.1.2'
    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'
}

我现在已经摆脱了这个障碍。谢谢大家的评论和建议。

票数 0
EN

Stack Overflow用户

发布于 2018-06-01 12:49:31

依赖项之一是使用仅在API 28 (P)中添加的资源。要么查找库并使用旧版本,要么将编译SDK版本更新为'android预览‘(您可以使用SDK管理器下载它)。

票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/50622632

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档