So I am having android app using libgdx and tried to implement google play services. When I turn on an emulator, it's just appears black screen. Go to Android Monitor and this shows up:
09-22 11:56:48.140 1571-1571/? E/MobileDataStateTracker: default: Ignoring feature request because could not acquire PhoneService
09-22 11:56:48.140 1571-1571/? E/MobileDataStateTracker: default: Could not enable APN type "default"
09-22 11:56:56.777 1861-1975/? E/ActivityThread: Failed to find provider info for com.google.android.wearable.settings
09-22 11:56:59.757 1861-1975/? E/ActivityThread: Failed to find provider info for com.google.android.wearable.settings
09-22 11:57:01.687 2159-2174/? E/ActivityThread: Failed to find provider info for com.google.android.partnersetup.rlzappprovider
09-22 11:57:03.467 1861-2219/? E/ActivityThread: Failed to find provider info for com.google.android.wearable.settings
09-22 11:57:06.017 1861-2219/? E/ActivityThread: Failed to find provider info for com.google.android.wearable.settings
09-22 11:57:34.537 1861-1861/? E/ActivityThread: Service com.google.android.gms.chimera.GmsIntentOperationService has leaked ServiceConnection crs#a53b5ea8 that was originally bound here
android.app.ServiceConnectionLeaked: Service com.google.android.gms.chimera.GmsIntentOperationService has leaked ServiceConnection crs#a53b5ea8 that was originally bound here
at android.app.LoadedApk$ServiceDispatcher.<init>(LoadedApk.java:979)
at android.app.LoadedApk.getServiceDispatcher(LoadedApk.java:873)
at android.app.ContextImpl.bindServiceCommon(ContextImpl.java:1561)
at android.app.ContextImpl.bindService(ContextImpl.java:1544)
at android.content.ContextWrapper.bindService(ContextWrapper.java:517)
at android.content.ContextWrapper.bindService(ContextWrapper.java:517)
at android.content.ContextWrapper.bindService(ContextWrapper.java:517)
at android.content.ContextWrapper.bindService(ContextWrapper.java:517)
at com.google.android.gms.chimera.container.zapp.ZappLogOperation.onHandleIntent(:com.google.android.gms#11509030:1)
at com.google.android.chimera.IntentOperation.onHandleIntent(:com.google.android.gms#11509030:2)
at bvr.run(:com.google.android.gms#11509030:10)
at bvo.run(:com.google.android.gms#11509030:14)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1112)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:587)
at java.lang.Thread.run(Thread.java:841)
09-22 12:13:57.597 2765-2765/? E/memtrack: Couldn't load memtrack module (No such file or directory)
09-22 12:13:57.597 2765-2765/? E/android.os.Debug: failed to load memtrack module: -2
09-22 12:13:57.617 1571-1600/? E/InputDispatcher: channel 'a534dd00 com.squareit.pupindev/com.squareit.pupindev.AndroidLauncher (server)' ~ Channel is unrecoverably broken and will be disposed!
I thought that it was from implementing Play Services and Google Ads but I removed all dependencies and code from gradle files and Android Launcher, so my gradle files look like this:
Project:
buildscript {
repositories {
mavenLocal()
mavenCentral()
maven { url "https://oss.sonatype.org/content/repositories/snapshots/" }
jcenter()
}
dependencies {
classpath 'de.richsource.gradle.plugins:gwt-gradle-plugin:0.6'
classpath 'com.android.tools.build:gradle:2.3.3'
classpath 'com.mobidevelop.robovm:robovm-gradle-plugin:2.3.1'
}
}
allprojects {
apply plugin: "eclipse"
apply plugin: "idea"
version = '1.0'
ext {
appName = "SquareIt"
gdxVersion = '1.9.6'
roboVMVersion = '2.3.1'
box2DLightsVersion = '1.4'
ashleyVersion = '1.7.0'
aiVersion = '1.8.0'
}
repositories {
mavenLocal()
mavenCentral()
maven { url "https://oss.sonatype.org/content/repositories/snapshots/" }
maven { url "https://oss.sonatype.org/content/repositories/releases/" }
maven {
url "https://maven.google.com"
}
}
}
project(":android") {
apply plugin: "android"
configurations { natives }
dependencies {
compile project(":core")
// compile project(":BaseGameUtils")
compile 'com.android.support:multidex:1.0.1'
compile "com.android.support:appcompat-v7:25.3.1"
compile "com.android.support:support-v4:25.3.1"
compile 'com.android.support:support-annotations:25.3.1'
// compile 'com.google.android.gms:play-services-ads:11.2.2'
// compile 'com.google.android.gms:play-services-games:11.2.2'
// compile 'com.google.android.gms:play-services-drive:11.2.2'
// compile 'com.google.android.gms:play-services-auth:11.2.2'
// compile "com.google.android.gms:play-services-plus:11.2.2"
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:$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-arm64-v8a"
natives "com.badlogicgames.gdx:gdx-box2d-platform:$gdxVersion:natives-x86"
natives "com.badlogicgames.gdx:gdx-box2d-platform:$gdxVersion:natives-x86_64"
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"
}
}
project(":core") {
apply plugin: "java"
dependencies {
compile "com.badlogicgames.gdx:gdx:$gdxVersion"
compile "com.badlogicgames.gdx:gdx-box2d:$gdxVersion"
compile "com.badlogicgames.gdx:gdx-freetype:$gdxVersion"
}
}
tasks.eclipse.doLast {
delete ".project"
}
Android module:
android {
buildToolsVersion "26.0.1"
compileSdkVersion 26
sourceSets {
main {
manifest.srcFile 'AndroidManifest.xml'
java.srcDirs = ['src']
aidl.srcDirs = ['src']
renderscript.srcDirs = ['src']
res.srcDirs = ['res']
assets.srcDirs = ['assets']
jniLibs.srcDirs = ['libs']
}
instrumentTest.setRoot('tests')
}
packagingOptions {
exclude 'META-INF/robovm/ios/robovm.xml'
}
defaultConfig {
applicationId "com.squareit.pupindev"
minSdkVersion 14
targetSdkVersion 26
versionCode 4
versionName "1.1.1"
multiDexEnabled true
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
configurations {
}
lintOptions {
checkReleaseBuilds false
// Or, if you prefer, you can continue to check for errors in release builds,
// but continue the build even when errors are found:
abortOnError false
}
}
// called every time gradle gets executed, takes the native dependencies of
// the natives configuration, and extracts them to the proper libs/ folders
// so they get packed with the APK.
task copyAndroidNatives() {
file("libs/armeabi/").mkdirs();
file("libs/armeabi-v7a/").mkdirs();
file("libs/arm64-v8a/").mkdirs();
file("libs/x86_64/").mkdirs();
file("libs/x86/").mkdirs();
configurations.natives.files.each { jar ->
def outputDir = null
if (jar.name.endsWith("natives-arm64-v8a.jar")) outputDir = file("libs/arm64-v8a")
if (jar.name.endsWith("natives-armeabi-v7a.jar")) outputDir = file("libs/armeabi-v7a")
if (jar.name.endsWith("natives-armeabi.jar")) outputDir = file("libs/armeabi")
if (jar.name.endsWith("natives-x86_64.jar")) outputDir = file("libs/x86_64")
if (jar.name.endsWith("natives-x86.jar")) outputDir = file("libs/x86")
if (outputDir != null) {
copy {
from zipTree(jar)
into outputDir
include "*.so"
}
}
}
}
task run(type: Exec) {
def path
def localProperties = project.file("../local.properties")
if (localProperties.exists()) {
Properties properties = new Properties()
localProperties.withInputStream { instr ->
properties.load(instr)
}
def sdkDir = properties.getProperty('sdk.dir')
if (sdkDir) {
path = sdkDir
} else {
path = "$System.env.ANDROID_HOME"
}
} else {
path = "$System.env.ANDROID_HOME"
}
def adb = path + "/platform-tools/adb"
commandLine "$adb", 'shell', 'am', 'start', '-n', 'com.mygdx.game/com.mygdx.game.AndroidLauncher'
}
// sets up the Android Eclipse project, using the old Ant based build.
eclipse {
// need to specify Java source sets explicitly, SpringSource Gradle Eclipse plugin
// ignores any nodes added in classpath.file.withXml
sourceSets {
main {
java.srcDirs "src", 'gen'
}
}
jdt {
sourceCompatibility = 1.6
targetCompatibility = 1.6
}
classpath {
plusConfigurations += [project.configurations.compile]
containers 'com.android.ide.eclipse.adt.ANDROID_FRAMEWORK', 'com.android.ide.eclipse.adt.LIBRARIES'
}
project {
name = appName + "-android"
natures 'com.android.ide.eclipse.adt.AndroidNature'
buildCommands.clear();
buildCommand "com.android.ide.eclipse.adt.ResourceManagerBuilder"
buildCommand "com.android.ide.eclipse.adt.PreCompilerBuilder"
buildCommand "org.eclipse.jdt.core.javabuilder"
buildCommand "com.android.ide.eclipse.adt.ApkBuilder"
}
}
// sets up the Android Idea project, using the old Ant based build.
idea {
module {
sourceDirs += file("src");
scopes = [COMPILE: [plus: [project.configurations.compile]]]
iml {
withXml {
def node = it.asNode()
def builder = NodeBuilder.newInstance();
builder.current = node;
builder.component(name: "FacetManager") {
facet(type: "android", name: "Android") {
configuration {
option(name: "UPDATE_PROPERTY_FILES", value: "true")
}
}
}
}
}
}
}
dependencies {
}
Here is AndroidLauncher extends AndroidApplication onCreate method:
#Override
protected void onCreate (Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
AndroidApplicationConfiguration config = new AndroidApplicationConfiguration();
initialize(mainGame = new Squareit(this), config);
}
Related
I recently connected the Spring messaging module to my libgdx project for graceful use of sockets by following this tutorial: https://nexocode.com/blog/posts/spring-dependencies-in-gradle/
Then the task android: mergeDebugJavaResource swears that I have more than one file META-INF/web-fragment.xml
* What went wrong:
Execution failed for task ':android:mergeDebugJavaResource'.
> A failure occurred while executing com.android.build.gradle.internal.tasks.Workers$ActionFacade
> More than one file was found with OS independent path 'META-INF/web-fragment.xml'.
Since the problem appears at startup and not build, so I am showing you gradle.build's
build.gradle(app_name)
buildscript {
repositories {
mavenLocal()
mavenCentral()
maven { url "https://plugins.gradle.org/m2/" }
maven { url "https://oss.sonatype.org/content/repositories/snapshots/" }
google()
}
dependencies {
classpath 'com.android.tools.build:gradle:4.1.3'
classpath 'com.mobidevelop.robovm:robovm-gradle-plugin:2.3.12'
classpath 'com.google.gms:google-services:4.3.5'
}
}
plugins {
id 'java-library'
id 'org.springframework.boot' version '2.1.0.RELEASE'
}
allprojects {
apply plugin: "eclipse"
version = '1.0'
ext {
appName = "bogatiry-online"
gdxVersion = '1.9.14'
roboVMVersion = '2.3.12'
box2DLightsVersion = '1.5'
ashleyVersion = '1.7.3'
aiVersion = '1.8.2'
gdxControllersVersion = '2.1.0'
}
repositories {
mavenLocal()
mavenCentral()
google()
maven { url "https://oss.sonatype.org/content/repositories/snapshots/" }
maven { url "https://oss.sonatype.org/content/repositories/releases/" }
}
}
project(":desktop") {
apply plugin: "java-library"
dependencies {
implementation project(":core")
api "com.badlogicgames.gdx:gdx-backend-lwjgl:$gdxVersion"
api "com.badlogicgames.gdx:gdx-platform:$gdxVersion:natives-desktop"
api "com.badlogicgames.gdx:gdx-tools:$gdxVersion"
}
}
project(":android") {
apply plugin: "com.android.application"
configurations { natives }
dependencies {
implementation project(":core")
api "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"
api "com.badlogicgames.box2dlights:box2dlights:$box2DLightsVersion"
}
}
project(":ios") {
apply plugin: "java-library"
apply plugin: "robovm"
dependencies {
implementation project(":core")
api "com.mobidevelop.robovm:robovm-rt:$roboVMVersion"
api "com.mobidevelop.robovm:robovm-cocoatouch:$roboVMVersion"
api "com.badlogicgames.gdx:gdx-backend-robovm:$gdxVersion"
api "com.badlogicgames.gdx:gdx-platform:$gdxVersion:natives-ios"
}
}
project(":core") {
apply plugin: "java-library"
dependencies {
api "com.badlogicgames.gdx:gdx:$gdxVersion"
api "com.badlogicgames.box2dlights:box2dlights:$box2DLightsVersion"
api "com.underwaterapps.overlap2druntime:overlap2d-runtime-libgdx:0.1.0"
api "com.kotcrab.vis:vis-ui:1.3.0"
}
}
build.gradle(:core)
plugins {
id 'org.springframework.boot'
id 'io.spring.dependency-management'
}
sourceCompatibility = 1.7
dependencies {
//Apache
implementation group: 'org.apache.httpcomponents', name: 'httpclient', version: '4.5.13'
//Json
implementation group: 'com.fasterxml.jackson.core', name: 'jackson-databind', version: '2.12.3'
//Lombok
compileOnly group: 'org.projectlombok', name: 'lombok', version: '1.18.20'
//Spring
api platform('org.springframework.boot:spring-boot-dependencies:2.1.0.RELEASE')
implementation 'org.springframework.boot:spring-boot-starter-websocket'
dependencies {
constraints {
implementation 'org.springframework.boot:spring-boot-starter-websocket:2.4.5'
}
}
}
[compileJava, compileTestJava]*.options*.encoding = 'UTF-8'
sourceSets.main.java.srcDirs = [ "src/" ]
eclipse.project.name = appName + "-core"
bootJar {
enabled = false
}
jar {
enabled = true
}
build.gradle(:android) (although I think that the problem is not in it, I did not change it when there was no error)
apply plugin: 'com.google.gms.google-services'
android {
buildToolsVersion "30.0.3"
compileSdkVersion 30
sourceSets {
main {
manifest.srcFile 'AndroidManifest.xml'
java.srcDirs = ['src']
aidl.srcDirs = ['src']
renderscript.srcDirs = ['src']
res.srcDirs = ['res']
assets.srcDirs = ['assets']
jniLibs.srcDirs = ['libs']
}
}
packagingOptions {
exclude 'META-INF/robovm/ios/robovm.xml'
}
defaultConfig {
applicationId "com.drownedman.bogatiry"
minSdkVersion 26
targetSdkVersion 30
versionCode 1
versionName "1.0"
}
buildTypes {
release {
minifyEnabled true
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
packagingOptions {
exclude 'META-INF/DEPENDENCIES'
exclude 'META-INF/LICENSE'
exclude 'META-INF/LICENSE.txt'
exclude 'META-INF/license.txt'
exclude 'META-INF/NOTICE'
exclude 'META-INF/NOTICE.txt'
exclude 'META-INF/notice.txt'
exclude 'META-INF/ASL2.0'
exclude("META-INF/*.kotlin_module")
}
}
// called every time gradle gets executed, takes the native dependencies of
// the natives configuration, and extracts them to the proper libs/ folders
// so they get packed with the APK.
task copyAndroidNatives {
doFirst {
file("libs/armeabi/").mkdirs()
file("libs/armeabi-v7a/").mkdirs()
file("libs/arm64-v8a/").mkdirs()
file("libs/x86_64/").mkdirs()
file("libs/x86/").mkdirs()
configurations.natives.copy().files.each { jar ->
def outputDir = null
if (jar.name.endsWith("natives-arm64-v8a.jar")) outputDir = file("libs/arm64-v8a")
if (jar.name.endsWith("natives-armeabi-v7a.jar")) outputDir = file("libs/armeabi-v7a")
if(jar.name.endsWith("natives-armeabi.jar")) outputDir = file("libs/armeabi")
if(jar.name.endsWith("natives-x86_64.jar")) outputDir = file("libs/x86_64")
if(jar.name.endsWith("natives-x86.jar")) outputDir = file("libs/x86")
if(outputDir != null) {
copy {
from zipTree(jar)
into outputDir
include "*.so"
}
}
}
}
}
tasks.whenTaskAdded { packageTask ->
if (packageTask.name.contains("package")) {
packageTask.dependsOn 'copyAndroidNatives'
}
}
task run(type: Exec) {
def path
def localProperties = project.file("../local.properties")
if (localProperties.exists()) {
Properties properties = new Properties()
localProperties.withInputStream { instr ->
properties.load(instr)
}
def sdkDir = properties.getProperty('sdk.dir')
if (sdkDir) {
path = sdkDir
} else {
path = "$System.env.ANDROID_HOME"
}
} else {
path = "$System.env.ANDROID_HOME"
}
def adb = path + "/platform-tools/adb"
commandLine "$adb", 'shell', 'am', 'start', '-n', 'com.drownedman.bogatiry/com.drownedman.bogatiry.AndroidLauncher'
}
dependencies {
// Import the BoM for the Firebase platform
implementation platform('com.google.firebase:firebase-bom:26.8.0')
// Declare the dependency for the Firebase Authentication library
// When using the BoM, you don't specify versions in Firebase library dependencies
implementation 'com.google.firebase:firebase-auth'
implementation 'com.google.firebase:firebase-database:19.7.0'
implementation 'com.google.android.gms:play-services-auth:18.0.0'
implementation 'androidx.appcompat:appcompat:1.2.0'
implementation 'androidx.constraintlayout:constraintlayout:2.0.4'
}
eclipse.project.name = appName + "-android"
I've tried
File -> Invalidate Caches/Restart.
Checked the compatibility of the versions, everything seems to be ok.
Excluded some "META-INF /" files commonly found in errors like this (More than one file was found with OS independent path 'META-INF/LICENSE'). I can exclude this file the same way, but then I get a similar error with another file, then with another one, and so on.
but it doesn't help
Answering my own question, I just excluded this long list of files, as advised in a similar question More than one file was found with OS independent path 'META-INF/LICENSE'
exclude 'META-INF/web-fragment.xml'
exclude 'META-INF/LICENSE.md'
exclude 'META-INF/NOTICE.md'
exclude 'META-INF/spring.schemas'
exclude 'META-INF/spring.tooling'
exclude 'META-INF/spring.handlers'
exclude 'META-INF/spring-configuration-metadata.json'
exclude 'META-INF/spring.factories'
exclude 'META-INF/additional-spring-configuration-metadata.json'
When I run ./gradlew desktop:run in the Android Studio terminal it fails to run. But when I set a run configuration (A Gradle task with the Gradle project being my project and run task being "desktop:run") it works perfectly fine. (Also the ./gradlew android:run doesn't work either, it only works when I run the android configuration which is automatically created.)
./gradlew desktop:run:
FAILURE: Build failed with an exception.
* What went wrong:
Could not determine java version from '10.0.2'.
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.
./gradlew android:run:
FAILURE: Build failed with an exception.
* What went wrong:
Could not determine java version from '10.0.2'.
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.
EDIT: Some pages on the web suggested I use an older java version but that doesn't work.
build.gradle (project level):
buildscript {
repositories {
mavenCentral()
maven { url "https://oss.sonatype.org/content/repositories/snapshots/" }
jcenter()
}
dependencies {
classpath 'de.richsource.gradle.plugins:gwt-gradle-plugin:0.6'
classpath 'com.android.tools.build:gradle:2.2.3'
classpath 'org.robovm:robovm-gradle-plugin:1.14.0'
}
}
allprojects {
apply plugin: "eclipse"
apply plugin: "idea"
version = '1.0'
ext {
appName = 'FPSCounter'
gdxVersion = '1.6.4'
roboVMVersion = '1.14.0'
box2DLightsVersion = '1.4'
ashleyVersion = '1.4.0'
aiVersion = '1.5.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"
}
}
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"
}
}
project(":ios") {
apply plugin: "java"
apply plugin: "robovm"
dependencies {
compile project(":core")
compile "org.robovm:robovm-rt:$roboVMVersion"
compile "org.robovm:robovm-cocoatouch:$roboVMVersion"
compile "com.badlogicgames.gdx:gdx-backend-robovm:$gdxVersion"
compile "com.badlogicgames.gdx:gdx-platform:$gdxVersion:natives-ios"
}
}
project(":html") {
apply plugin: "gwt"
apply plugin: "war"
dependencies {
compile project(":core")
compile "com.badlogicgames.gdx:gdx-backend-gwt:$gdxVersion"
compile "com.badlogicgames.gdx:gdx:$gdxVersion:sources"
compile "com.badlogicgames.gdx:gdx-backend-gwt:$gdxVersion:sources"
}
}
project(":core") {
apply plugin: "java"
dependencies {
compile "com.badlogicgames.gdx:gdx:$gdxVersion"
}
}
tasks.eclipse.doLast {
delete ".project"
}
build.gradle (core module):
apply plugin: "java"
sourceCompatibility = 1.6
[compileJava, compileTestJava]*.options*.encoding = 'UTF-8'
sourceSets.main.java.srcDirs = [ "src/" ]
eclipse.project {
name = appName + "-core"
}
build.gradle (desktop module):
apply plugin: "java"
sourceCompatibility = 1.6
sourceSets.main.java.srcDirs = [ "src/" ]
project.ext.mainClassName = "com.udacity.gamedev.fpscounter.desktop.DesktopLauncher"
project.ext.assetsDir = new File("../android/assets");
task run(dependsOn: classes, type: JavaExec) {
main = project.mainClassName
classpath = sourceSets.main.runtimeClasspath
standardInput = System.in
workingDir = project.assetsDir
ignoreExitValue = true
}
task dist(type: Jar) {
from files(sourceSets.main.output.classesDir)
from files(sourceSets.main.output.resourcesDir)
from {configurations.compile.collect {zipTree(it)}}
from files(project.assetsDir);
manifest {
attributes 'Main-Class': project.mainClassName
}
}
dist.dependsOn classes
eclipse {
project {
name = appName + "-desktop"
linkedResource name: 'assets', type: '2', location: 'PARENT-1-PROJECT_LOC/android/assets'
}
}
task afterEclipseImport(description: "Post processing after project generation", group: "IDE") {
doLast {
def classpath = new XmlParser().parse(file(".classpath"))
new Node(classpath, "classpathentry", [ kind: 'src', path: 'assets' ]);
def writer = new FileWriter(file(".classpath"))
def printer = new XmlNodePrinter(new PrintWriter(writer))
printer.setPreserveWhitespace(true)
printer.print(classpath)
}
}
build.gradle (android module):
android {
buildToolsVersion "25.0.2"
compileSdkVersion 25
sourceSets {
main {
manifest.srcFile 'AndroidManifest.xml'
java.srcDirs = ['src']
aidl.srcDirs = ['src']
renderscript.srcDirs = ['src']
res.srcDirs = ['res']
assets.srcDirs = ['assets']
jniLibs.srcDirs = ['libs']
}
instrumentTest.setRoot('tests')
}
}
// called every time gradle gets executed, takes the native dependencies of
// the natives configuration, and extracts them to the proper libs/ folders
// so they get packed with the APK.
task copyAndroidNatives() {
file("libs/armeabi/").mkdirs();
file("libs/armeabi-v7a/").mkdirs();
file("libs/x86/").mkdirs();
configurations.natives.files.each { jar ->
def outputDir = null
if(jar.name.endsWith("natives-armeabi-v7a.jar")) outputDir = file("libs/armeabi-v7a")
if(jar.name.endsWith("natives-armeabi.jar")) outputDir = file("libs/armeabi")
if(jar.name.endsWith("natives-x86.jar")) outputDir = file("libs/x86")
if(outputDir != null) {
copy {
from zipTree(jar)
into outputDir
include "*.so"
}
}
}
}
task run(type: Exec) {
def path
def localProperties = project.file("../local.properties")
if (localProperties.exists()) {
Properties properties = new Properties()
localProperties.withInputStream { instr ->
properties.load(instr)
}
def sdkDir = properties.getProperty('sdk.dir')
if (sdkDir) {
path = sdkDir
} else {
path = "$System.env.ANDROID_HOME"
}
} else {
path = "$System.env.ANDROID_HOME"
}
def adb = path + "/platform-tools/adb"
commandLine "$adb", 'shell', 'am', 'start', '-n', 'com.udacity.gamedev.fpscounter.android/com.udacity.gamedev.fpscounter.android.AndroidLauncher'
}
// sets up the Android Eclipse project, using the old Ant based build.
eclipse {
// need to specify Java source sets explicitely, SpringSource Gradle Eclipse plugin
// ignores any nodes added in classpath.file.withXml
sourceSets {
main {
java.srcDirs "src", 'gen'
}
}
jdt {
sourceCompatibility = 1.6
targetCompatibility = 1.6
}
classpath {
plusConfigurations += [ project.configurations.compile ]
containers 'com.android.ide.eclipse.adt.ANDROID_FRAMEWORK', 'com.android.ide.eclipse.adt.LIBRARIES'
}
project {
name = appName + "-android"
natures 'com.android.ide.eclipse.adt.AndroidNature'
buildCommands.clear();
buildCommand "com.android.ide.eclipse.adt.ResourceManagerBuilder"
buildCommand "com.android.ide.eclipse.adt.PreCompilerBuilder"
buildCommand "org.eclipse.jdt.core.javabuilder"
buildCommand "com.android.ide.eclipse.adt.ApkBuilder"
}
}
// sets up the Android Idea project, using the old Ant based build.
idea {
module {
sourceDirs += file("src");
scopes = [ COMPILE: [plus:[project.configurations.compile]]]
iml {
withXml {
def node = it.asNode()
def builder = NodeBuilder.newInstance();
builder.current = node;
builder.component(name: "FacetManager") {
facet(type: "android", name: "Android") {
configuration {
option(name: "UPDATE_PROPERTY_FILES", value:"true")
}
}
}
}
}
}
}
You probably are using a version of Gradle in the Gradle Wrapper that is too old to recognize JDK 10. When you run directly in Android Studio, it might be using its own Gradle version (I think there is a setting when importing a project that determines whether Android Studio will use the wrapped Gradle.)
So you can downgrade your JDK or upgrade your Gradle wrapper version. Downgrading the JDK is a pain because they've started removing older versions from the Sun download site. And you may have non-LibGDX stuff you want to work on with a newer JDK.
To upgrade the Gradle wrapper, open /gradle/wrapper/gradle-wrapper.properties and change the file name at the end to gradle-5.1.1-bin.zip. At least, that's what I use and it works up to JDK 12.
Then you need to replace the compile keywords in your build.gradle file with implementation. And in /desktop/build.gradle, change the line from files(sourceSets.main.output.classesDir) to from files(sourceSets.main.output.classesDirs) (add an s on the end).
I have got the following root build.gradle file:
buildscript {
repositories {
mavenCentral()
maven { url "https://oss.sonatype.org/content/repositories/snapshots/" }
}
dependencies {
classpath 'com.android.tools.build:gradle:2.1.3'
}
}
allprojects {
apply plugin: "eclipse"
apply plugin: "idea"
version = '1.0'
ext {
appName = "my_project"
gdxVersion = '1.5.4'
roboVMVersion = '1.12.0'
box2DLightsVersion = '1.3'
ashleyVersion = '1.7.0'
aiVersion = '1.8.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 fileTree(dir: '../libs', include: '*.jar')
}
}
project(":android") {
apply plugin: "android"
configurations { natives }
dependencies {
compile project(":core")
...
compile fileTree(dir: '../libs', include: '*.jar')
}
}
project(":core") {
apply plugin: 'scala'
apply plugin: "java"
apply plugin: 'idea'
dependencies {
...
compile fileTree(dir: '../libs', include: '*.jar')
}
}
and ones for each module:
core
//apply plugin: 'scala'
apply plugin: "java"
sourceCompatibility = 1.7
[compileScala, compileTestScala, compileJava, compileTestJava]*.options*.encoding = 'UTF-8'
sourceSets {
main {
scala.srcDirs = ['src/main/java']
java.srcDirs = []
}
test {
scala.srcDirs = ['src/test/java']
java.srcDirs = []
}
}
compileTestScala {
scalaCompileOptions.fork = true
scalaCompileOptions.forkOptions.jvmArgs = ['-XX:MaxPermSize=2048m']
scalaCompileOptions.additionalParameters = [
"-feature",
"-language:reflectiveCalls", // used for config structural typing
"-language:postfixOps"
]
}
eclipse.project {
name = appName + "-core"
}
dependencies {
}
desktop
apply plugin: "java"
sourceCompatibility = 1.7
//sourceCompatibility = JavaVersion.VERSION_1_8
//sourceSets.main.java.srcDirs = ["src/"]
sourceSets {
main {
java {
srcDirs = ["src/main/java"]
}
}
test {
java {
srcDirs = ["src/test/java"]
}
}
}
project.ext.mainClassName = "com.example.my_project.desktop.DesktopLauncher"
project.ext.assetsDir = new File("../android/assets");
task run(dependsOn: classes, type: JavaExec) {
main = project.mainClassName
classpath = sourceSets.main.runtimeClasspath
standardInput = System.in
workingDir = project.assetsDir
ignoreExitValue = true
}
task dist(type: Jar) {
from files(sourceSets.main.output.classesDir)
from files(sourceSets.main.output.resourcesDir)
from { configurations.compile.collect { zipTree(it) } }
from files(project.assetsDir);
manifest {
attributes 'Main-Class': project.mainClassName
}
}
dist.dependsOn classes
eclipse {
project {
name = appName + "-desktop"
linkedResource name: 'assets', type: '2', location: 'PARENT-1-PROJECT_LOC/android/assets'
}
}
task afterEclipseImport(description: "Post processing after project generation", group: "IDE") {
doLast {
def classpath = new XmlParser().parse(file(".classpath"))
new Node(classpath, "classpathentry", [kind: 'src', path: 'assets']);
def writer = new FileWriter(file(".classpath"))
def printer = new XmlNodePrinter(new PrintWriter(writer))
printer.setPreserveWhitespace(true)
printer.print(classpath)
}
}
dependencies {
}
android
android {
buildToolsVersion "23.0.3"
compileSdkVersion 23
sourceSets {
main {
manifest.srcFile 'AndroidManifest.xml'
java.srcDirs = ['src/main/java']
resources.srcDirs = ['src/main/resources']
aidl.srcDirs = ['src']
renderscript.srcDirs = ['src']
res.srcDirs = ['res']
assets.srcDirs = ['assets']
jniLibs.srcDirs = ['libs']
}
instrumentTest.setRoot('tests')
}
defaultConfig {
applicationId "com.example.my_project.android"
minSdkVersion 10
targetSdkVersion 23
multiDexEnabled true
}
dexOptions {
incremental true
javaMaxHeapSize "4g"
}
lintOptions {
abortOnError false
}
}
// called every time gradle gets executed, takes the native dependencies of
// the natives configuration, and extracts them to the proper libs/ folders
// so they get packed with the APK.
task copyAndroidNatives() {
file("libs/armeabi/").mkdirs();
file("libs/armeabi-v7a/").mkdirs();
file("libs/arm64-v8a/").mkdirs();
file("libs/x86_64/").mkdirs();
file("libs/x86/").mkdirs();
configurations.natives.files.each { jar ->
def outputDir = null
if (jar.name.endsWith("natives-arm64-v8a.jar")) outputDir = file("libs/arm64-v8a")
if (jar.name.endsWith("natives-armeabi-v7a.jar")) outputDir = file("libs/armeabi-v7a")
if (jar.name.endsWith("natives-armeabi.jar")) outputDir = file("libs/armeabi")
if (jar.name.endsWith("natives-x86_64.jar")) outputDir = file("libs/x86_64")
if (jar.name.endsWith("natives-x86.jar")) outputDir = file("libs/x86")
if (outputDir != null) {
copy {
from zipTree(jar)
into outputDir
include "*.so"
}
}
}
}
task run(type: Exec) {
def path
def localProperties = project.file("../local.properties")
if (localProperties.exists()) {
Properties properties = new Properties()
localProperties.withInputStream { instr ->
properties.load(instr)
}
def sdkDir = properties.getProperty('sdk.dir')
if (sdkDir) {
path = sdkDir
} else {
path = "$System.env.ANDROID_HOME"
}
} else {
path = "$System.env.ANDROID_HOME"
}
def adb = path + "/platform-tools/adb"
commandLine "$adb", 'shell', 'am', 'start', '-n', 'com.mygdx.game/com.mygdx.game.AndroidLauncher'
}
// sets up the Android Eclipse project, using the old Ant based build.
eclipse {
// need to specify Java source sets explicitly, SpringSource Gradle Eclipse plugin
// ignores any nodes added in classpath.file.withXml
sourceSets {
main {
java.srcDirs "src", 'gen'
}
}
jdt {
sourceCompatibility = 1.6
targetCompatibility = 1.6
}
classpath {
plusConfigurations += [project.configurations.compile]
containers 'com.android.ide.eclipse.adt.ANDROID_FRAMEWORK', 'com.android.ide.eclipse.adt.LIBRARIES'
}
project {
name = appName + "-android"
natures 'com.android.ide.eclipse.adt.AndroidNature'
buildCommands.clear();
buildCommand "com.android.ide.eclipse.adt.ResourceManagerBuilder"
buildCommand "com.android.ide.eclipse.adt.PreCompilerBuilder"
buildCommand "org.eclipse.jdt.core.javabuilder"
buildCommand "com.android.ide.eclipse.adt.ApkBuilder"
}
}
// sets up the Android Idea project, using the old Ant based build.
idea {
module {
sourceDirs += file("src");
scopes = [COMPILE: [plus: [project.configurations.compile]]]
iml {
withXml {
def node = it.asNode()
def builder = NodeBuilder.newInstance();
builder.current = node;
builder.component(name: "FacetManager") {
facet(type: "android", name: "Android") {
configuration {
option(name: "UPDATE_PROPERTY_FILES", value: "true")
}
}
}
}
}
}
}
dependencies {
}
On my windows machine it's built having all three modules - core, desktop and android, but on linux no modules is found in project structure, except the project root folder. What could be the reason why behavior is different depending on platform type?
i'm using:
idea 2016.3,
gradle 3.2.1 (for the project default gradle wrapper),
groovy 2.4.7,
jvm 1.7.0_80
The problem was that android sdk should had been setup beforehand.
I'm currently testing a game. But when I try to run the app on my device, it gives me this error:
I already tried cleaning the project, but the error stays.
Project:
buildscript {
repositories {
mavenLocal()
mavenCentral()
maven { url "https://oss.sonatype.org/content/repositories/snapshots/" }
}
dependencies {
classpath 'com.android.tools.build:gradle:2.1.3'
}
}
allprojects {
apply plugin: "eclipse"
apply plugin: "idea"
version = '1.0'
ext {
appName = "RocketHedgehog"
gdxVersion = '1.9.3'
roboVMVersion = '2.1.0'
box2DLightsVersion = '1.4'
ashleyVersion = '1.7.0'
aiVersion = '1.8.0'
}
repositories {
mavenLocal()
mavenCentral()
maven { url "https://oss.sonatype.org/content/repositories/snapshots/" }
maven { url "https://oss.sonatype.org/content/repositories/releases/" }
}
}
project(":android") {
apply plugin: "android"
configurations {
natives
all*.exclude group: 'com.android.support', module: 'support-v4'
}
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:$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-arm64-v8a"
natives "com.badlogicgames.gdx:gdx-box2d-platform:$gdxVersion:natives-x86"
natives "com.badlogicgames.gdx:gdx-box2d-platform:$gdxVersion:natives-x86_64"
compile "com.google.android.gms:play-services-ads:9.4.0"
compile "com.google.android.gms:play-services-games:9.6.1"
compile project(':BaseGameUtils')
compile 'com.android.support:multidex:1.0.1'
}
}
project(":core") {
apply plugin: "java"
dependencies {
compile "com.badlogicgames.gdx:gdx:$gdxVersion"
compile "com.badlogicgames.gdx:gdx-box2d:$gdxVersion"
}
}
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"
}
}
tasks.eclipse.doLast {
delete ".project"
}
BaseGameUtils: (Library) I needed this for implementing GPS
apply plugin: 'com.android.library'
buildscript {
repositories {
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:1.3.1'
}
}
dependencies {
// Set defaults so that BaseGameUtils can be used outside of BasicSamples
if (!project.hasProperty('appcompat_library_version')) {
ext.appcompat_library_version = '20.0.+'
}
if (!project.hasProperty('support_library_version')) {
ext.support_library_version = '20.0.+'
}
if (!project.hasProperty('gms_library_version')) {
ext.gms_library_version = '8.4.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}"
}
android {
// Set defaults so that BaseGameUtils can be used outside of BasicSamples
if (!project.hasProperty('android_compile_version')) {
ext.android_compile_version = 23
}
if (!project.hasProperty('android_min_version')) {
ext.android_min_version = 9
}
if (!project.hasProperty('android_version')) {
ext.build_tools_version = "23.0.2"
}
compileSdkVersion android_compile_version
buildToolsVersion build_tools_version
defaultConfig {
minSdkVersion android_min_version
targetSdkVersion android_compile_version
}
}
I would recommend you set a variable for the google services and make them all the same version.
For example, your BaseGameUtils uses 8.4.0 consistently, but your project is using various other versions (9.6.1 and 9.4.0)
ext {
appName = "RocketHedgehog"
gms_library_version = "8.4.0" // For consistency with library
Then, update these lines to use that variable.
compile "com.google.android.gms:play-services-ads:${gms_library_version}"
compile "com.google.android.gms:play-services-games:${gms_library_version}"
Error:
Error:Execution failed for task ':android:processDebugResources'.
com.android.ide.common.process.ProcessException: org.gradle.process.internal.ExecException: Process 'command 'D:\Android\sdk\build-tools\24.0.0\aapt.exe'' finished with non-zero exit value 1
What I've done, and that did not help:
I closed and opened AS, cleaning project and rebuilt.
full logs:
Information:Gradle tasks [clean, :android:generateDebugSources, :android:mockableAndroidJar, :android:prepareDebugUnitTestDependencies, :android:generateDebugAndroidTestSources]
:android:clean
:core:clean
:desktop:clean UP-TO-DATE
:ios:clean UP-TO-DATE
:android:preBuild UP-TO-DATE
:android:preDebugBuild UP-TO-DATE
:android:checkDebugManifest
:android:preReleaseBuild UP-TO-DATE
:core:compileJava
Warning:[options] bootstrap class path not set in conjunction with -source 1.6
1 warning
:core:processResources UP-TO-DATE
:core:classes
:core:jar
:android:prepareComAndroidSupportAnimatedVectorDrawable2411Library
:android:prepareComAndroidSupportAppcompatV72411Library
:android:prepareComAndroidSupportSupportV42411Library
:android:prepareComAndroidSupportSupportVectorDrawable2411Library
:android:prepareComGoogleAndroidGmsPlayServicesAds921Library
:android:prepareComGoogleAndroidGmsPlayServicesAdsLite921Library
:android:prepareComGoogleAndroidGmsPlayServicesBase921Library
:android:prepareComGoogleAndroidGmsPlayServicesBasement921Library
:android:prepareComGoogleAndroidGmsPlayServicesClearcut921Library
:android:prepareComGoogleAndroidGmsPlayServicesGass921Library
:android:prepareComGoogleAndroidGmsPlayServicesTasks921Library
:android:prepareComGoogleFirebaseFirebaseAds921Library
:android:prepareComGoogleFirebaseFirebaseAnalytics921Library
:android:prepareComGoogleFirebaseFirebaseAnalyticsImpl921Library
:android:prepareComGoogleFirebaseFirebaseCommon921Library
:android:prepareComGoogleFirebaseFirebaseCore921Library
:android:prepareComGoogleFirebaseFirebaseIid921Library
:android:prepareDebugDependencies
:android:compileDebugAidl
:android:compileDebugRenderscript
:android:generateDebugBuildConfig
:android:mergeDebugShaders
:android:compileDebugShaders
:android:generateDebugAssets
:android:mergeDebugAssets
:android:generateDebugResValues UP-TO-DATE
:android:processDebugGoogleServices
Parsing json file: D:\Android Project\LibGdx\MaGame\android\google-services.json
:android:generateDebugResources
:android:mergeDebugResources
:android:processDebugManifest
:android:processDebugResources FAILED
Error:Execution failed for task ':android:processDebugResources'.
> com.android.ide.common.process.ProcessException: org.gradle.process.internal.ExecException: Process 'command 'D:\Programm\android-studio\sdk\build-tools\23.0.3\aapt.exe'' finished with non-zero exit value 1
Information:BUILD FAILED
Information:Total time: 10.08 secs
Information:1 error
Information:1 warning
Information:See complete output in console
Gradle-android:
android {
buildToolsVersion '23.0.0'
compileSdkVersion 23
sourceSets {
main {
manifest.srcFile 'AndroidManifest.xml'
java.srcDirs = ['src']
aidl.srcDirs = ['src']
renderscript.srcDirs = ['src']
res.srcDirs = ['res']
assets.srcDirs = ['assets']
jniLibs.srcDirs = ['libs']
}
instrumentTest.setRoot('tests')
}
defaultConfig {
applicationId "upwardteam.pavel.game"
minSdkVersion 9
targetSdkVersion 23
}
dexOptions {
javaMaxHeapSize "4g"
}
lintOptions {
checkReleaseBuilds false
}
}
dependencies {
compile fileTree(include: ['*.jar'], dir: 'libs')
//noinspection GradleCompatible
compile 'com.android.support:appcompat-v7:23.0.0'
compile 'com.google.firebase:firebase-ads:9.2.1'
}
apply plugin: 'com.google.gms.google-services'
// called every time gradle gets executed, takes the native dependencies of
// the natives configuration, and extracts them to the proper libs/ folders
// so they get packed with the APK.
task copyAndroidNatives() {
file("libs/armeabi/").mkdirs();
file("libs/armeabi-v7a/").mkdirs();
file("libs/arm64-v8a/").mkdirs();
file("libs/x86_64/").mkdirs();
file("libs/x86/").mkdirs();
configurations.natives.files.each { jar ->
def outputDir = null
if (jar.name.endsWith("natives-arm64-v8a.jar")) outputDir = file("libs/arm64-v8a")
if (jar.name.endsWith("natives-armeabi-v7a.jar")) outputDir = file("libs/armeabi-v7a")
if (jar.name.endsWith("natives-armeabi.jar")) outputDir = file("libs/armeabi")
if (jar.name.endsWith("natives-x86_64.jar")) outputDir = file("libs/x86_64")
if (jar.name.endsWith("natives-x86.jar")) outputDir = file("libs/x86")
if (outputDir != null) {
copy {
from zipTree(jar)
into outputDir
include "*.so"
}
}
}
}
task run(type: Exec) {
def path
def localProperties = project.file("../local.properties")
if (localProperties.exists()) {
Properties properties = new Properties()
localProperties.withInputStream { instr ->
properties.load(instr)
}
def sdkDir = properties.getProperty('sdk.dir')
if (sdkDir) {
path = sdkDir
} else {
path = "$System.env.ANDROID_HOME"
}
} else {
path = "$System.env.ANDROID_HOME"
}
def adb = path + "/platform-tools/adb"
commandLine "$adb", 'shell', 'am', 'start', '-n', 'upwardteam.pavel.game/upwardteam.pavel.game.AndroidLauncher'
}
// sets up the Android Eclipse project, using the old Ant based build.
eclipse {
// need to specify Java source sets explicitly, SpringSource Gradle Eclipse plugin
// ignores any nodes added in classpath.file.withXml
sourceSets {
main {
java.srcDirs "src", 'gen'
}
}
jdt {
sourceCompatibility = 1.6
targetCompatibility = 1.6
}
classpath {
plusConfigurations += [project.configurations.compile]
containers 'com.android.ide.eclipse.adt.ANDROID_FRAMEWORK', 'com.android.ide.eclipse.adt.LIBRARIES'
}
project {
name = appName + "-android"
natures 'com.android.ide.eclipse.adt.AndroidNature'
buildCommands.clear();
buildCommand "com.android.ide.eclipse.adt.ResourceManagerBuilder"
buildCommand "com.android.ide.eclipse.adt.PreCompilerBuilder"
buildCommand "org.eclipse.jdt.core.javabuilder"
buildCommand "com.android.ide.eclipse.adt.ApkBuilder"
}
}
// sets up the Android Idea project, using the old Ant based build.
idea {
module {
sourceDirs += file("src");
scopes = [COMPILE: [plus: [project.configurations.compile]]]
iml {
withXml {
def node = it.asNode()
def builder = NodeBuilder.newInstance();
builder.current = node;
builder.component(name: "FacetManager") {
facet(type: "android", name: "Android") {
configuration {
option(name: "UPDATE_PROPERTY_FILES", value: "true")
}
}
}
}
}
}
}
apply plugin: 'com.google.gms.google-services'
android:processDebugResources FAILED
Means one of your XML resources is not correct.
There is a Gradle lint task that may help with that.
The Gradle panel of Android Studio should be on the right side of the screen.