无法解决:版本28的com.android.support

时间:2018-11-13 17:43:43

标签: android

下面我附加了代码,但出现了一些错误。使用SDK 27很好,但是更改为SDK 28,我得到了错误。

任何人都可以指出问题所在以及如何解决吗? 我已经为两者都安装了SDK,但是仍然有错误。

我已附上2个成绩档案。问题出在这里:

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

第一个build.grade:-

apply plugin: 'com.android.application'

android {
    compileSdkVersion 28
    defaultConfig {
        applicationId "com."
        minSdkVersion 18
        targetSdkVersion 28
        versionCode 1
        versionName "1.0"
        multiDexEnabled true
        testInstrumentationRunner "android.support.layout_route_history.runner.AndroidJUnitRunner"
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }
    compileOptions {
        sourceCompatibility JavaVersion.VERSION_1_8
        targetCompatibility JavaVersion.VERSION_1_8
    } }

dependencies {
    implementation fileTree(dir: 'libs', include: ['*.jar'])
    //noinspection GradleCompatible
    implementation 'com.android.support:appcompat-v7:28.0.0'
    implementation 'com.android.support.constraint:constraint-layout:1.1.3'
    implementation 'com.android.support:support-v4:28.0.0'
    implementation 'com.android.support:support-annotations:28.0.0'
    implementation 'com.android.support:design:28.0.0'
    implementation 'com.jakewharton:butterknife:8.8.1'
    implementation 'com.squareup.retrofit2:retrofit:2.4.0'
    implementation 'com.squareup.okhttp3:logging-interceptor:3.11.0'
    implementation 'com.squareup.okhttp3:okhttp:3.11.0'
    implementation 'com.squareup.retrofit2:converter-gson:2.4.0'
    implementation 'com.facebook.stetho:stetho:1.5.0'
    implementation 'com.facebook.stetho:stetho-okhttp3:1.5.0'
    implementation 'com.github.castorflex.smoothprogressbar:library:1.1.0'
    implementation 'com.android.support:cardview-v7:28.0.0'
    implementation 'com.mapbox.mapboxsdk:mapbox-android-sdk:6.6.5'
    implementation 'com.chaos.view:pinview:1.4.2'
    implementation 'com.github.PhilJay:MPAndroidChart:v3.0.3'
    implementation 'de.hdodenhof:circleimageview:2.2.0'
    implementation 'com.mapbox.mapboxsdk:mapbox-sdk-geojson:4.0.0'
    implementation('com.mapbox.mapboxsdk:mapbox-android-navigation-ui:0.17.0') {
        transitive = true
    }
    implementation("com.mikepenz:materialdrawer:6.0.7@aar") {
        transitive = true
        exclude group: 'com.android.support'
    }
    implementation 'br.com.edsilfer:custom-searchable:0.1.0-Beta'
    implementation "com.squareup.picasso:picasso:2.71828"
    testImplementation 'junit:junit:4.12'
    androidTestImplementation 'com.android.support.layout_route_history:runner:1.0.2'
    androidTestImplementation 'com.android.support.layout_route_history.espresso:espresso-core:3.0.2'
    annotationProcessor 'com.jakewharton:butterknife-compiler:8.8.1' }

二年级文件:-

// Top-level build file where you can add configuration options common to all sub-projects/modules.

buildscript {

    repositories {
        google()
        jcenter()
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:3.2.1'


        // NOTE: Do not place your application dependencies here; they belong
        // in the individual module build.gradle files
    } }

allprojects {
    repositories {
        google()
        jcenter()
        maven { url 'https://jitpack.io' }

    } }

task clean(type: Delete) {
    delete rootProject.buildDir }

1 个答案:

答案 0 :(得分:0)

您需要使用com.android.support.test而不是com.android.support.layout_route_history.,其原因可能是您重命名了某个名称,而Studio会自动重命名了软件包或类似名称。