【发布时间】:2014-09-12 17:49:38
【问题描述】:
我需要了解如何设置 libGDX 项目的 gradle 配置,我正在使用 Eclipse。如何设置 gradle 文件(如 build.gradle 和 settings.gradle)以使设置适用于 IOS 和 Android libGDX 项目。
感谢大家的帮助,
安东尼
【问题讨论】:
标签: eclipse libgdx google-play-services
我需要了解如何设置 libGDX 项目的 gradle 配置,我正在使用 Eclipse。如何设置 gradle 文件(如 build.gradle 和 settings.gradle)以使设置适用于 IOS 和 Android libGDX 项目。
感谢大家的帮助,
安东尼
【问题讨论】:
标签: eclipse libgdx google-play-services
要将 google play 服务添加到 android 打开 build.gradle(从项目文件夹)
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"
// ^ default things
compile 'com.google.android.gms:play-services:5.0.89' // this one, add this line
}
}
您可能需要为 iOS 做同样的事情。 (没有测试,我没有Mac)。 让我知道它是否有效。
【讨论】: