无法解析支持片段和运行时

时间:2018-09-13 14:12:17

标签: android gradle runtime

对android不太熟悉,但我要做的就是导入以下现有项目: link

我的gradle同步失败,并显示以下消息:

无法解决:支持片段

无法解决:运行时

我的gradle文件中有一些有关较新版本库的警告。我试图添加一些关于回购协议的内容,但这并没有改变任何内容。

apply plugin: 'com.android.application'
apply plugin: 'kotlin-android-extensions'
apply plugin: 'kotlin-android'
apply plugin: 'kotlin-kapt'
def versionMajor = 0
def versionMinor = 1
def versionPatch = 0
def versionBuild = 2 // bump for dog food builds, public betas, etc.
android {
    kapt {
        generateStubs = true
    }
    compileSdkVersion 27
    defaultConfig {
        applicationId "com.thanksmister.iot.esp8266"
        minSdkVersion 15
        targetSdkVersion 27
        versionCode 1
        versionName "1.0"
        testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }
    flavorDimensions "default"
    productFlavors {
        def BASE_ENVIRONMENT = "BASE_ENVIRONMENT"
        dev {
            dimension "default"
            buildConfigField "String", BASE_ENVIRONMENT, '"DEV_ENVIRONMENT"'
            applicationId "com.thanksmister.iot.esp8266"
            versionName "${versionMajor}.${versionMinor}.${versionPatch} Build ${versionBuild}-DEV"
        }
        qa {
            dimension "default"
            buildConfigField "String", BASE_ENVIRONMENT, '"QA_ENVIRONMENT"'
            applicationId "com.thanksmister.iot.esp8266"
            versionName "${versionMajor}.${versionMinor}.${versionPatch} Build ${versionBuild}-QA"
        }
        prod {
            dimension "default"
            buildConfigField "String", BASE_ENVIRONMENT, '"PROD_ENVIRONMENT"'
            applicationId "com.thanksmister.iot.esp8266"
            versionName "${versionMajor}.${versionMinor}.${versionPatch}"
        }
    }
    compileOptions {
        sourceCompatibility JavaVersion.VERSION_1_8
        targetCompatibility JavaVersion.VERSION_1_8
    }
    buildToolsVersion '27.0.3'
}
allprojects {
    repositories {
        google()
        jcenter()
        mavenCentral()
    }
}
ext {
    archVersion = '1.1.0'
    room = '1.0.0'
    supporVersion = "27.+"
    dagger = "2.12"
    retrofit = "2.2.0"
    stetho = "1.3.1"
}
dependencies {
    implementation 'com.android.support:support-v4:27.1.1'
    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:${supporVersion}"
    compile "com.android.support:support-v4:${supporVersion}"
    compile 'com.android.support.constraint:constraint-layout:1.1.3'
    compile "com.android.support:cardview-v7:${supporVersion}"
    compile "com.android.support:recyclerview-v7:${supporVersion}"
    compile "com.android.support:design:${supporVersion}"
    compile "com.android.support:preference-v14:${supporVersion}"

    // RxJava
    compile 'io.reactivex.rxjava2:rxjava:2.1.7'
    compile 'io.reactivex.rxjava2:rxandroid:2.0.1'

    // Android architecture
    implementation "android.arch.lifecycle:runtime:${archVersion}"
    implementation "android.arch.lifecycle:extensions:${archVersion}"
    implementation "android.arch.lifecycle:common-java8:${archVersion}"
    implementation "android.arch.lifecycle:reactivestreams:${archVersion}"

    // Room
    implementation "android.arch.persistence.room:runtime:${room}"
    kapt "android.arch.persistence.room:compiler:${room}"
    implementation "android.arch.persistence.room:rxjava2:${room}"

    // Preferences
    compile 'net.grandcentrix.tray:tray:0.12.0'

    // Retrofit
    compile "com.squareup.retrofit2:retrofit:${retrofit}"
    compile "com.squareup.retrofit2:converter-gson:${retrofit}"
    compile "com.squareup.retrofit2:adapter-rxjava2:${retrofit}"

    // OKHttp
    compile 'com.squareup.okhttp3:logging-interceptor:3.4.1'
    compile 'com.squareup.okhttp3:okhttp:3.7.0'

    // Dagger
    compile "com.google.dagger:dagger:${dagger}"
    annotationProcessor "com.google.dagger:dagger-compiler:${dagger}"
    compile "com.google.dagger:dagger-android-support:${dagger}"
    kapt "com.google.dagger:dagger-compiler:${dagger}"
    compile "com.google.dagger:dagger-android:${dagger}"
    annotationProcessor "com.google.dagger:dagger-android-processor:${dagger}"
    kapt "com.google.dagger:dagger-android-processor:${dagger}"

    // Logging
    compile 'com.jakewharton.timber:timber:4.5.1'

    // Dates
    compile 'joda-time:joda-time:2.9.9'

    // Stetho
    compile "com.facebook.stetho:stetho:${stetho}"
    compile "com.facebook.stetho:stetho-okhttp3:${stetho}"
    compile "com.facebook.stetho:stetho-urlconnection:${stetho}"
    testCompile 'junit:junit:4.12'
    compile "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
}

错误消息:

配置'androidTestCompile'已过时,并已由'androidTestImplementation'和'androidTestApi'取代。 它将于2018年底删除。有关更多信息,请参阅:http://d.android.com/r/tools/update-dependency-configurations.html

配置'compile'已过时,并已由'implementation'和'api'代替。 它将于2018年底删除。有关更多信息,请参阅:http://d.android.com/r/tools/update-dependency-configurations.html

配置'androidTestApi'已过时,并已替换为'androidTestImplementation'。 它将于2018年底删除。有关更多信息,请参阅:http://d.android.com/r/tools/update-dependency-configurations.html

配置'testCompile'已过时,并已由'testImplementation'和'testApi'代替。 它将于2018年底删除。有关更多信息,请参阅:http://d.android.com/r/tools/update-dependency-configurations.html

配置'testApi'已过时,并已替换为'testImplementation'。 它将于2018年底删除。有关更多信息,请参阅:http://d.android.com/r/tools/update-dependency-configurations.html

无法解决:支持片段 打开文件

无法解决:运行时 打开文件

文件夹C:\ Users \ s125668 \ Documents \ ID_master \ M21 \ FMP_sem2 \ Anddroid \ android-esp8266-connect-master \ app \ build \ Generated \ source \ kaptKotlin \ devDebug

文件夹C:\ Users \ s125668 \ Documents \ ID_master \ M21 \ FMP_sem2 \ Anddroid \ android-esp8266-connect-master \ app \ build \ Generated \ source \ kaptKotlin \ devRelease

文件夹C:\ Users \ s125668 \ Documents \ ID_master \ M21 \ FMP_sem2 \ Anddroid \ android-esp8266-connect-master \ app \ build \ Generated \ source \ kaptKotlin \ prodDebug

文件夹C:\ Users \ s125668 \ Documents \ ID_master \ M21 \ FMP_sem2 \ Anddroid \ android-esp8266-connect-master \ app \ build \ Generated \ source \ kaptKotlin \ prodRelease

文件夹C:\ Users \ s125668 \ Documents \ ID_master \ M21 \ FMP_sem2 \ Anddroid \ android-esp8266-connect-master \ app \ build \ Generated \ source \ kaptKotlin \ qaDebug

文件夹C:\ Users \ s125668 \ Documents \ ID_master \ M21 \ FMP_sem2 \ Anddroid \ android-esp8266-connect-master \ app \ build \ Generated \ source \ kaptKotlin \ qaRelease

可能是第三方Gradle插件

关于如何解决此问题的任何想法?您需要更多信息来调试吗?

0 个答案:

没有答案