我正在尝试在IntelliJ Idea中为我的libGDX项目添加Google Play服务.我已按照此处的设置指南进行操作:https://developers.google.com/android/guides/setup
这看起来非常简单.我刚刚在相应的部分中将这些行添加到我的build.gradle中,所以现在看起来像:
project(":android") {
apply plugin: "android"
apply plugin: 'com.android.application'
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-arm64-v8a"
natives "com.badlogicgames.gdx:gdx-platform:$gdxVersion:natives-x86"
natives "com.badlogicgames.gdx:gdx-platform:$gdxVersion:natives-x86_64"
compile "com.badlogicgames.gdx:gdx-box2d-platform:$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.badlogicgames.gdx:gdx-freetype:$gdxVersion"
natives "com.badlogicgames.gdx:gdx-freetype-platform:$gdxVersion:natives-armeabi"
natives "com.badlogicgames.gdx:gdx-freetype-platform:$gdxVersion:natives-armeabi-v7a"
natives "com.badlogicgames.gdx:gdx-freetype-platform:$gdxVersion:natives-arm64-v8a"
natives "com.badlogicgames.gdx:gdx-freetype-platform:$gdxVersion:natives-x86"
natives "com.badlogicgames.gdx:gdx-freetype-platform:$gdxVersion:natives-x86_64"
compile 'com.google.android.gms:play-services:11.2.0'
}
}
Run Code Online (Sandbox Code Playgroud)
然后我尝试在Idea中同步我的gradle项目,以获得"无法解决"错误.
好吧,设置指南还说"确保每次更新Google Play服务时都更新此版本号",但问题是找到该版本号几乎是不可能的:根据Android SDK我的Google Play Services SDK版本manager是"43",到目前为止,我无法将这样的"11.2.0"或任何典型的版本字符串与"43"版本号相关联.并非设置指南对此没有任何说明.
无论如何,我从与此相关的众多问题中尝试了很多事情但无济于事.具体来说,我必须指出我确实更新了我的Android SDK,我确信它是Idea正在使用的那个(我已经三次检查了这个......):
我正在使用API级别26,但无论如何其他定义确实使用Android SDK的相同目录.此外,我没有在这台笔记本电脑上安装任何其他Android SDK,所以毫无疑问,Idea只使用那个和那个.
任何想法都非常受欢迎.
提前致谢!
我在android ant build(project.properties)中使用以下行:
dex.force.jumbo=true
Run Code Online (Sandbox Code Playgroud)
现在我们正从蚂蚁迁移到Gradle.是否有可能在Android Gradle构建中激活jumbo模式?
我正在开发针对dex方法计数限制运行的Android应用程序.有没有一种简单的方法来显示按包分组的方法计数?我可以得到总方法数,但我的应用程序有多个组件,我试图找出哪个组件是最大的贡献者.
我试图在gradle中为我的项目设置jumboMode,它似乎能够解决以下DexIndexOverflowException:
com.android.dex.DexException:无法将新索引65536合并为非巨型指令!
DexIndexOverflowException:无法将新索引65772合并为非jumbo指令!
1)什么是jumboMode选项实际上在幕后做了什么?
android {
...
dexOptions {
jumboMode true
}
}
Run Code Online (Sandbox Code Playgroud)
2)我也注意到启用multi-dex也可以解决同样的问题,这两种方法之间的正确选择是什么?
android {
...
defaultConfig {
...
multiDexEnabled true
}
}
Run Code Online (Sandbox Code Playgroud)