异常任务失败

时间:2016-01-10 12:40:30

标签: android android-fragments google-maps-api-3

每当我导入Map Activity时,在我的android项目中

编译给我一些错误,如: 错误:任务':app:dexDebug'执行失败。

  

com.android.ide.common.process.ProcessException:org.gradle.process.internal.ExecException:进程'命令'C:\ Program Files \ Java \ jdk1.7.0_75 \ bin \ java.exe''已完成具有非零退出值2

我该如何解决? 我的模块是:

dependencies {
    compile fileTree(dir: 'libs', include: ['*.jar'])
    testCompile 'junit:junit:4.12'
    compile 'com.android.support:appcompat-v7:23.1.1'
    compile 'com.android.support:design:23.1.1'
    compile 'com.google.android.gms:play-services:7.5.0'
}

1 个答案:

答案 0 :(得分:-1)

  

我也有同样的问题,我刚用'com.google.android.gms:play-services-maps:8.4.0'替换了我的'com.google.android.gms:play-services:8.4.0' bcs我正在我的项目中实施谷歌地图,为你的个人需要检查here,我希望它可行:)

或者您仍然想要立即使用整个库,因此您需要启用multidex。这是步骤:

1:在Module:app

中添加multidex依赖项
compile 'com.android.support:multidex:1.0.1'

2:然后在defaultConfig部分的Module:app文件中启用mutidex,如下所示

defaultConfig {
    ...
    multiDexEnabled true
}

3:在此类应用程序部分的Manifest中添加以下行

<application
    android:name="android.support.multidex.MultiDexApplication"
    ...
    ...

4:重建项目。

快乐编码:)

相关问题