[英]Android libgdx and Google Game Services exited with a 2
好吧,我已經為此工作了近一個星期,現在變得煩人了。 我的項目始終可以在桌面模式下完美編譯,而在我開始集成Google Play服務之前,Android版本運行良好。 我了解它在某處是重復項,曾嘗試刪除該版本並將其重新制作,並嘗試過其他各種解決方案,但無濟於事。 這是我的gradle構建文件。 我已經將GameHelper作為類包含在我的模塊中。
buildscript {
repositories {
mavenCentral()
maven { url "https://oss.sonatype.org/content/repositories/snapshots/" }
}
dependencies {
classpath 'com.android.tools.build:gradle:1.2.3'
}
}
allprojects {
apply plugin: "eclipse"
apply plugin: "idea"
version = '1.0'
ext {
appName = "Collide_5"
gdxVersion = '1.7.0'
roboVMVersion = '1.8.0'
box2DLightsVersion = '1.4'
ashleyVersion = '1.6.0'
aiVersion = '1.6.0'
}
repositories {
mavenCentral()
maven { url "https://oss.sonatype.org/content/repositories/snapshots/" }
maven { url "https://oss.sonatype.org/content/repositories/releases/" }
}
}
project(":desktop") {
apply plugin: "java"
dependencies {
compile project(":core")
compile "com.badlogicgames.gdx:gdx-backend-lwjgl:$gdxVersion"
compile "com.badlogicgames.gdx:gdx-platform:$gdxVersion:natives-desktop"
compile "com.badlogicgames.gdx:gdx-box2d-platform:$gdxVersion:natives-desktop"
}
}
project(":android") {
apply plugin: "android"
configurations { natives }
dependencies {
compile project(":core")
compile "com.badlogicgames.gdx:gdx-backend-android:$gdxVersion"
natives "com.badlogicgames.gdx:gdx-platform:$gdxVersion:natives-armeabi"
natives "com.badlogicgames.gdx:gdx-platform:$gdxVersion:natives-armeabi-v7a"
natives "com.badlogicgames.gdx:gdx-platform:$gdxVersion:natives-x86"
compile "com.badlogicgames.gdx:gdx-box2d:$gdxVersion"
natives "com.badlogicgames.gdx:gdx-box2d-platform:$gdxVersion:natives-armeabi"
natives "com.badlogicgames.gdx:gdx-box2d-platform:$gdxVersion:natives-armeabi-v7a"
natives "com.badlogicgames.gdx:gdx-box2d-platform:$gdxVersion:natives-x86"
compile "com.google.android.gms:play-services:8.3.0"
}
}
project(":core") {
apply plugin: "java"
dependencies {
compile "com.badlogicgames.gdx:gdx:$gdxVersion"
compile "com.badlogicgames.gdx:gdx-box2d:$gdxVersion"
compile "net.dermetfan.libgdx-utils:libgdx-utils-box2d:0.13.1"
compile "net.dermetfan.libgdx-utils:libgdx-utils:0.13.1"
compile "com.underwaterapps.overlap2druntime:overlap2d-runtime-libgdx:0.1.0"
}
}
tasks.eclipse.doLast {
delete ".project"
為了擺脫錯誤,我從頭開始創建了一個新的Libgdx項目,並將BasegameUtils(Base)添加為庫項目,並且沒有添加Google Game Services作為依賴項,因為它是Base中的依賴項。 我在Android項目中使Base成為庫依賴項。 到目前為止,我能夠報告的很好,現在我要做的就是添加到項目中,這是所需的單個Google服務。 到目前為止,我所做的就是在核心程序包中添加一個接口,並將其集成到我的Android和Desktop項目中。 我還有其他問題要解決,但是Android版本上dex失敗的問題已經解決。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.