I';我正在尝试将Android旧库升级到androidx(Android&x2B;Kotlin)

I';我正在尝试将Android旧库升级到androidx(Android&x2B;Kotlin),android,kotlin,android-gradle-plugin,Android,Kotlin,Android Gradle Plugin,但当我构建它时,它会给我一个错误 最近android为kotlin进行了更新 我的android gradle vesion是3.1.2 kotlin的版本是1.2.41 android studio 3.1.2 我的目标是安卓p 这是最新版本,因此我找不到有关此问题的更多文档以及 请帮我找出这个问题 android问题 Program type already present: android.support.v4.media.MediaBrowserCompat$ConnectionCall

但当我构建它时,它会给我一个错误 最近android为kotlin进行了更新

我的android gradle vesion是3.1.2 kotlin的版本是1.2.41 android studio 3.1.2 我的目标是安卓p 这是最新版本,因此我找不到有关此问题的更多文档以及

请帮我找出这个问题
android问题

Program type already present: android.support.v4.media.MediaBrowserCompat$ConnectionCallback$StubApi21  
build.gradle(应用程序)


请帮我找出我找不到的问题是什么

你试过下载android studio 3.2 canary 14吗?有一个新的选项可以将您的文件转换为androidX,并可以让您预览它将要执行的操作。备份你的文件或者至少使用git来确保它的安全


感谢编辑paul

实际上这是金丝雀14中的一个bug。你应该等金丝雀15;-)


签出会话。

我从整个项目中删除了Androidx,但仍然是一名牧师 我找到了解决方案并替换了它

实现“androidx.core:core ktx:1.0.0-alpha1”

实现“androidx.core:core ktx:0.3”
我的问题解决了。 无论如何,感谢所有第二次我要使用androidx(Android+Kotlin)


我正在等待jetpack稳定版。

我认为androidx不兼容,我应该恢复正常。你是说3.2版?有没有办法回滚重构androidx??我想我必须等待安卓稳定频道和安卓jetpack产品。恐怕我该做些什么呢?我不能回到app.support,仍然在监听安卓idx
apply plugin: 'com.android.application'
apply plugin: 'kotlin-android'
apply plugin: 'kotlin-android-extensions'
apply plugin: 'kotlin-kapt'

android {
    compileSdkVersion 'android-P'
    buildToolsVersion '27.0.3'
    defaultConfig {
        applicationId "com.xxxxxxx.xx"
        minSdkVersion 18
        targetSdkVersion 27
        versionCode 1
        versionName "1.0"
        testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
        vectorDrawables.useSupportLibrary = true
    }
    buildTypes {
        release {
            debuggable false
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }
}

dependencies {
    implementation fileTree(include: ['*.jar'], dir: 'libs')
    implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
    implementation 'org.jetbrains.anko:anko-commons:0.10.4'
    implementation 'androidx.core:core-ktx:1.0.0-alpha1'
    implementation "androidx.appcompat:appcompat:1.0.0-alpha1"
    implementation "androidx.legacy:legacy-support-v4:1.0.0-alpha1"
    implementation 'androidx.constraintlayout:constraintlayout:1.1.0'
    implementation "com.google.android.material:material:1.0.0-alpha1"
    testImplementation 'junit:junit:4.12'
    androidTestImplementation 'androidx.test:runner:1.1.0-alpha1'
    androidTestImplementation 'androidx.test.espresso:espresso-core:3.1.0-alpha1'

    implementation 'com.squareup.okhttp3:okhttp:3.10.0'
    implementation 'com.google.code.gson:gson:2.8.2'
    implementation 'com.theartofdev.edmodo:android-image-cropper:2.7.0'

    //firebase massaging
    implementation 'com.google.firebase:firebase-messaging:15.0.2'
    implementation 'com.google.firebase:firebase-core:15.0.2'

    def lifecycle_version = "2.0.0-alpha1"
    def room_version = "2.0.0-alpha1"

    // ViewModel and LiveData
    implementation "androidx.lifecycle:lifecycle-extensions:$lifecycle_version"

    // room database persistent
    implementation "androidx.room:room-runtime:$room_version"
    kapt "androidx.room:room-compiler:$room_version"

    // optional - Test helpers for LiveData
    testImplementation "androidx.arch.core:core-testing:$lifecycle_version"

    //data binding
    //kapt 'com.android.databinding:compiler:3.1.2'
}

apply plugin: 'com.google.gms.google-services'