Program type already present: android.support.v4.os.ResultReceiver$1

试过了几种解决方法:

1、gradle.properties中添加下面两句

android.useAndroidX=true
android.enableJetifier=true

运行一下,没用

2、ButterKnife降版本10.0.0降到9.0.0

3.添加

 compileOptions {

        sourceCompatibility JavaVersion.VERSION_1_8

        targetCompatibility JavaVersion.VERSION_1_8

    }

 

最后折腾一番,OK了

pply plugin: 'com.android.application'
apply plugin: 'com.jakewharton.butterknife'
android {
    compileSdkVersion 28


    defaultConfig {
        applicationId "com.example.jx.myapplication"
        minSdkVersion 15
        targetSdkVersion 28
        versionCode 1
        versionName "1.0"

        testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
    }

    compileOptions {

        sourceCompatibility JavaVersion.VERSION_1_8

        targetCompatibility JavaVersion.VERSION_1_8

    }

    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
        }
    }

}

dependencies {
    implementation fileTree(include: ['*.jar'], dir: 'libs')
    //implementation 'com.android.support:appcompat-v7:28.0.0'
    implementation 'androidx.appcompat:appcompat:1.1.0'
    implementation 'com.android.support.constraint:constraint-layout:1.1.3'
    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'
    //implementation files('libs/okhttp-3.3.0.jar')
    //implementation 'com.android.support:design:28.0.0'
    implementation 'com.jakewharton:butterknife:9.0.0'
    annotationProcessor 'com.jakewharton:butterknife-compiler:9.0.0'
    //noinspection GradleCompatible
   implementation 'com.android.support:appcompat-v7:28.0.0'
    implementation 'com.android.support:support-v4:28.0.0'
    //implementation 'com.android.support:appcompat-v7:27.1.1'
}

4、最后一个步骤 接着降版本

gradle3.5降到了3.1

dependencies {
    classpath 'com.android.tools.build:gradle:3.1.2'
    // NOTE: Do not place your application dependencies here; they belong
    // in the individual module build.gradle files
    classpath 'com.jakewharton:butterknife-gradle-plugin:9.0.0'
}

5 OK了 

你可能感兴趣的:(遇见的问题)