问题无法解决AutocompleteTextView中的符号“ DrawableRes”

时间:2019-03-05 12:15:36

标签: android

我是Android新手,在AutocomplettextView活动中遇到此问题,提示无法解析符号'DrawableRes'

import android.annotation.DrawableRes;

这是我的依赖项列表`

implementation fileTree(include: ['*.jar'], dir: 'libs')
implementation 'com.android.support.constraint:constraint-layout:1.0.2'
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation "com.android.support:appcompat-v7:27.1.0"
implementation "com.android.support:design:${supportLibVersion}"
implementation 'com.android.support:support-v4:27.1.1'
testImplementation 'junit:junit:4.12'

androidTestImplementation 'com.android.support.test:rules:1.0.2'
androidTestImplementation 'com.android.support.test:runner:1.0.2'
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'
implementation 'com.mapbox.mapboxsdk:mapbox-android-sdk:6.4.0'
implementation 'com.weiwangcn.betterspinner:library-material:1.1.0'
implementation('com.mapbox.mapboxsdk:mapbox-android-sdk:6.4.0@aar') {
    transitive = true
}
implementation 'com.mapbox.mapboxsdk:mapbox-sdk-turf:3.4.1'
implementation 'com.mapbox.mapboxsdk:mapbox-android-navigation:0.18.0'
implementation('com.mapbox.mapboxsdk:mapbox-android-navigation-ui:0.18.0') {
    transitive = true
}
implementation 'com.mapbox.mapboxsdk:mapbox-android-plugin-traffic:0.6.0'
implementation 'com.fxn769:cue:1.1'
implementation "com.jakewharton:butterknife:8.8.1"
annotationProcessor "com.jakewharton:butterknife-compiler:8.8.1"
implementation 'com.mapbox.mapboxsdk:mapbox-sdk-turf:3.4.1'

//retrofit2
implementation 'com.squareup.retrofit2:adapter-rxjava:2.4.0'
implementation 'com.jakewharton.retrofit:retrofit2-rxjava2-adapter:1.0.0'
implementation 'com.squareup.retrofit2:converter-gson:2.4.0'

//RxJava
implementation 'io.reactivex.rxjava2:rxandroid:2.1.0'
implementation 'io.reactivex.rxjava2:rxjava:2.2.2'
implementation files('libs/usbserial.jar')

这也有问题

 implementation "com.android.support:appcompat-v7:27.1.0"

它说:“所有com.android.support库都必须使用完全相同的版本规范(混合版本可能导致运行时崩溃)。找到的版本为27.1.1、27.1.0。示例包括com.android.support:animated- vector-drawable:27.1.1和com.android.support:exifinterface:27.1.0少...(Ctrl + F1) 有一些库,工具或库的组合不兼容或可能导致错误。这样的不兼容性之一是使用不是最新版本的Android支持库版本进行编译(或者特别是低于目标targetSdkVersion的版本)。“

2 个答案:

答案 0 :(得分:0)

实施“ com.android.support:appcompat-v7:27.1.0”的提示

使用实现“ com.android.support:appcompat-v7:27.1.1”

并更改实现“ com.android.support:design:$ {supportLibVersion}”

实施“ com.android.support:design:27.1.1”

答案 1 :(得分:0)

替换

implementation "com.android.support:appcompat-v7:27.1.0"
implementation "com.android.support:design:${supportLibVersion}"

implementation "com.android.support:appcompat-v7:27.1.1"
implementation "com.android.support:design:27.1.1"

并将这两个依赖项添加到Gradle文件中

implementation "com.android.support:animated-vector-drawable:27.1.1"
implementation "com.android.support:exifinterface:27.1.1"