Quick Links: Download Gideros Studio | Gideros Documentation | Gideros community chat | DONATE
Android studio google play services — Gideros Forum

Android studio google play services

billydbbillydb Member
edited July 2016 in General questions
Can anyone help me with this crash when trying to run an app from android studio. I've been trying to get leaderboards and ads working in my app with the ads interface and gaming plugins. Currently I'm getting this:

FATAL EXCEPTION: main
Process: com.JetSplat.JohnNightingale, PID: 2704
java.lang.UnsatisfiedLinkError: com.android.tools.fd.runtime.IncrementalClassLoader$DelegateClassLoader[DexPathList[[dex file "/data/data/com.JetSplat.JohnNightingale/files/instant-run/dex/slice-support-annotations-23.0.0_aa7ee2d99964bd993000219d00bcf11d8274067a-classes.dex", dex file "/data/data/com.JetSplat.JohnNightingale/files/instant-run/dex/slice-slice_9-classes.dex", dex file "/data/data/com.JetSplat.JohnNightingale/files/instant-run/dex/slice-slice_8-classes.dex", dex file "/data/data/com.JetSplat.JohnNightingale/files/instant-run/dex/slice-slice_7-classes.dex", dex file "/data/data/com.JetSplat.JohnNightingale/files/instant-run/dex/slice-slice_6-classes.dex", dex file "/data/data/com.JetSplat.JohnNightingale/files/instant-run/dex/slice-slice_5-classes.dex", dex file "/data/data/com.JetSplat.JohnNightingale/files/instant-run/dex/slice-slice_4-classes.dex", dex file "/data/data/com.JetSplat.JohnNightingale/files/instant-run/dex/slice-slice_3-classes.dex", dex file "/data/data/com.JetSplat.JohnNightingale/files/instant-run/dex/slice-slice_2-classes.dex", dex file "/data/data/com.JetSplat.JohnNightingale/files/instant-run/dex/slice-slice_1-classes.dex", dex file "/data/data/com.JetSplat.JohnNightingale/files/instant-run/dex/slice-slice_0-classes.dex", dex file "/data/data/com.JetSplat.JohnNightingale/files/instant-run/dex/slice-internal_impl-23.0.0_9467cb7e14cfb462c2b4b7dde329a07b289c978f-classes.dex", dex file "/data/data/com.JetSplat.JohnNightingale/files/instant-run/dex/slice-internal_impl-23.0.0_87df0418bcc49851758287b6767000c3f18a65d0-classes.dex", dex file "/data/data/com.JetSplat.JohnNightingale/files/instant-run/dex/slice-gideros_319c0004405d7e2a34a0cce00fe5de4111183936-classes.dex", dex file "/data/data/com.JetSplat.JohnNightingale/files/instant-run/dex/slice-com.google.firebase-firebase-storage-common-9.2.0_d8c0be3722b5ccb0ab6ff15de8e3e8558e8f2ba2-classes.dex", dex file "/data/data/com.JetSplat.JohnNightingale/files/instant-run/dex/slice-com.google.firebase-firebase-storage-9.2.0_2f988e52efc0c0aed0473e3b73111ba619f95ab8-classes.dex", dex file "/data/data/com.JetSplat.JohnNightingale/files/instant-run/dex/slice-com.google.firebase-firebase-messaging-9.2.0_9d3296c8c9008104f01c50590e202f0df90eff8c-classes.dex", dex file "/data/data/com.JetSplat.JohnNightingale/files/instant-run/dex/slice-com.google.firebase-firebase-iid-9.2.0_e4dcf17e36024ffdab444a34f8ad9975ba779b23-classes.dex", dex file "/data/data/com.JetSplat.JohnNightingale/files/instant-run/dex/slice-com.google.firebase-firebase-database-connection-9.2.0_903f7fb662a3c0712e5a0ceb39b0e53994d74d78-classes.dex", dex file "/data/data/com.JetSplat.JohnNightingale/files/instant-run/dex/slice-com.google.firebase-firebase-database-9.2.0_de007e51890b9f20b0731c9bfff7136c0a38b6fd-classes.dex", dex file "/data/data/com.JetSplat.JohnNightingale/files/instant-run/dex/slice-com.google.firebase-firebase-crash-9.2.0_fa84c7c5120ba39c7b766d95d20f1db2ab876729-classes.dex", dex file "/data/data/com.JetSplat.JohnNightingale/files/instant-run/dex/slice-com.google.firebase-firebase-config-9.2.0_96a12e09843789042fdbe835d9ec129187676c77-classes.dex", dex file "/data/data/com.JetSplat.JohnNightingale/files/instant-run/dex/slice-com.google.firebase-firebase-common-9.2.0_28b03c9ac8648fde5f0c53cd2b3ce3720e93efa5-classes.dex", dex file "/data/data/com.JetSplat.JohnNightingale/files/instant-run/dex/slice-com.google.firebase-firebase-auth-module-9.2.0_74fa3d5ac55fd7ef9c455879fc4126683b4beae4-classes.dex", dex file "/data/data/com.JetSplat.JohnNightingale/files/instant-run/dex/slice-com.google.firebase-firebase-auth-common-9.2.0_1a3e958a12770f5e28b9900099a924a372febd08-classes.dex", dex file "/data/data/com.JetSplat.JohnNightingale/files/instant-run/dex/slice-com.google.firebase-firebase-auth-9.2.0_e5ffe83273412802c54bbccd8269432faac7556d-classes.dex", dex file "/data/data/com.JetSplat.JohnNightingale/files/instant-run/dex/slice-com.google.firebase-firebase-analytics-impl-9.2.0_46d


I've tried my best to setup the gaming plugin.

Firstly a lot of people seem to say you import the project and not open an existing one. I tried importing but it just gave a ton of errors. When I open instead it seems to work but only after making you update the Gradle thingy.

Next up was the sdk version, which I now have at 23 and the dependencies bit I have as compile 'com.google.android.gms:play-services:9.2.0' and in the sdk manager I have Marshmallow installed (API 23). This seems to have stopped a whole bunch of errors so I assume this is good.

I have the leaderboards and everything setup on the google developer site and authenticated the app using SHA1 which I found in the signingReport bit in the Gradle projects window.

I just discovered something about a google-services.json which I've downloaded and copied into the app folder (although it doesn't show in android studio). My guess is this is related to the crash.

The activity.java file has System.loadLibrary("gaming"); and and in externalClasses "com.giderosmobile.android.plugins.gaming.Game".

I copied the ids.xml into the res/values folder and pasted the apps id into it.

And of course copied the com folder into the src folder from the gaming plugin.

I'm willing to bet there are a bunch more steps I've missed but I can't cope with this insanity anymore so thought I would plead for help :)
«13

Comments

  • antixantix Member
    @billydb, you aren't alone. I'm having pretty much the same problems as you, see my thread http://giderosmobile.com/forum/discussion/6546/google-play-services-not-working#Item_19

    Hopefully we can get a solution :)
  • ar2rsawseenar2rsawseen Maintainer
    I don't know is it because of Android Studio, but those errors just does not make any sense
  • Apparently this makes a difference if put in the Gradle Module file under

    sourceSets {
    main {
    jni.srcDirs = []
    jniLibs.srcDir 'src/main/jniLibs'
    }
    }

    It ran on emulator for the first time! yay!

    So my " build.gradle (Module:app)" file now looks like:


    apply plugin: 'com.android.application'
    android {
    compileSdkVersion 23
    buildToolsVersion "22.0.0"

    defaultConfig {
    applicationId "com.JetSplat.JohnNightingale"
    minSdkVersion 9
    targetSdkVersion 23
    }

    buildTypes {
    release {
    minifyEnabled false
    proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.txt'
    }
    }
    sourceSets {
    main {
    jni.srcDirs = []
    jniLibs.srcDir 'src/main/jniLibs'
    }
    }
    }

    dependencies {
    compile files('libs/gideros.jar')
    compile files('libs/applovin-sdk-6.0.0.jar')
    compile files('libs/vungle-publisher-adaptive-id-3.3.5.jar')
    compile files('libs/javax.inject-1.jar')
    compile files('libs/dagger-2.1.jar')
    }



    I did however remove all the gaming plugin stuff so will test that next. Also don't know if ads will play yet, will have to try on a real device and get google play integrated somehow :) Thanks for the help will keep you posted.

    Likes: pie

    +1 -1 (+1 / -0 )Share on Facebook
  • antixantix Member
    edited July 2016
    Edit: oops
  • Just a quick note. I tried with the gaming plugin setup and still no joy. I think because the GameHelper is no longer used, nit I don't know how to get around that. I tried the modified GameHelper from your thread antix but still no luck, possibly because that was setup for Eclipse?

    I think I will have to give up on leaderboards and hope the ads work until there is an update to the plugin.
  • antixantix Member
    @billydb, I'm still looking for a solution. I think I may have to resort to installing Eclipse to get it working now.
  • hgy29hgy29 Maintainer
    Finally I am switching to android studio :) maybe I'll be able to help on these topics in the future
    +1 -1 (+4 / -0 )Share on Facebook
  • SinisterSoftSinisterSoft Maintainer
    I'll switch from Eclipse maybe after the summer.

    Likes: antix

    Coder, video game industry veteran (since the '80s, ❤'s assembler), arrested - never convicted hacker (in the '90s), dad of five, he/him (if that even matters!).
    https://deluxepixel.com
    +1 -1 (+1 / -0 )Share on Facebook
  • Quick / dumb question, in the install instructions for the gaming plugin it says:

    You must install each framework you want to use based on their instalation instructions (usually by adding .jar file to project and modifying AndroidManifest file)

    Does this mean I should do the install for the googleplay plugin too? As in adding the GGooglePlay.java and the exta bits to the manifest? I'm guessing not as the gaming plugin has it's own GameGoogleplay.java file, which leaves me wondering what it means?
  • #=%"#€(&€RWIOYU)%€#"U)=€ IT WOOOOORRRRKSSSSSSS!!!!!!!

    @antix I will do write up of what I did, although I'm not 100% sure
  • In my activity file under dependencies I have :

    dependencies {
    compile files('libs/gideros.jar')
    compile 'com.google.android.gms:play-services:7.8.0'
    compile files('libs/applovin-sdk-6.0.0.jar')
    compile files('libs/dagger-2.1.jar')
    compile files('libs/javax.inject-1.jar')
    compile files('libs/vungle-publisher-adaptive-id-3.3.5.jar')
    }

    So using an old google play lib: 'com.google.android.gms:play-services:7.8.0'
  • The others were for applovin ads and vungle ads.

    Actually I'll just show the whole thing


    apply plugin: 'com.android.application'
    android {
    compileSdkVersion 21
    buildToolsVersion "21.0.0"

    defaultConfig {
    applicationId "com.JetSplat.JohnNightingale"
    minSdkVersion 9
    targetSdkVersion 21
    }

    buildTypes {
    release {
    minifyEnabled false
    proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.txt'
    }
    }
    sourceSets {
    main {
    jni.srcDirs = []
    jniLibs.srcDir 'src/main/jniLibs'
    }
    }
    }

    dependencies {
    compile files('libs/gideros.jar')
    compile 'com.google.android.gms:play-services:7.8.0'
    compile files('libs/applovin-sdk-6.0.0.jar')
    compile files('libs/dagger-2.1.jar')
    compile files('libs/javax.inject-1.jar')
    compile files('libs/vungle-publisher-adaptive-id-3.3.5.jar')
    }




    So sdk version 21 and minSdkVersion 9

    note the weird

    sourceSets {
    main {
    jni.srcDirs = []
    jniLibs.srcDir 'src/main/jniLibs'
    }
    }

    this fixed a problem with it not finding .so files in my jnLibs dir
  • Oh I forgot to mention this is setting up the gaming plugin rather than the stand alone google play. As far as I know it does the same thing.

    Ah crap and that was supposed to be the build.gradle (Module: app) file not the activity file, sorry this is a mess but hopefully someone will get what I mean :)
  • Something also not clear from the install instructions was the .so files.

    They are tucked away in /Applications/Gideros Studio/All Plugins/gaming/bin/Android/libs

    Copy each version of the libgaming.so to your projects jnLibs/armeabi, jnLibs/armeabi-v7a and jnLibs/x86
  • Also copy the ids.xml from
    /Applications/Gideros Studio/All Plugins/gaming/bin/Android/res/values
    to
    /app/src/main/res/values
    or wherever your res/values folder is for your project

    and replace the id number with the one from your google app id
  • The AndroidManifest.xml was the last stumbling block for me.

    Add this just above







    I think one of those APP_ID things is redundant as it was borked before I added the 2nd one but I'm leaving cos it works:)
  • Ah crap, no good at formatting this stuff, will attach a pic
  • <meta-data android:name="com.google.android.gms.games.APP_ID"
                android:value="<a href="https://forum.giderosmobile.com/profile/string%2Fapp_id%26quot" rel="nofollow">@string/app_id&quot</a>; />
            <meta-data android:name="com.google.android.gms.appstate.APP_ID" android:value="<a href="https://forum.giderosmobile.com/profile/string%2Fapp_id%26quot" rel="nofollow">@string/app_id&quot</a>; />
            <meta-data android:name="com.google.android.gms.version"
                android:value="<a href="https://forum.giderosmobile.com/profile/integer%2Fgoogle_play_services_version%26quot" rel="nofollow">@integer/google_play_services_version&quot</a>;/>
    Ok finally figured out adding code :) Sorry doing this in a rush.
  • And just for clarity the build.gradle (Module: app) file again:
    apply plugin: 'com.android.application'
    android {
        compileSdkVersion 21
        buildToolsVersion "21.0.0"
     
        defaultConfig {
            applicationId "com.JetSplat.JohnNightingale"
            minSdkVersion 9
            targetSdkVersion 21
        }
     
        buildTypes {
            release {
                minifyEnabled false
                proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.txt'
            }
        }
        sourceSets {
            main {
                jni.srcDirs = []
                jniLibs.srcDir 'src/main/jniLibs'
            }
        }
    }
     
    dependencies {
        compile files('libs/gideros.jar')
        compile 'com.google.android.gms:play-services:7.8.0'
        compile files('libs/applovin-sdk-6.0.0.jar')
        compile files('libs/dagger-2.1.jar')
        compile files('libs/javax.inject-1.jar')
        compile files('libs/vungle-publisher-adaptive-id-3.3.5.jar')
    }
  • antixantix Member
    @billydb, great work man, I'd never figure that stuff out by myself.

    So how the hell do you use it? I tried
    require "gaming"
    googleplay = Gaming.new("googleplay")
    When I try to debug on the device I get a crash
    07-09 08:29:04.942 15898-16091/com.jenots.playtest E/AndroidRuntime: FATAL EXCEPTION: GLThread 710
    Process: com.jenots.playtest, PID: 15898
    com.giderosmobile.android.player.LuaException: C:/Projects/Android Studio/GooglePlayTest/app/src/main/assets/assets/main.lua.jet:21: module 'gaming' not found:
    	no field package.preload['gaming']
    	no file './gaming.lua'
    	no file '/usr/local/share/lua/5.1/gaming.lua'
    	no file '/usr/local/share/lua/5.1/gaming/init.lua'
    	no file '/usr/local/lib/lua/5.1/gaming.lua'
    	no file '/usr/local/lib/lua/5.1/gaming/init.lua'
    	no file './gaming.so'
    	no file '/usr/local/lib/lua/5.1/gaming.so'
    	no file '/usr/local/lib/lua/5.1/loadall.so'
    This (for me) is getting closer because it is not actually having those stupid link related crashes now.

    Anyone know how to use the gaming plugin and can post an example project please?
  • jdbcjdbc Member
    @billydb, great work man, I'd never figure that stuff out by myself.

    So how the hell do you use it? I tried
    require "gaming"
    googleplay = Gaming.new("googleplay")
    When I try to debug on the device I get a crash
    07-09 08:29:04.942 15898-16091/com.jenots.playtest E/AndroidRuntime: FATAL EXCEPTION: GLThread 710
    Process: com.jenots.playtest, PID: 15898
    com.giderosmobile.android.player.LuaException: C:/Projects/Android Studio/GooglePlayTest/app/src/main/assets/assets/main.lua.jet:21: module 'gaming' not found:
    	no field package.preload['gaming']
    	no file './gaming.lua'
    	no file '/usr/local/share/lua/5.1/gaming.lua'
    	no file '/usr/local/share/lua/5.1/gaming/init.lua'
    	no file '/usr/local/lib/lua/5.1/gaming.lua'
    	no file '/usr/local/lib/lua/5.1/gaming/init.lua'
    	no file './gaming.so'
    	no file '/usr/local/lib/lua/5.1/gaming.so'
    	no file '/usr/local/lib/lua/5.1/loadall.so'
    This (for me) is getting closer because it is not actually having those stupid link related crashes now.

    Anyone know how to use the gaming plugin and can post an example project please?
    It seems you do not have libgaming.so in the lib folder.
  • antixantix Member
    edited July 2016
    @jdbc hmm, the .so files are there.

    However I forgot to add the stuff in the main activity. I forget this a bit because whenever I export, it gets overwritten :(

    But it works!!

    It logged in and failed because there are other internal things I haven't done yet. I think I just need to use the correct app id and package name to connect fully.

    Thanks to all who have assisted, you are amazing!
    its there.png
    866 x 804 - 73K
    its there again.png
    820 x 1040 - 119K
  • jdbcjdbc Member
    edited July 2016
    Now you have to follow Android Google Play Services development guide.

    I guess you will need to define some meta-data in AndroidManifest file.

    Likes: antix

    +1 -1 (+1 / -0 )Share on Facebook
  • @antix glad you got it working. Just a quick note don't forget to check the tickbox export assets only once youve setup the android studio stuff. Means you can keep editing in gideros and not overwrite you AS setup.

    Likes: antix

    +1 -1 (+1 / -0 )Share on Facebook
  • antixantix Member
    @billydb oh. so when you select "export assets only" it also considers your lua code as an asset? If so then that could be clearer. I thought it was purely exporting sounds graphics, and stuff like that.
  • SinisterSoftSinisterSoft Maintainer
    it means the assets folder + the actual gideros main lib as that contains the crypt key.
    Coder, video game industry veteran (since the '80s, ❤'s assembler), arrested - never convicted hacker (in the '90s), dad of five, he/him (if that even matters!).
    https://deluxepixel.com
  • antixantix Member
    I hope to create a tutorial and example project based by this thread next week.
    +1 -1 (+4 / -0 )Share on Facebook
  • talistalis Guru
    edited July 2016
    @antix first of all i am happy you cleared it out. And will be more than perfect to make a tutorial of google play services for android studio. I am sure lots of people will be gratefull like me for instance :)
  • hgy29hgy29 Maintainer
    @antix, if you ever do a tutorial, I'll use it to write a script for future automatic integration of play services for android studio
    +1 -1 (+4 / -0 )Share on Facebook
Sign In or Register to comment.