FrogSquare / GodotGoogleService

Google play service, login, achievements, leaderboard.
Apache License 2.0
105 stars 14 forks source link

I can't seem to compile godot 3.1.1 I get error Task :compileDebugJavaWithJavac FAILED #23

Closed osimuka closed 5 years ago

osimuka commented 5 years ago

{HOME}/godot-3.1.1-stable/platform/android/java/src/org/godotengine/godot/Godot.java:62: error: package android.support.v4.content does not exist import android.support.v4.content.ContextCompat; ^ {HOME}/godot-3.1.1-stable/platform/android/java/src/com/google/android/vending/expansion/downloader/impl/DownloadNotification.java:30: error: cannot find symbol import android.support.v4.app.NotificationCompat;

FlavioFS commented 5 years ago

I went through this problem already, but I don't remember exactly its details. I think it is the google-services.json, do you have it already under GODOT_ROOT/platform/android/java?

You'll probably need to link your app to Firebase Console and get the google-services.json from there.

osimuka commented 5 years ago

Hi Flávio,

Yes I have it ready inside /java directory, I have the app running already. But just migrating to godot 3.1.1 and with Google Plays new rule for 64bit games.

Can you think of any other case?

Cheers

On Fri, 2 Aug 2019 at 18:03, Flávio Freitas notifications@github.com wrote:

I went through this problem already, but I don't remember exactly its details. I think it is the google-services.json, do you have it already under GODOT_ROOT/platform/android/java?

You'll probably need to link your app to Firebase Console https://console.firebase.google.com/ and get the google-services.json from there.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/FrogSquare/GodotGoogleService/issues/23?email_source=notifications&email_token=AGZZ46PUWVXXXRVEF3F2ZFTQCRSFBA5CNFSM4IIVW7Z2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOD3OKA4Y#issuecomment-517775475, or mute the thread https://github.com/notifications/unsubscribe-auth/AGZZ46JFAYHJ5YUCC2XKO43QCRSFBANCNFSM4IIVW7ZQ .

FlavioFS commented 5 years ago

Could it be the versions in build.gradle file? Like compileSdkVersion?
I remember I've edited some Python files and the build.gradle in my projects.

osimuka commented 5 years ago

What compile sdk version are you using? And what java version are you using. I’m using java 8

On Fri, 2 Aug 2019 at 18:19, Flávio Freitas notifications@github.com wrote:

Could it be the versions in build.gradle file? Like compileSdkVersion? I remember I've edited some Python files and the build.gradle in my projects.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/FrogSquare/GodotGoogleService/issues/23?email_source=notifications&email_token=AGZZ46IUWRIKPLI5XZJ43MLQCRUATA5CNFSM4IIVW7Z2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOD3OLHSY#issuecomment-517780427, or mute the thread https://github.com/notifications/unsubscribe-auth/AGZZ46LK2AZFLLE4IRJG253QCRUATANCNFSM4IIVW7ZQ .

FlavioFS commented 5 years ago

Another common issue is trying to update JDK past 8, which does not work. image

FlavioFS commented 5 years ago

What compile sdk version are you using? And what java version are you using. I’m using java 8

I don't have access to my compile version right now, but I'll reply this later (probably tonight).

FlavioFS commented 5 years ago

What's in your build.gradle?

osimuka commented 5 years ago

I don’t have access to it now but will send it to you tonight aswell. Thanks

On Fri, 2 Aug 2019 at 18:27, Flávio Freitas notifications@github.com wrote:

What's in your build.gradle?

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/FrogSquare/GodotGoogleService/issues/23?email_source=notifications&email_token=AGZZ46P3UG22O4QMLRAQ2MDQCRVAXA5CNFSM4IIVW7Z2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOD3OL4II#issuecomment-517783073, or mute the thread https://github.com/notifications/unsubscribe-auth/AGZZ46IJ2XDAO2IEQMGOWGDQCRVAXANCNFSM4IIVW7ZQ .

osimuka commented 5 years ago
buildscript {
    repositories {
        google()
        jcenter()
            maven {
    url 'https://maven.google.com'
    }
    maven {
    url 'https://oss.sonatype.org/content/repositories/snapshots'
    }

    }
    dependencies {
        classpath 'com.android.tools.build:gradle:3.4.2'
                classpath "com.google.gms:google-services:4.1.0"

    }
}

apply plugin: 'com.android.application'

allprojects {
    repositories {
    mavenCentral()
    google()
    jcenter()
        maven {
    url 'https://maven.google.com'
    }
    maven {
    url 'https://oss.sonatype.org/content/repositories/snapshots'
    }

    }
}

dependencies {
    implementation "com.android.support:support-core-utils:28.0.0"
    implementation('com.android.support:support-fragment:28.0.0')
    implementation('com.google.android.gms:play-services-auth:16.0.1'){exclude group: 'com.android.support' exclude module: 'support-v4'}
    implementation('com.google.android.gms:play-services-games:16.0.0'){exclude group: 'com.android.support' exclude module: 'support-v4'}
    implementation('com.google.firebase:firebase-invites:16.1.0'){exclude group: 'com.android.support' exclude module: 'support-v4'}
    implementation('com.google.android.gms:play-services-ads:+')

}

android {

    lintOptions {
        abortOnError false
        disable 'MissingTranslation','UnusedResources'
    }

    compileSdkVersion 29
    buildToolsVersion "29.0.0"
    useLibrary 'org.apache.http.legacy'

    packagingOptions {
        exclude 'META-INF/LICENSE'
        exclude 'META-INF/NOTICE'
    }
    defaultConfig {
        applicationId 'com.example.game'
        minSdkVersion 18
        targetSdkVersion 28

    }
    // Both signing and zip-aligning will be done at export time
    buildTypes.all { buildType ->
        buildType.zipAlignEnabled false
        buildType.signingConfig null
    }
    sourceSets {
        main {
            manifest.srcFile 'AndroidManifest.xml'
            java.srcDirs = ['src'
                ,'/<path>/modules/GodotGoogleService/android','/<path>/godot-3.1.1-stable/modules/GodotGoogleService/frogutils','/<path>/godot-3.1.1-stable/modules/admob/android'
            ]
            res.srcDirs = [
                'res'
                ,'/<path>/godot-3.1.1-stable/modules/GodotGoogleService/res'
            ]
            aidl.srcDirs = [
                'aidl'

            ]
            assets.srcDirs = [
                'assets'

            ]
        }
        debug.jniLibs.srcDirs = [
            'libs/debug'

        ]
        release.jniLibs.srcDirs = [
            'libs/release'

        ]
    }

    applicationVariants.all { variant ->
        variant.outputs.all { output ->
            output.outputFileName = "../../../../../../../bin/android_${variant.name}.apk"
        }
    }
}

apply plugin: "com.google.gms.google-services"
com.google.gms.googleservices.GoogleServicesPlugin.config.disableVersionCheck = true
FlavioFS commented 5 years ago

Mine is like this:

(...)

dependencies {
    implementation "com.android.support:support-core-utils:28.0.0"
    implementation ('com.google.android.gms:play-services-ads:16.0.0') { exclude group: 'com.android.support' exclude module: 'support-v4'}
    implementation('com.android.support:support-fragment:28.0.0')
    implementation('com.google.android.gms:play-services-auth:16.0.1'){exclude group: 'com.android.support' exclude module: 'support-v4'}
    implementation('com.google.android.gms:play-services-games:16.0.0'){exclude group: 'com.android.support' exclude module: 'support-v4'}
    implementation('com.google.firebase:firebase-invites:16.1.0'){exclude group: 'com.android.support' exclude module: 'support-v4'}

}

android {

    lintOptions {
        abortOnError false
        disable 'MissingTranslation','UnusedResources'
    }

    compileSdkVersion 28
    buildToolsVersion "28.0.3"
    useLibrary 'org.apache.http.legacy'

    packagingOptions {
        exclude 'META-INF/LICENSE'
        exclude 'META-INF/NOTICE'
    }
    defaultConfig {
        applicationId 'com.melonsoda.test'
        minSdkVersion 18
        targetSdkVersion 28

    }
(...)
}
osimuka commented 5 years ago

the error seems to be pointing to:

{GodotRoot}/platform/android/java/src/debug/java', not found
{GodotRoot}/platform/android/java/build/generated/renderscript_source_output_dir/debug/compileDebugRenderscript/out', not found
osimuka commented 5 years ago

Mine is like this:

(...)

dependencies {
  implementation "com.android.support:support-core-utils:28.0.0"
  implementation ('com.google.android.gms:play-services-ads:16.0.0') { exclude group: 'com.android.support' exclude module: 'support-v4'}
  implementation('com.android.support:support-fragment:28.0.0')
  implementation('com.google.android.gms:play-services-auth:16.0.1'){exclude group: 'com.android.support' exclude module: 'support-v4'}
  implementation('com.google.android.gms:play-services-games:16.0.0'){exclude group: 'com.android.support' exclude module: 'support-v4'}
  implementation('com.google.firebase:firebase-invites:16.1.0'){exclude group: 'com.android.support' exclude module: 'support-v4'}

}

android {

  lintOptions {
      abortOnError false
      disable 'MissingTranslation','UnusedResources'
  }

  compileSdkVersion 28
  buildToolsVersion "28.0.3"
  useLibrary 'org.apache.http.legacy'

  packagingOptions {
      exclude 'META-INF/LICENSE'
      exclude 'META-INF/NOTICE'
  }
  defaultConfig {
      applicationId 'com.melonsoda.test'
      minSdkVersion 18
      targetSdkVersion 28

  }
(...)
}

What sdk and ndk do you use maybe thats why mine is still breaking because my configs for the build file are thesame as yours

kings2000 commented 5 years ago

@osimuka i used Godot 3.1.1 stable from the Godot release packages

your gradle.properties should have only this

org.gradle.jvmargs=-Xmx1536m

if so try downloading the Godot 3.1.1 stable again and put in the modules..

this is my gradle classpath dependencies

dependencies { classpath 'com.android.tools.build:gradle:3.3.0' classpath "com.google.gms:google-services:4.1.0" }

and the package dependencies

dependencies { implementation "com.android.support:support-core-utils:28.0.0" implementation('com.android.support:support-fragment:28.0.0') implementation('com.google.android.gms:play-services-auth:16.0.1'){exclude group: 'com.android.support' exclude module: 'support-v4'} implementation('com.google.android.gms:play-services-games:16.0.0'){exclude group: 'com.android.support' exclude module: 'support-v4'} implementation('com.google.firebase:firebase-invites:16.1.0'){exclude group: 'com.android.support' exclude module: 'support-v4'} implementation ('com.google.android.gms:play-services-ads:16.0.0') { exclude group: 'com.android.support' }

}

osimuka commented 5 years ago