Android错误:com.google.android.gms.internal.zzcms中引用com.google.android.gms.common.internal.zzf作为接口。

时间:2019-05-09 01:24:00

标签: android interface multidex

我正在尝试检索以前的android项目(也许是从eclipse中获取),开始时有很多错误,但最终却有4个错误:

  1. 原因:com.android.builder.dexing.DexArchiveBuilderException:无法处理C:\ Users \ WEBSOL3.gradle \ caches ... \ jars \ classes.jar
  2. 由以下原因引起:com.android.builder.dexing.DexArchiveBuilderException:解密时出错。
  3. 由以下原因引起:com.android.builder.dexing.DexArchiveBuilderException:解密时出错。
  4. 原因:com.android.tools.r8.utils.AbortException:错误:类型com.google.android.gms.common.internal.zzf被引用为com.google.android.gms.internal.zzcms的接口。

供您参考,可以与Gradle文件同步,但无法运行应用程序(包括在测试设备中制作apk文件)。在项目级别和应用程序级别没有build.gradle文件。只有build.gradle文件(模块:我的应用程序名称)和与lib相关的其他gradle文件。

我已经尝试过修复它,键入multiDexEnabled = true,版本化所有依赖项,添加了mavenCentral和maven {url},compileOptions {sourcecompatibilty,targetcompatibility}等,就像我在Google搜索中发现的几乎所有东西一样。

这是下面的我的build.gradle(模块:我的应用名称)。

 buildscript {
    repositories {
        jcenter {
            url "http://jcenter.bintray.com/"
        }
        mavenCentral()
        maven { url "https://maven.google.com" }
        google()
//        google()
    }

    dependencies {
        classpath 'com.android.tools.build:gradle:3.3.2'
        classpath 'com.google.gms:google-services:4.2.0'                                            // 4.2.0 available
    }
}

allprojects {
    // added by davelee 
//    tasks.withType(JavaCompile) { options.encoding = 'EUC-KR' }
    tasks.withType(Javadoc) {
//        options.addStringOption('Xdoclint:none', '-quiet')
        options.addStringOption('encoding', 'EUC-KR')
        options.addStringOption('encoding', 'UTF-8')
        options.addStringOption('encoding', 'x-windows-949')
    }

    repositories {
        maven { url "https://dl.bintray.com/buzzvil/buzzscreen/" }
        maven { url "http://dl.appnext.com/" }
        maven { url "https://maven.google.com" }                                                    // added by davelee
    }


    repositories {
        jcenter {
            url "http://jcenter.bintray.com/"
        }
    }
}

apply plugin: 'android'

dependencies {
    implementation 'com.android.support:multidex:1.0.3'
    implementation fileTree(include: '*.jar', dir: 'libs')
    implementation project(path: ':PullToRefrechlibrary')
    implementation 'it.sephiroth.android.library.horizontallistview:hlistview:1.2.2'
    //noinspection UseOfBundledGooglePlayServices
    implementation 'com.google.android.gms:play-services:12.0.0'
    implementation 'com.google.code.gson:gson:2.8.4'
    implementation files('libs/tnkad-sdk.jar')
    implementation project(path: ':fineadkeyboardsdk')
    implementation files('libs/gcm.jar')
    implementation files('libs/CappSDK_201705250.jar')
    implementation files('libs/org.apache.httpcomponents.httpclient_4.2.5.jar')
    implementation files('libs/httpcore-4.4.4.jar')
    implementation project(path: ':Stealthaddplatformbrowser_lib_sw_1.2.11')
    implementation fileTree(include: ['*.jar'], dir: 'libs')
    implementation 'com.android.support:appcompat-v7:28.0.0'
    implementation 'com.android.support:design:28.0.0'
    implementation 'com.google.guava:guava:25.0-android'


    // davelee
//        implementation ('com.google.android.ads.consent:consent-library:1.0.6') {
//            exclude module: 'gson.FieldAttributes'
//        }
    configurations {
//        all*.exclude group: 'com.google.gson.FieldAttributes'
//        all*.exclude group: 'com.google.code.gson'
//        all*.exclude group: 'com.squareup.okhttp3'
//        all*.exclude group: 'com.squareup.okio'
//        all*.exclude group: 'com.android.support',module:'support-v13'
    }
}


android {
    compileSdkVersion 28
    buildToolsVersion '28.0.3'

    defaultConfig {
        applicationId "com.sportsseoul.pinkfinger"
        minSdkVersion 21
        targetSdkVersion 26
        multiDexEnabled true
        versionCode 66
        versionName "1.45"
    }
    // added by davelee
//    compileOptions.encoding = 'windows-1251'

    compileOptions {
//        encoding 'EUC-KR'
        sourceCompatibility JavaVersion.VERSION_1_8
        targetCompatibility JavaVersion.VERSION_1_8
    }

    sourceSets {
        main {
            manifest.srcFile 'AndroidManifest.xml'
            java.srcDirs = ['src']
            resources.srcDirs = ['src']
            aidl.srcDirs = ['src']
            renderscript.srcDirs = ['src']
            res.srcDirs = ['res']
            assets.srcDirs = ['assets']
        }
//        instrumentTest.setRoot('tests')
        debug.setRoot('build-types/debug')
        release.setRoot('build-types/release')
    }


//    dexOptions{
//        jumboMode true
//        incremental true
//        javaMaxHeapSize="4g"
//    }

    packagingOptions {
        exclude 'META-INF/DEPENDENCIES.txt'
        exclude 'META-INF/LICENSE.txt'
        exclude 'META-INF/NOTICE.txt'
        exclude 'META-INF/NOTICE'
        exclude 'META-INF/LICENSE'
        exclude 'META-INF/DEPENDENCIES'
        exclude 'META-INF/notice.txt'
        exclude 'META-INF/license.txt'
        exclude 'META-INF/dependencies.txt'
        exclude 'META-INF/LGPL2.1'
    }

    lintOptions {
        disable 'MissingTranslation'
    }

    dependencies {
        implementation 'com.android.support:multidex:1.0.3'
    }

}

0 个答案:

没有答案