使用android google play服务的com.android.build.transform.api.TransformException

前端之家收集整理的这篇文章主要介绍了使用android google play服务的com.android.build.transform.api.TransformException前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。
我正在尝试将Google Plus集成到我的应用程序中,并显示以下错误.以下是例外和gradle

错误:任务’:app:transformClassesWithDexForDebug’的执行失败.

com.android.build.transform.api.TransformException: com.android.ide.common.process.ProcessException: org.gradle.process.internal.ExecException: Process ‘command ‘C:\Program Files\Java\jdk1.7.0_79\bin\java.exe” finished with non-zero exit value 1

app build.gradle

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

android {
    compileSdkVersion 23
    buildToolsVersion "23.0.1"

    defaultConfig {
        applicationId "xxx.com.xxxx"
        multiDexEnabled true
        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'
    //depend-materialcalendar
    compile 'com.prolificinteractive:material-calendarview:0.8.1'
    compile 'com.android.support:gridlayout-v7:23.0.1'
    compile 'com.android.support:cardview-v7:23.0.1'
    compile 'com.melnykov:floatingactionbutton:1.3.0'
    //depend-cometchat
    compile 'com.yalantis:contextmenu:1.0.4'
    compile 'com.google.code.gson:gson:2.3'
    compile files('libs/appcompat_v7.jar')
    compile files('libs/cometchat-sdk.jar')
    compile files('libs/jsoup-1.7.3.jar')
    compile files('libs/picasso-2.5.2.jar')
    compile 'com.google.android.gms:play-services:8.1.0'
    compile 'com.google.android.gms:play-services-base:8.1.0'
    compile 'com.google.android.gms:play-services-maps:8.1.0'
    compile files('libs/volley.jar')
    compile files('libs/PayPalAndroidSDK.jar')
    compile files('libs/gcm.jar')
    compile 'com.soundcloud.android:android-crop:1.0.1@aar'
    compile 'com.facebook.android:facebook-android-sdk:4.6.0'
    compile 'com.android.support:multidex:1.0.0'
    compile 'com.google.android.gms:play-services-plus:8.1.0'
    compile 'com.google.android.gms:play-services-identity:8.1.0'

}

project build.gradle

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()
    }
}

解决方法

>尝试清理项目,然后重新构建.
>尝试在app build.gradle文件添加multiDexEnabled true.
defaultConfig {
    multiDexEnabled true
}

猜你在找的Android相关文章