无法解决:支持片段28.0.0

时间:2018-12-17 10:56:36

标签: android gradle

将库添加到build.gradle

时出错

这是我的build.gradle

apply plugin: 'com.android.application'

apply plugin: 'kotlin-android'

apply plugin: 'kotlin-android-extensions'

android {
    compileSdkVersion 28
    defaultConfig {
        applicationId "io.svzone.sezon"
        minSdkVersion 15
        targetSdkVersion 28
        versionCode 1
        versionName "1.0"
        testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
        vectorDrawables.useSupportLibrary = true
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }

        debug {
            applicationIdSuffix ".debug"
            versionNameSuffix "-debug"
        }
        /*applicationId = "com.vogella.android.gradlebuildflavors.prod"
            versionName = "1.0-paid"*/
    }
}

ext {
    support_version = '28.0.0'
    anko_version = '0.10.4'
    retrofit_version = "2.5.0"
    firebase_version = '16.0.3'
    daggerVersion = "2.16"
    anko_version = '0.10.8'
    coroutineVersion = "1.0.1"
    lifecycle_version = "1.1.1"

}

dependencies {
    def excludeSupport26 = {
        force = true
        exclude group: 'com.android.support', module: 'support-media-compat'
        exclude group: 'com.android.support', module: 'support-v4'
       // exclude group: 'com.google.android.gms', module: 'play-services-auth'
    }
    implementation fileTree(dir: 'libs', include: ['*.jar'])
    implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
    implementation "com.android.support:appcompat-v7:$support_version"
    implementation "com.android.support:design:$support_version"
    // implementation "com.android.support:support-fragment:$support_version"
    implementation 'com.android.support.constraint:constraint-layout:2.0.0-alpha2'
    //implementation group: 'com.android.support', name: 'support-v4', version: '28.0.0'

    // implementation 'com.android.support:support-v4:28.0.0'
   // implementation 'com.android.support:support-v4:28.0.0'
    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'

    // Retrofit & OkHttp
    implementation "com.squareup.retrofit2:retrofit:$retrofit_version"
    implementation "com.squareup.retrofit2:converter-gson:$retrofit_version"
    implementation 'com.squareup.okhttp3:okhttp:3.12.0'
    implementation 'com.squareup.okhttp3:logging-interceptor:3.11.0'
    implementation 'com.jakewharton.retrofit:retrofit2-kotlin-coroutines-experimental-adapter:1.0.0'
    // implementation 'com.flipboard:bottomsheet-core:1.5.3'
    // implementation 'com.flipboard:bottomsheet-commons:1.5.3' // optional

    // implementation 'com.squareup.picasso:picasso:2.71828'

    // implementation 'swarajsaaj:otpreader:1.1'
    // ImageView Library
    implementation 'de.hdodenhof:circleimageview:2.2.0'

    implementation "org.jetbrains.kotlinx:kotlinx-coroutines-core:$coroutineVersion"
    implementation "org.jetbrains.kotlinx:kotlinx-coroutines-android:$coroutineVersion"
    implementation 'com.facebook.android:account-kit-sdk:4.+'
    implementation 'com.romandanylyk:pageindicatorview:1.0.2'
    implementation "com.android.support:recyclerview-v7:$support_version"
    implementation 'com.google.android.gms:play-services-auth:16.0.1'
    implementation 'com.google.android.gms:play-services-maps:16.0.0', excludeSupport26

    // ViewModel and LiveData
    implementation("android.arch.lifecycle:extensions:$lifecycle_version") {
        exclude group: "com.android.support", module: "support-fragment"
    }

//    // Koin for Android
//    implementation('org.koin:koin-android:1.0.2')
//    // or Koin for Lifecycle scoping
// /*   implementation('org.koin:koin-android-scope:1.0.2') {
//        exclude group: 'com.android.support', module: 'support-v4'
//        exclude group: "com.android.support", module: "support-fragment"
//    }*/
//    // or Koin for Android Architecture ViewModel
//    implementation('org.koin:koin-android-viewmodel:1.0.2')


}

它给了我解决的库冲突

  

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

但是我无法下载支持片段和支持v4 我尝试了很多次,它给了我请安装android支持库,但是它已经安装了 我该做什么 ?

请参阅附件

enter image description here

1 个答案:

答案 0 :(得分:0)

您需要添加支持库 com.android.support:support-fragment:28.0.0

尝试从中安装。您可以尝试通过以下路径安装它:

Android Studio,进入菜单文件>项目结构(Ctrl + Alt + Shift + S) 选择应用,然后选择依赖项,然后搜索 com.android.support:support-fragment:28.0.0

如果这不起作用,请尝试以下方法:

allprojects {
repositories {
    maven {
        url "https://maven.google.com"
       }
     }
   }

让我知道这是否可行。