处理应用程序执行失败:添加BaseGameUtils

时间:2015-09-26 11:09:12

标签: java android google-plus google-play-services leaderboard

我刚刚将baseGameUtils导入到我的Android游戏中以添加Google Play排行榜,但是当我按下播放时我收到此错误:“错误:任务执行失败”:app:dexDebug'。

  

com.android.ide.common.process.ProcessException:org.gradle.process.internal.ExecException:进程'命令'/ usr / lib / jvm / java-7-openjdk-amd64 / bin / java''完成具有非零退出值2`

我尝试按照以下两页的说明操作:Stackoverflow question 1Stackoverflow question 2。 我尝试将google支持库设置为basegameutils build.gradle中的22.2.1和8.1.0,但后来我在该库中的.java文件中缺少依赖项。 我完全没有想法,需要帮助。 谢谢大家。

应用程式:的build.gradle:

apply plugin: 'com.android.application'


android {
compileSdkVersion 22
buildToolsVersion "22.0.1"

defaultConfig {
    applicationId "com.honeycomb.touchtycube"
    minSdkVersion 14
    targetSdkVersion 22
    versionCode 11
    versionName "1.1.6"

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

dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
//compile project(':facebook');


compile 'com.android.support:appcompat-v7:22.2.1'
compile 'com.google.android.gms:play-services-ads:8.1.0'
compile 'com.google.android.gms:play-services-games:8.1.0'
compile project(':BaseGameUtils')

//compile project(':libs:basegameutils')
//compile 'com.purplebrain.adbuddiz.sdk:AdBuddiz-Java:3.0.15'
compile files('src/main/java/com/honeycomb/touchtycube/testapp/libs/AdBuddiz-3.0.15.jar')

}

repositories {
    maven {
       url 'http://repository.adbuddiz.com/maven'
    }
}

BaseBuildUtils:build_gradle:

apply plugin: 'com.android.library'


buildscript {
repositories {
    jcenter()
}

dependencies {
    classpath 'com.android.tools.build:gradle:1.3.0'
}


}

dependencies {
// Set defaults so that BaseGameUtils can be used outside of BasicSamples
if (!hasProperty('appcompat_library_version')) {
    ext.appcompat_library_version = '20.0.+'
}
if (!hasProperty('support_library_version')) {
    ext.support_library_version = '20.0.+'
}
if (!hasProperty('gms_library_version')) {
    ext.gms_library_version = '7.8.0'
}
compile "com.android.support:appcompat-v7:${appcompat_library_version}"
compile "com.android.support:support-v4:${support_library_version}"
compile "com.google.android.gms:play-services-games:${gms_library_version}"
compile "com.google.android.gms:play-services-plus:${gms_library_version}"
compile "com.google.android.gms:play-services-appstate:${gms_library_version}"
}

android {
// Set defaults so that BaseGameUtils can be used outside of BasicSamples
if (!hasProperty('android_compile_version')) {
    ext.android_compile_version = 20
}
if (!hasProperty('android_version')) {
    ext.android_version = '20'
}

compileSdkVersion android_compile_version
buildToolsVersion android_version
}

编辑: 我可以做一个没有任何错误的“make Project”,只有当我执行“运行应用程序”时才会出现错误(或者我认为它在技术上是“运行'配置'”)。

1 个答案:

答案 0 :(得分:0)

检查一下prograud规则。还要添加gradle构建文件。