com.android.build.api.transform.TransformException,com.android.ide.common.process.ProcessException

时间:2016-03-08 06:39:20

标签: android android-studio

在Android Studio中获取此问题。

com.android.build.api.transform.TransformException: com.android.ide.common.process.ProcessException: org.gradle.process.internal.ExecException: Process 'command 'C:\Program Files\Java\jdk1.8.0_20\bin\java.exe'' finished with non-zero exit value 3

1 个答案:

答案 0 :(得分:3)

我遇到这个问题在build.gradel中尝试这个代码。

另外,请使用此库

dependacies {'compile'c​​om.android.support :multidex:1.0.1'}

android {
    compileSdkVersion 23
    buildToolsVersion "23.2.1"


    defaultConfig {
        applicationId "yours"
        minSdkVersion 15
        targetSdkVersion 23
        versionCode 1
        versionName "1.1.2"
        // Enabling multidex support.
        multiDexEnabled true
    }

    dexOptions {
        javaMaxHeapSize "4g"
    }  

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

创建应用程序类

public class YourApp extends Application {

    @Override
    public void onCreate() {
        super.onCreate();

    }

    @Override
    protected void attachBaseContext(Context base) {
        super.attachBaseContext(base);
        MultiDex.install(this);
    }
}