我正在构建一个应用程序,我在本教程链接中使用Fused提供程序的代码,但是当我想运行我的应用程序时,我收到此错误:
Error:Execution failed for task ':app:transformClassesWithMultidexlistForDebug'.
com.android.build.api.transform.TransformException:com.android.ide.common.process.ProcessException:org.gradle.process.internal.ExecException:进程'command'/ usr / lib / jvm / java- 7-openjdk-amd64 / bin / java''以非零退出值1
结束
这是我的Gradle文件:
apply plugin: 'com.android.application'
android { compileSdkVersion 23 buildToolsVersion“24.0.0” dexOptions { javaMaxHeapSize“4g” }
defaultConfig {
applicationId "com.example.dev3.fusedtutorial"
minSdkVersion 9
targetSdkVersion 23
multiDexEnabled true
versionCode 1
versionName "1.0"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
依赖{ 编译fileTree(包括:['* .jar'],dir:'libs') testCompile'junit:junit:4.12' 编译'com.android.support:appcompat-v7:23.4.0' 编译'com.google.android.gms:play-services:9.2.0' }
任何人都可以帮助我吗?
答案 0 :(得分:0)
将以下内容添加到应用级别的build.gradle中:
android {
compileSdkVersion 23
buildToolsVersion "23.0.2"
defaultConfig {
applicationId "com.example.dev3.fusedtutorial"
minSdkVersion 9
targetSdkVersion 23
multiDexEnabled true
versionCode 1
versionName "1.0"
}
dexOptions {
incremental true
javaMaxHeapSize "4g"
}
}
或者添加一个Application类,如下所示:
public class MyApplication extends Application {
@Override
public void onCreate() {
MultiDex.install(getApplicationContext());
super.onCreate();
}
}
不要忘记在清单中编辑您的应用程序名称。
<application
android:name=".MyApplication"
................
</application>