当前位置: 首页 > 知识库问答 >
问题:

执行任务失败:应用程序:TransformClasseswith DexForDebug,同时实现谷歌登录Android

胡元忠
2023-03-14

我试图实现谷歌登录为Android和我按照说明通过

https://developers.google.com/identity/sign-in/android/start-integrating

但在构建应用程序时,我收到了以下错误。

信息: Gradle任务[: app: GenerateDebugSsource,: app: GenerateDebugAndroid测试源,: app: assembleDebug]: app: preBuild Up-TO-DATE: app: preDebugBuild Up-TO-DATE: app: check DebugManiFestival: app: preRelaseBuild Up-TO-DATE: app: preareComAndreidSupportAppcompatV72301库Up-TO-DATE: app: preareComAndreidSupportDesign2301库Up-TO-DATE: app: predebugBuild ComGoogleAndreidGmsPlayServicesAds810库Up-TO-DATE: app: preareComGoogleAndroid idGmsPlayServicesAnalytics810Library Up-TO-DATE: app: preareComGoogleAndroid idGmsPlayServicesAppindexing810Library Up-TO-DATE: app: preareComGoogleAndroid idGmsPlayServicesAppindexing810库UUP-TO-DATE: app: compileDebugRendercript UP-TO-DATE: app: GenerateDebugBuildConfig UP-TO-DATE: app: GenerateDebugAsset UP-TO-DATE: app: GenerateDebugResValuesUP-TO-DATE: app: ProcateDebugGoogleServices没有找到匹配的客户端包名称'com.questo.rugved.questo': app: GenerateDebugResources: app: mergeDebugResources UP-TO-DATE: app:进程DebugManifestUP-TO-DATE: app:进程DebugResources UP-TO-DATE: app: GenerateDebugSsource UP-TO-DATE: app: preDebugAndreidTestBuild UP-TO-DATE: app:编译DebugAndreidTestAtendents: app:编译DebugAndreidTestAidl UP-TO-DATE: app:进程DebugAndreidTestManiFestivalUP-TO-DATE: app: compileDebugAndreidTestRendercript UP-TO-DATE: app: GenerateDebugAndreidTestBuildConfig UP-TO-DATE: app: GenerateDebugAndreidTestAsset UP-TO-DATE: app: GenerateDebugAndreidTestResValuesUP-TO-DATE: app: GenerateDebugAndreidTestResources UP-TO-DATE: app: GenerateDebugAndreidTestResources UP-TO-DATE: app: GenerateDebugAndreidTestResources UP-TO-DATE: app: GenerateDebugAndreidTestSsource UP-TO-DATE: app: compileDebugJavawith Javac UP-TO-DATE: app: compileDebugNdk UP-TO-DATE: app: compileDebugSsource UP-TO-DATE: app: transformClassesAndResourc.com.android.build.transform.api.转换异常:com.android.ide.common.process.进程异常:org.gradle.process.internal.执行异常:进程'命令'/usr/lib/jvm/java-7-oracle/bin/java"以非零退出值完成2信息:构建失败信息:总时间:1分钟39.994秒信息:1错误信息:0警告信息:请参见控制台中的完整输出

我的顶级毕业生是


    buildscript {
        repositories {
            jcenter()
        }
        dependencies {
            classpath 'com.android.tools.build:gradle:1.3.0'
            classpath 'com.google.gms:google-services:1.4.0-beta3'

            // NOTE: Do not place your application dependencies here; they belong
            // in the individual module build.gradle files
        }
    }

    allprojects {
        repositories {
            jcenter()
        }
    }
    
My app level gradle is

<pre>

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

    android {
        compileSdkVersion 23
        buildToolsVersion '23.0.1'

        defaultConfig {
            applicationId "com.questo.rugved.questo"
            minSdkVersion 15
            targetSdkVersion 23
            versionCode 1
            versionName "1.0"
        }
        buildTypes {
            release {
                minifyEnabled false
                proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
            }
        }
    }

    dependencies {
        compile fileTree(dir: 'libs', include: ['*.jar'])
        compile 'com.android.support:appcompat-v7:23.0.1'
        compile 'com.android.support:design:23.+'
        compile 'com.google.android.gms:play-services-identity:8.1.0'
        compile 'com.google.android.gms:play-services-plus:8.1.0'
    }

请帮忙。

共有3个答案

百里锋
2023-03-14

添加

 dexOptions {
        incremental = true;
        preDexLibraries = false
        javaMaxHeapSize "4g" // 2g should be also OK
    }

Android系统内置。格雷德尔为我工作。

卜飞鸣
2023-03-14

出现此问题的原因是包含多个依赖项。您正在包含已在生成中指定的依赖项。格雷德尔档案。例如:

compile 'com.google.android.gms:play-services:9.0.2'
compile 'com.google.android.gms:play-services-identity:9.0.2'

上面的依赖性规范会产生这个问题,因为play services包括一切,包括play services identity,

推荐的选项是只包含您实际需要的依赖项。如果您需要播放服务位置

compile 'com.google.android.gms:play-services-location:9.0.2'
compile 'com.google.android.gms:play-services-maps:9.0.2'

没有包括所有与'com.google.Android游戏服务:9.0.2'。

在您的具体案例中,我怀疑谷歌顶级gradle文件服务和play服务身份之间存在冲突

一般来说,如果没有强大的

酆奇文
2023-03-14

也许这个链接对你有帮助。链接

这帮助了我:

android {
...
defaultConfig {
    ...
    multiDexEnabled true
    }
}
 类似资料: