如何解决无法访问com.google.common.io.Files.file TreeTraverser()方法的问题?

时间:2019-08-17 13:46:55

标签: java android

在构建项目时无法修复此错误

android studio版本3.4.3

OS Ubuntu 18.04.3 LTS

Cause: tried to access method com.google.common.io.Files.fileTreeTraverser()Lcom/google/common/collect/TreeTraverser; from class com.android.utils.FileUtils

我尝试了以下操作

使缓存无效/重新启动

重建项目

删除根项目中的构建文件夹并重新构建

同步实施'com.google.guava:guava:24.1-jre'

build.gradle模块应用

apply plugin: 'com.android.application'
apply plugin: 'com.jakewharton.butterknife'

android {

    compileSdkVersion 28

    defaultConfig {
        applicationId 'ir.arshadit.skaan.skaan'
        minSdkVersion 17
        targetSdkVersion 28
        versionCode 1
        versionName "1.0"
        multiDexEnabled true
        testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
    }

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

    dexOptions {
        preDexLibraries = true
    }

    lintOptions {
        checkReleaseBuilds false
        abortOnError false
    }

    compileOptions {
        sourceCompatibility JavaVersion.VERSION_1_8
        targetCompatibility JavaVersion.VERSION_1_8
    }

}

dependencies {
    implementation fileTree(include: ['*.jar'], dir: 'libs')
    //noinspection GradleCompatible
    implementation 'com.android.support:support-v4:28.0.0'
    implementation 'com.android.support:appcompat-v7:28.0.0'
    implementation 'com.android.support:cardview-v7:28.0.0'
    implementation 'com.android.support:design:28.0.0'
    implementation 'com.android.support.constraint:constraint-layout:1.1.3'

    implementation 'com.jakewharton:butterknife:10.1.0'
    implementation 'androidx.appcompat:appcompat:1.0.2'
    implementation 'androidx.constraintlayout:constraintlayout:1.1.3'
    annotationProcessor 'com.jakewharton:butterknife-compiler:10.1.0'

    implementation 'com.github.bumptech.glide:glide:4.9.0'
    implementation 'de.hdodenhof:circleimageview:3.0.0'
    implementation 'com.github.gcacace:signature-pad:1.2.1'
    implementation 'com.android.support:multidex:1.0.3'

    implementation 'com.ss.bannerslider:bannerslider:2.0.0'
    implementation 'com.fxn769:pix:1.4.4'

    implementation 'com.squareup.retrofit2:retrofit:2.5.0'
    implementation 'com.squareup.retrofit2:converter-gson:2.5.0'
    implementation 'com.google.code.gson:gson:2.8.5'

    implementation 'com.google.guava:guava:24.1-jre'

    implementation project(':kadialog')
    implementation files('libs/Library.aar')

}

build.gradle项目


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

buildscript {
    repositories {
        google()
        jcenter()
        mavenCentral()
    }
    dependencies {

        //noinspection GradleDependency
        classpath 'com.android.tools.build:gradle:3.2.1'
        classpath 'com.google.gms:google-services:4.3.0'
        classpath 'com.jakewharton:butterknife-gradle-plugin:10.1.0'

    }
}

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

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

0 个答案:

没有答案