添加谷歌地图时使用gradle时出错

时间:2015-11-19 08:19:23

标签: java android gradle

这是我的gradle文件:

apply plugin: 'com.android.application'

android {
    compileSdkVersion 23
    buildToolsVersion '23.0.1'

defaultConfig {
    applicationId "xxx"
    minSdkVersion 15
    targetSdkVersion 22
    versionCode 1
    versionName "icon1.0"
}
buildTypes {


        debug {
            resValue "string", "google_maps_api_key", "xxx"
        }
    release {
        minifyEnabled false
        proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
    }
}
}

dependencies {
    compile project(':pullToRefreshLib')
    compile files('libs/android-async-http.jar')
    compile files('libs/org.apache.http.legacy.jar')
    compile files('libs/bcprov.jar')
    compile files('libs/uicandroid.jar')
    compile files('libs/worklight-android.jar')
    compile files('libs/gson-2.2.4.jar')
    compile project(':aFileChooser')
    compile files('libs/httpmime-4.1.1.jar')
    compile 'info.hoang8f:android-segmented:1.0.5'
    compile 'com.android.support:appcompat-v7:23.1.1'
    compile 'com.android.support:support-v4:23.1.1'
    compile 'com.google.android.gms:play-services:8.3.0'
}

删除地图时我的项目构建 但添加后我有这个错误:

Error:Execution failed for task ':app:dexDebug'.
> com.android.ide.common.process.ProcessException: org.gradle.process.internal.ExecException: Process 'command '/Library/Java/JavaVirtualMachines/jdk1.8.0_31.jdk/Contents/Home/bin/java'' finished with non-zero exit value 2

有谁知道出了什么问题? 提前谢谢!

编辑:

执行gradle -q依赖项

之后
------------------------------------------------------------
Project :app
------------------------------------------------------------

_debugAndroidTestApk - ## Internal use, do not manually configure ##
No dependencies

_debugAndroidTestCompile - ## Internal use, do not manually configure ##
No dependencies

_debugApk - ## Internal use, do not manually configure ##
+--- project :pullToRefreshLib
|    \--- com.android.support:support-v4:23.1.1
|         \--- com.android.support:support-annotations:23.1.1
+--- project :aFileChooser
|    \--- com.android.support:support-v4:23.1.1 (*)
+--- info.hoang8f:android-segmented:1.0.5
+--- com.android.support:appcompat-v7:23.1.1
|    \--- com.android.support:support-v4:23.1.1 (*)
+--- com.android.support:support-v4:23.1.1 (*)
\--- com.google.android.gms:play-services:8.3.0
     +--- com.google.android.gms:play-services-ads:8.3.0
     |    \--- com.google.android.gms:play-services-basement:8.3.0
     |         \--- com.android.support:support-v4:22.2.0 -> 23.1.1 (*)
     +--- com.google.android.gms:play-services-analytics:8.3.0
     |    \--- com.google.android.gms:play-services-basement:8.3.0 (*)
     +--- com.google.android.gms:play-services-appindexing:8.3.0
     |    \--- com.google.android.gms:play-services-basement:8.3.0 (*)
     +--- com.google.android.gms:play-services-appinvite:8.3.0
     |    \--- com.google.android.gms:play-services-base:8.3.0
     |         \--- com.google.android.gms:play-services-basement:8.3.0 (*)
     +--- com.google.android.gms:play-services-appstate:8.3.0
     |    \--- com.google.android.gms:play-services-base:8.3.0 (*)
     +--- com.google.android.gms:play-services-auth:8.3.0
     |    \--- com.google.android.gms:play-services-base:8.3.0 (*)
     +--- com.google.android.gms:play-services-base:8.3.0 (*)
     +--- com.google.android.gms:play-services-basement:8.3.0 (*)
     +--- com.google.android.gms:play-services-cast:8.3.0
     |    +--- com.google.android.gms:play-services-base:8.3.0 (*)
     |    \--- com.android.support:mediarouter-v7:22.2.0
     |         \--- com.android.support:appcompat-v7:22.2.0 -> 23.1.1 (*)
     +--- com.google.android.gms:play-services-drive:8.3.0
     |    \--- com.google.android.gms:play-services-base:8.3.0 (*)
     +--- com.google.android.gms:play-services-fitness:8.3.0
     |    +--- com.google.android.gms:play-services-base:8.3.0 (*)
     |    \--- com.google.android.gms:play-services-location:8.3.0
     |         +--- com.google.android.gms:play-services-base:8.3.0 (*)
     |         \--- com.google.android.gms:play-services-maps:8.3.0
     |              \--- com.google.android.gms:play-services-base:8.3.0 (*)
     +--- com.google.android.gms:play-services-games:8.3.0
     |    +--- com.google.android.gms:play-services-base:8.3.0 (*)
     |    \--- com.google.android.gms:play-services-drive:8.3.0 (*)
     +--- com.google.android.gms:play-services-gcm:8.3.0
     |    +--- com.google.android.gms:play-services-base:8.3.0 (*)
     |    \--- com.google.android.gms:play-services-measurement:8.3.0
     |         \--- com.google.android.gms:play-services-basement:8.3.0 (*)
     +--- com.google.android.gms:play-services-identity:8.3.0
     |    \--- com.google.android.gms:play-services-base:8.3.0 (*)
     +--- com.google.android.gms:play-services-location:8.3.0 (*)
     +--- com.google.android.gms:play-services-maps:8.3.0 (*)
     +--- com.google.android.gms:play-services-measurement:8.3.0 (*)
     +--- com.google.android.gms:play-services-nearby:8.3.0
     |    \--- com.google.android.gms:play-services-base:8.3.0 (*)
     +--- com.google.android.gms:play-services-panorama:8.3.0
     |    \--- com.google.android.gms:play-services-base:8.3.0 (*)
     +--- com.google.android.gms:play-services-plus:8.3.0
     |    \--- com.google.android.gms:play-services-base:8.3.0 (*)
     +--- com.google.android.gms:play-services-safetynet:8.3.0
     |    \--- com.google.android.gms:play-services-base:8.3.0 (*)
     +--- com.google.android.gms:play-services-vision:8.3.0
     |    \--- com.google.android.gms:play-services-base:8.3.0 (*)
     +--- com.google.android.gms:play-services-wallet:8.3.0
     |    +--- com.google.android.gms:play-services-base:8.3.0 (*)
     |    +--- com.google.android.gms:play-services-identity:8.3.0 (*)
     |    \--- com.google.android.gms:play-services-maps:8.3.0 (*)
     \--- com.google.android.gms:play-services-wearable:8.3.0
          \--- com.google.android.gms:play-services-base:8.3.0 (*)

_debugCompile - ## Internal use, do not manually configure ##
+--- project :pullToRefreshLib
|    \--- com.android.support:support-v4:23.1.1
|         \--- com.android.support:support-annotations:23.1.1
+--- project :aFileChooser
|    \--- com.android.support:support-v4:23.1.1 (*)
+--- info.hoang8f:android-segmented:1.0.5
+--- com.android.support:appcompat-v7:23.1.1
|    \--- com.android.support:support-v4:23.1.1 (*)
+--- com.android.support:support-v4:23.1.1 (*)
\--- com.google.android.gms:play-services:8.3.0
     +--- com.google.android.gms:play-services-ads:8.3.0
     |    \--- com.google.android.gms:play-services-basement:8.3.0
     |         \--- com.android.support:support-v4:22.2.0 -> 23.1.1 (*)
     +--- com.google.android.gms:play-services-analytics:8.3.0
     |    \--- com.google.android.gms:play-services-basement:8.3.0 (*)
     +--- com.google.android.gms:play-services-appindexing:8.3.0
     |    \--- com.google.android.gms:play-services-basement:8.3.0 (*)
     +--- com.google.android.gms:play-services-appinvite:8.3.0
     |    \--- com.google.android.gms:play-services-base:8.3.0
     |         \--- com.google.android.gms:play-services-basement:8.3.0 (*)
     +--- com.google.android.gms:play-services-appstate:8.3.0
     |    \--- com.google.android.gms:play-services-base:8.3.0 (*)
     +--- com.google.android.gms:play-services-auth:8.3.0
     |    \--- com.google.android.gms:play-services-base:8.3.0 (*)
     +--- com.google.android.gms:play-services-base:8.3.0 (*)
     +--- com.google.android.gms:play-services-basement:8.3.0 (*)
     +--- com.google.android.gms:play-services-cast:8.3.0
     |    +--- com.google.android.gms:play-services-base:8.3.0 (*)
     |    \--- com.android.support:mediarouter-v7:22.2.0
     |         \--- com.android.support:appcompat-v7:22.2.0 -> 23.1.1 (*)
     +--- com.google.android.gms:play-services-drive:8.3.0
     |    \--- com.google.android.gms:play-services-base:8.3.0 (*)
     +--- com.google.android.gms:play-services-fitness:8.3.0
     |    +--- com.google.android.gms:play-services-base:8.3.0 (*)
     |    \--- com.google.android.gms:play-services-location:8.3.0
     |         +--- com.google.android.gms:play-services-base:8.3.0 (*)
     |         \--- com.google.android.gms:play-services-maps:8.3.0
     |              \--- com.google.android.gms:play-services-base:8.3.0 (*)
     +--- com.google.android.gms:play-services-games:8.3.0
     |    +--- com.google.android.gms:play-services-base:8.3.0 (*)
     |    \--- com.google.android.gms:play-services-drive:8.3.0 (*)
     +--- com.google.android.gms:play-services-gcm:8.3.0
     |    +--- com.google.android.gms:play-services-base:8.3.0 (*)
     |    \--- com.google.android.gms:play-services-measurement:8.3.0
     |         \--- com.google.android.gms:play-services-basement:8.3.0 (*)
     +--- com.google.android.gms:play-services-identity:8.3.0
     |    \--- com.google.android.gms:play-services-base:8.3.0 (*)
     +--- com.google.android.gms:play-services-location:8.3.0 (*)
     +--- com.google.android.gms:play-services-maps:8.3.0 (*)
     +--- com.google.android.gms:play-services-measurement:8.3.0 (*)
     +--- com.google.android.gms:play-services-nearby:8.3.0
     |    \--- com.google.android.gms:play-services-base:8.3.0 (*)
     +--- com.google.android.gms:play-services-panorama:8.3.0
     |    \--- com.google.android.gms:play-services-base:8.3.0 (*)
     +--- com.google.android.gms:play-services-plus:8.3.0
     |    \--- com.google.android.gms:play-services-base:8.3.0 (*)
     +--- com.google.android.gms:play-services-safetynet:8.3.0
     |    \--- com.google.android.gms:play-services-base:8.3.0 (*)
     +--- com.google.android.gms:play-services-vision:8.3.0
     |    \--- com.google.android.gms:play-services-base:8.3.0 (*)
     +--- com.google.android.gms:play-services-wallet:8.3.0
     |    +--- com.google.android.gms:play-services-base:8.3.0 (*)
     |    +--- com.google.android.gms:play-services-identity:8.3.0 (*)
     |    \--- com.google.android.gms:play-services-maps:8.3.0 (*)
     \--- com.google.android.gms:play-services-wearable:8.3.0
          \--- com.google.android.gms:play-services-base:8.3.0 (*)

_debugUnitTestApk - ## Internal use, do not manually configure ##
No dependencies

_debugUnitTestCompile - ## Internal use, do not manually configure ##
No dependencies

_releaseApk - ## Internal use, do not manually configure ##
+--- project :pullToRefreshLib
|    \--- com.android.support:support-v4:23.1.1
|         \--- com.android.support:support-annotations:23.1.1
+--- project :aFileChooser
|    \--- com.android.support:support-v4:23.1.1 (*)
+--- info.hoang8f:android-segmented:1.0.5
+--- com.android.support:appcompat-v7:23.1.1
|    \--- com.android.support:support-v4:23.1.1 (*)
+--- com.android.support:support-v4:23.1.1 (*)
\--- com.google.android.gms:play-services:8.3.0
     +--- com.google.android.gms:play-services-ads:8.3.0
     |    \--- com.google.android.gms:play-services-basement:8.3.0
     |         \--- com.android.support:support-v4:22.2.0 -> 23.1.1 (*)
     +--- com.google.android.gms:play-services-analytics:8.3.0
     |    \--- com.google.android.gms:play-services-basement:8.3.0 (*)
     +--- com.google.android.gms:play-services-appindexing:8.3.0
     |    \--- com.google.android.gms:play-services-basement:8.3.0 (*)
     +--- com.google.android.gms:play-services-appinvite:8.3.0
     |    \--- com.google.android.gms:play-services-base:8.3.0
     |         \--- com.google.android.gms:play-services-basement:8.3.0 (*)
     +--- com.google.android.gms:play-services-appstate:8.3.0
     |    \--- com.google.android.gms:play-services-base:8.3.0 (*)
     +--- com.google.android.gms:play-services-auth:8.3.0
     |    \--- com.google.android.gms:play-services-base:8.3.0 (*)
     +--- com.google.android.gms:play-services-base:8.3.0 (*)
     +--- com.google.android.gms:play-services-basement:8.3.0 (*)
     +--- com.google.android.gms:play-services-cast:8.3.0
     |    +--- com.google.android.gms:play-services-base:8.3.0 (*)
     |    \--- com.android.support:mediarouter-v7:22.2.0
     |         \--- com.android.support:appcompat-v7:22.2.0 -> 23.1.1 (*)
     +--- com.google.android.gms:play-services-drive:8.3.0
     |    \--- com.google.android.gms:play-services-base:8.3.0 (*)
     +--- com.google.android.gms:play-services-fitness:8.3.0
     |    +--- com.google.android.gms:play-services-base:8.3.0 (*)
     |    \--- com.google.android.gms:play-services-location:8.3.0
     |         +--- com.google.android.gms:play-services-base:8.3.0 (*)
     |         \--- com.google.android.gms:play-services-maps:8.3.0
     |              \--- com.google.android.gms:play-services-base:8.3.0 (*)
     +--- com.google.android.gms:play-services-games:8.3.0
     |    +--- com.google.android.gms:play-services-base:8.3.0 (*)
     |    \--- com.google.android.gms:play-services-drive:8.3.0 (*)
     +--- com.google.android.gms:play-services-gcm:8.3.0
     |    +--- com.google.android.gms:play-services-base:8.3.0 (*)
     |    \--- com.google.android.gms:play-services-measurement:8.3.0
     |         \--- com.google.android.gms:play-services-basement:8.3.0 (*)
     +--- com.google.android.gms:play-services-identity:8.3.0
     |    \--- com.google.android.gms:play-services-base:8.3.0 (*)
     +--- com.google.android.gms:play-services-location:8.3.0 (*)
     +--- com.google.android.gms:play-services-maps:8.3.0 (*)
     +--- com.google.android.gms:play-services-measurement:8.3.0 (*)
     +--- com.google.android.gms:play-services-nearby:8.3.0
     |    \--- com.google.android.gms:play-services-base:8.3.0 (*)
     +--- com.google.android.gms:play-services-panorama:8.3.0
     |    \--- com.google.android.gms:play-services-base:8.3.0 (*)
     +--- com.google.android.gms:play-services-plus:8.3.0
     |    \--- com.google.android.gms:play-services-base:8.3.0 (*)
     +--- com.google.android.gms:play-services-safetynet:8.3.0
     |    \--- com.google.android.gms:play-services-base:8.3.0 (*)
     +--- com.google.android.gms:play-services-vision:8.3.0
     |    \--- com.google.android.gms:play-services-base:8.3.0 (*)
     +--- com.google.android.gms:play-services-wallet:8.3.0
     |    +--- com.google.android.gms:play-services-base:8.3.0 (*)
     |    +--- com.google.android.gms:play-services-identity:8.3.0 (*)
     |    \--- com.google.android.gms:play-services-maps:8.3.0 (*)
     \--- com.google.android.gms:play-services-wearable:8.3.0
          \--- com.google.android.gms:play-services-base:8.3.0 (*)

_releaseCompile - ## Internal use, do not manually configure ##
+--- project :pullToRefreshLib
|    \--- com.android.support:support-v4:23.1.1
|         \--- com.android.support:support-annotations:23.1.1
+--- project :aFileChooser
|    \--- com.android.support:support-v4:23.1.1 (*)
+--- info.hoang8f:android-segmented:1.0.5
+--- com.android.support:appcompat-v7:23.1.1
|    \--- com.android.support:support-v4:23.1.1 (*)
+--- com.android.support:support-v4:23.1.1 (*)
\--- com.google.android.gms:play-services:8.3.0
     +--- com.google.android.gms:play-services-ads:8.3.0
     |    \--- com.google.android.gms:play-services-basement:8.3.0
     |         \--- com.android.support:support-v4:22.2.0 -> 23.1.1 (*)
     +--- com.google.android.gms:play-services-analytics:8.3.0
     |    \--- com.google.android.gms:play-services-basement:8.3.0 (*)
     +--- com.google.android.gms:play-services-appindexing:8.3.0
     |    \--- com.google.android.gms:play-services-basement:8.3.0 (*)
     +--- com.google.android.gms:play-services-appinvite:8.3.0
     |    \--- com.google.android.gms:play-services-base:8.3.0
     |         \--- com.google.android.gms:play-services-basement:8.3.0 (*)
     +--- com.google.android.gms:play-services-appstate:8.3.0
     |    \--- com.google.android.gms:play-services-base:8.3.0 (*)
     +--- com.google.android.gms:play-services-auth:8.3.0
     |    \--- com.google.android.gms:play-services-base:8.3.0 (*)
     +--- com.google.android.gms:play-services-base:8.3.0 (*)
     +--- com.google.android.gms:play-services-basement:8.3.0 (*)
     +--- com.google.android.gms:play-services-cast:8.3.0
     |    +--- com.google.android.gms:play-services-base:8.3.0 (*)
     |    \--- com.android.support:mediarouter-v7:22.2.0
     |         \--- com.android.support:appcompat-v7:22.2.0 -> 23.1.1 (*)
     +--- com.google.android.gms:play-services-drive:8.3.0
     |    \--- com.google.android.gms:play-services-base:8.3.0 (*)
     +--- com.google.android.gms:play-services-fitness:8.3.0
     |    +--- com.google.android.gms:play-services-base:8.3.0 (*)
     |    \--- com.google.android.gms:play-services-location:8.3.0
     |         +--- com.google.android.gms:play-services-base:8.3.0 (*)
     |         \--- com.google.android.gms:play-services-maps:8.3.0
     |              \--- com.google.android.gms:play-services-base:8.3.0 (*)
     +--- com.google.android.gms:play-services-games:8.3.0
     |    +--- com.google.android.gms:play-services-base:8.3.0 (*)
     |    \--- com.google.android.gms:play-services-drive:8.3.0 (*)
     +--- com.google.android.gms:play-services-gcm:8.3.0
     |    +--- com.google.android.gms:play-services-base:8.3.0 (*)
     |    \--- com.google.android.gms:play-services-measurement:8.3.0
     |         \--- com.google.android.gms:play-services-basement:8.3.0 (*)
     +--- com.google.android.gms:play-services-identity:8.3.0
     |    \--- com.google.android.gms:play-services-base:8.3.0 (*)
     +--- com.google.android.gms:play-services-location:8.3.0 (*)
     +--- com.google.android.gms:play-services-maps:8.3.0 (*)
     +--- com.google.android.gms:play-services-measurement:8.3.0 (*)
     +--- com.google.android.gms:play-services-nearby:8.3.0
     |    \--- com.google.android.gms:play-services-base:8.3.0 (*)
     +--- com.google.android.gms:play-services-panorama:8.3.0
     |    \--- com.google.android.gms:play-services-base:8.3.0 (*)
     +--- com.google.android.gms:play-services-plus:8.3.0
     |    \--- com.google.android.gms:play-services-base:8.3.0 (*)
     +--- com.google.android.gms:play-services-safetynet:8.3.0
     |    \--- com.google.android.gms:play-services-base:8.3.0 (*)
     +--- com.google.android.gms:play-services-vision:8.3.0
     |    \--- com.google.android.gms:play-services-base:8.3.0 (*)
     +--- com.google.android.gms:play-services-wallet:8.3.0
     |    +--- com.google.android.gms:play-services-base:8.3.0 (*)
     |    +--- com.google.android.gms:play-services-identity:8.3.0 (*)
     |    \--- com.google.android.gms:play-services-maps:8.3.0 (*)
     \--- com.google.android.gms:play-services-wearable:8.3.0
          \--- com.google.android.gms:play-services-base:8.3.0 (*)

_releaseUnitTestApk - ## Internal use, do not manually configure ##
No dependencies

_releaseUnitTestCompile - ## Internal use, do not manually configure ##
No dependencies

androidJacocoAgent - The Jacoco agent to use to get coverage data.
\--- org.jacoco:org.jacoco.agent:0.7.4.201502262128

androidJacocoAnt - The Jacoco ant tasks to use to get execute Gradle tasks.
\--- org.jacoco:org.jacoco.ant:0.7.4.201502262128
     +--- org.jacoco:org.jacoco.core:0.7.4.201502262128
     |    \--- org.ow2.asm:asm-debug-all:5.0.1
     +--- org.jacoco:org.jacoco.report:0.7.4.201502262128
     |    +--- org.jacoco:org.jacoco.core:0.7.4.201502262128 (*)
     |    \--- org.ow2.asm:asm-debug-all:5.0.1
     \--- org.jacoco:org.jacoco.agent:0.7.4.201502262128

androidTestApk - Classpath packaged with the compiled 'androidTest' classes.
No dependencies

androidTestCompile - Classpath for compiling the androidTest sources.
No dependencies

androidTestProvided - Classpath for only compiling the androidTest sources.
No dependencies

androidTestWearApp - Link to a wear app to embed for object 'androidTest'.
No dependencies

apk - Classpath packaged with the compiled 'main' classes.
No dependencies

archives - Configuration for archive artifacts.
No dependencies

compile - Classpath for compiling the main sources.
+--- project :pullToRefreshLib
|    \--- com.android.support:support-v4:23.1.1
|         \--- com.android.support:support-annotations:23.1.1
+--- project :aFileChooser
|    \--- com.android.support:support-v4:23.1.1 (*)
+--- info.hoang8f:android-segmented:1.0.5
+--- com.android.support:appcompat-v7:23.1.1
|    \--- com.android.support:support-v4:23.1.1 (*)
+--- com.android.support:support-v4:23.1.1 (*)
\--- com.google.android.gms:play-services:8.3.0
     +--- com.google.android.gms:play-services-ads:8.3.0
     |    \--- com.google.android.gms:play-services-basement:8.3.0
     |         \--- com.android.support:support-v4:22.2.0 -> 23.1.1 (*)
     +--- com.google.android.gms:play-services-analytics:8.3.0
     |    \--- com.google.android.gms:play-services-basement:8.3.0 (*)
     +--- com.google.android.gms:play-services-appindexing:8.3.0
     |    \--- com.google.android.gms:play-services-basement:8.3.0 (*)
     +--- com.google.android.gms:play-services-appinvite:8.3.0
     |    \--- com.google.android.gms:play-services-base:8.3.0
     |         \--- com.google.android.gms:play-services-basement:8.3.0 (*)
     +--- com.google.android.gms:play-services-appstate:8.3.0
     |    \--- com.google.android.gms:play-services-base:8.3.0 (*)
     +--- com.google.android.gms:play-services-auth:8.3.0
     |    \--- com.google.android.gms:play-services-base:8.3.0 (*)
     +--- com.google.android.gms:play-services-base:8.3.0 (*)
     +--- com.google.android.gms:play-services-basement:8.3.0 (*)
     +--- com.google.android.gms:play-services-cast:8.3.0
     |    +--- com.google.android.gms:play-services-base:8.3.0 (*)
     |    \--- com.android.support:mediarouter-v7:22.2.0
     |         \--- com.android.support:appcompat-v7:22.2.0 -> 23.1.1 (*)
     +--- com.google.android.gms:play-services-drive:8.3.0
     |    \--- com.google.android.gms:play-services-base:8.3.0 (*)
     +--- com.google.android.gms:play-services-fitness:8.3.0
     |    +--- com.google.android.gms:play-services-base:8.3.0 (*)
     |    \--- com.google.android.gms:play-services-location:8.3.0
     |         +--- com.google.android.gms:play-services-base:8.3.0 (*)
     |         \--- com.google.android.gms:play-services-maps:8.3.0
     |              \--- com.google.android.gms:play-services-base:8.3.0 (*)
     +--- com.google.android.gms:play-services-games:8.3.0
     |    +--- com.google.android.gms:play-services-base:8.3.0 (*)
     |    \--- com.google.android.gms:play-services-drive:8.3.0 (*)
     +--- com.google.android.gms:play-services-gcm:8.3.0
     |    +--- com.google.android.gms:play-services-base:8.3.0 (*)
     |    \--- com.google.android.gms:play-services-measurement:8.3.0
     |         \--- com.google.android.gms:play-services-basement:8.3.0 (*)
     +--- com.google.android.gms:play-services-identity:8.3.0
     |    \--- com.google.android.gms:play-services-base:8.3.0 (*)
     +--- com.google.android.gms:play-services-location:8.3.0 (*)
     +--- com.google.android.gms:play-services-maps:8.3.0 (*)
     +--- com.google.android.gms:play-services-measurement:8.3.0 (*)
     +--- com.google.android.gms:play-services-nearby:8.3.0
     |    \--- com.google.android.gms:play-services-base:8.3.0 (*)
     +--- com.google.android.gms:play-services-panorama:8.3.0
     |    \--- com.google.android.gms:play-services-base:8.3.0 (*)
     +--- com.google.android.gms:play-services-plus:8.3.0
     |    \--- com.google.android.gms:play-services-base:8.3.0 (*)
     +--- com.google.android.gms:play-services-safetynet:8.3.0
     |    \--- com.google.android.gms:play-services-base:8.3.0 (*)
     +--- com.google.android.gms:play-services-vision:8.3.0
     |    \--- com.google.android.gms:play-services-base:8.3.0 (*)
     +--- com.google.android.gms:play-services-wallet:8.3.0
     |    +--- com.google.android.gms:play-services-base:8.3.0 (*)
     |    +--- com.google.android.gms:play-services-identity:8.3.0 (*)
     |    \--- com.google.android.gms:play-services-maps:8.3.0 (*)
     \--- com.google.android.gms:play-services-wearable:8.3.0
          \--- com.google.android.gms:play-services-base:8.3.0 (*)

debugApk - Classpath packaged with the compiled 'debug' classes.
No dependencies

debugCompile - Classpath for compiling the debug sources.
No dependencies

debugProvided - Classpath for only compiling the debug sources.
No dependencies

debugWearApp - Link to a wear app to embed for object 'debug'.
No dependencies

default - Configuration for default artifacts.
No dependencies

default-mapping - Configuration for default mapping artifacts.
No dependencies

provided - Classpath for only compiling the main sources.
No dependencies

releaseApk - Classpath packaged with the compiled 'release' classes.
No dependencies

releaseCompile - Classpath for compiling the release sources.
No dependencies

releaseProvided - Classpath for only compiling the release sources.
No dependencies

releaseWearApp - Link to a wear app to embed for object 'release'.
No dependencies

testApk - Classpath packaged with the compiled 'test' classes.
No dependencies

testCompile - Classpath for compiling the test sources.
No dependencies

testDebugApk - Classpath packaged with the compiled 'testDebug' classes.
No dependencies

testDebugCompile - Classpath for compiling the testDebug sources.
No dependencies

testDebugProvided - Classpath for only compiling the testDebug sources.
No dependencies

testDebugWearApp - Link to a wear app to embed for object 'testDebug'.
No dependencies

testProvided - Classpath for only compiling the test sources.
No dependencies

testReleaseApk - Classpath packaged with the compiled 'testRelease' classes.
No dependencies

testReleaseCompile - Classpath for compiling the testRelease sources.
No dependencies

testReleaseProvided - Classpath for only compiling the testRelease sources.
No dependencies

testReleaseWearApp - Link to a wear app to embed for object 'testRelease'.
No dependencies

testWearApp - Link to a wear app to embed for object 'test'.
No dependencies

wearApp - Link to a wear app to embed for object 'main'.
No dependencies

任何人都会看到错误吗?

3 个答案:

答案 0 :(得分:1)

这是一个众所周知的问题,称为65K问题,它会导致OutOfMemory异常。 Click here for more information about the problem.

要解决此问题,首先应在build.gradle文件中添加multidex支持库:

compile 'com.android.support:multidex:1.0.0'

然后你应该按照这三个简单的步骤来实现它:

如果您没有自己实现Application类,只需在应用程序标记下的Android Manifest文件中定义库的MultiDexApplication:

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

如果要实现自己的Application类,可以简单地覆盖MultiDexApplication文件:

public class MyAwesomeApplication extends MultiDexApplication {

或者,如果您的应用程序类已经扩展了另一个类,您可以覆盖attachBaseContext方法并向其添加以下调用:

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

希望这会对你有所帮助。快乐的编码。

答案 1 :(得分:0)

通常当我收到此错误消息时,我只是清理项目,一切都会好的。

以防它发生,因为库中有重复的dex文件。

您可以在应用程序路径下的命令行中运行$array = array("72.4x.xxx.xxx","90.18x.xxx.xxx","177.9x.xxx.xxx","72.4x.xxx.xxx","90.18x.xxx.xxx","177.9x.xxx.xxx","72.4x.xxx.xxx","90.18x.xxx.xxx","177.9x.xxx.xxx","72.4x.xxx.xxx","90.18x.xxx.xxx","177.9x.xxx.xxx","90.18x.xxx.xxx","177.9x.xxx.xxx","90.18x.xxx.xxx","177.9x.xxx.xxx"); (projectRoot / app)并在此处粘贴结果吗?

答案 2 :(得分:0)

根据谷歌的文件Setting Up Google Play Services

注意:如果您的应用中方法引用的数量超过65K限制,您的应用可能无法编译。您可以通过仅指定应用使用的特定Google Play服务API而非全部API来编译应用时缓解此问题。

您可能希望在build.gradle文件中替换此行

compile 'com.google.android.gms:play-services:8.3.0'

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

这样项目只包含您需要的地图模块而不是整个游戏服务库组。

让我们看看它是怎么回事。