Quick Links: Download Gideros Studio | Gideros Documentation | Gideros community chat | DONATE
Google Play Services not working — Gideros Forum

Google Play Services not working

antixantix Member
edited July 2016 in Plugins
With the kind help of @simwhi in this thread I have managed to get the Google Play Services plugin partially working in Android Studio. I am using the example code from the plugin folder (C:\Gideros\All Plugins\googleplay\examples\GooglePlayTest)

I have exported as Android with Android Studio selected
I have imported the exported project into Android Studio
I have copied all the folders required (see screen dump 1)
I have modified my AndroidManifest.xml
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="<a href="http://schemas.android.com/apk/res/android&quot" rel="nofollow">http://schemas.android.com/apk/res/android&quot</a>;
      package="com.antix.gpservices"
      android:versionCode="1"
      android:versionName="1.0"
	  android:installLocation="auto">
    <uses-sdk android:minSdkVersion="8" android:targetSdkVersion="19" />
    <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"></uses-permission>
    <uses-permission android:name="android.permission.ACCESS_WIFI_STATE"></uses-permission>
    <uses-permission android:name="android.permission.INTERNET"></uses-permission>
    <uses-permission android:name="android.permission.ACCESS_FINE_LOCATION"></uses-permission>
    <uses-permission android:name="android.permission.VIBRATE"/>
    <uses-permission android:name="android.permission.SET_DEBUG_APP"></uses-permission>
    <!-- TAG:MANIFEST-EXTRA -->
    <uses-feature android:glEsVersion="0x00020000" android:required="true"/>
    <supports-screens android:largeScreens="true"
                      android:smallScreens="true"
                      android:normalScreens="true"
                      android:xlargeScreens="true"
                      android:anyDensity="true"/>
    <application android:icon="<a href="https://forum.gideros.rocks/profile/drawable%2Ficon%26quot" rel="nofollow">@drawable/icon&quot</a>; android:label="<a href="https://forum.gideros.rocks/profile/string%2Fapp_name%26quot" rel="nofollow">@string/app_name&quot</a>; android:theme="<a href="https://forum.gideros.rocks/profile/android" rel="nofollow">@android</a>:style/Theme.NoTitleBar.Fullscreen">
        <activity android:label="<a href="https://forum.gideros.rocks/profile/string%2Fapp_name%26quot" rel="nofollow">@string/app_name&quot</a>; android:name="com.giderosmobile.android.gpservicesActivity" android:launchMode="singleTask" android:screenOrientation="portrait" android:configChanges="keyboard|keyboardHidden|orientation|screenSize">
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />
                <category android:name="android.intent.category.LAUNCHER" />
            </intent-filter>
        </activity>
        <meta-data android:name="com.google.android.gms.version" android:value="<a href="https://forum.gideros.rocks/profile/integer%2Fgoogle_play_services_version%26quot" rel="nofollow">@integer/google_play_services_version&quot</a>; />
    	<!-- TAG:APPLICATION-EXTRA -->
    </application>
</manifest>
I have created version.xml
<?xml version="1.0" encoding="utf-8"?>
<resources>
<integer name="google_play_services_version">7</integer>
</resources>
I have modified build.gradle (module:app)
apply plugin: 'com.android.application'
android {
    compileSdkVersion 'Google Inc.:Google APIs:23'
    buildToolsVersion '23.0.3'
    defaultConfig {
        applicationId "com.antix.gpservices"
        minSdkVersion 9
        targetSdkVersion 23
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.txt'
        }
    }
    productFlavors {
    }
}
dependencies {
    compile 'com.google.android.gms:play-services:7.8.0'
    compile files('libs/gideros.jar')
}
After doing all of that I can actually build my project without it spitting the dummy, but when I try to debug it on my device I get the following crash..
07-06 20:38:47.098 20866-20960/com.antix.gpservices E/AndroidRuntime: FATAL EXCEPTION: GLThread 814
Process: com.antix.gpservices, PID: 20866
com.giderosmobile.android.player.LuaException: C:/Projects/Android Studio/gpservices/app/src/main/assets/assets/main.lua.jet:37: module 'googleplay' not found:	
no field package.preload['googleplay']
no file './googleplay.lua'
no file '/usr/local/share/lua/5.1/googleplay.lua'
no file '/usr/local/share/lua/5.1/googleplay/init.lua'
no file '/usr/local/lib/lua/5.1/googleplay.lua'
no file '/usr/local/lib/lua/5.1/googleplay/init.lua'
no file './googleplay.so'
no file '/usr/local/lib/lua/5.1/googleplay.so'
no file '/usr/local/lib/lua/5.1/loadall.so'
Can anyone assist me with this?

Comments

  • ar2rsawseenar2rsawseen Maintainer
    Did you modify the activity as per instructions:
    Load plugin library in main Activity: System.loadLibrary("gms");
    Add external class: "com.giderosmobile.android.plugins.googleplaygame.GGooglePlay"

  • antixantix Member
    edited July 2016
    @ar2sawseen, no, I was following the instructions @simwhi provided. I can add the plugin in the main activity but how do I add an external class in Android Studio?

    I will try in the morning
  • ar2rsawseenar2rsawseen Maintainer
    edited July 2016
  • ar2rsawseenar2rsawseen Maintainer
    edited July 2016
    Also did you view the installation instructions?
    Unfortunately I don't know how much have changed from Google Play point of view:
    https://github.com/gideros/gideros/blob/master/plugins/googleplay/android_install.html

    it should also be available in Gideros/All Plugins/googleplay folder
  • antixantix Member
    edited July 2016
    @ar2sawseen I see, thanks. Yes I did read the instructions. Adding those lines to AndroidManifest generates a new error when debugging. Any idea what is happening now?
    07-07 07:27:13.029 24247-24247/com.antix.gpservices E/AndroidRuntime: FATAL EXCEPTION: mainProcess: com.antix.gpservices, PID: 24247java.lang.UnsatisfiedLinkError: com.android.tools.fd.runtime.IncrementalClassLoader$DelegateClassLoader[DexPathList[[dex file "/data/data/com.antix.gpservices/files/instant-run/dex/slice-support-annotations-22.2.0_a2ab687f56ee402d7ca55279e65a0e1177e283f4-classes.dex", dex file "/data/data/com.antix.gpservices/files/instant-run/dex/slice-slice_9-classes.dex", dex file "/data/data/com.antix.gpservices/files/instant-run/dex/slice-slice_8-classes.dex", dex file "/data/data/com.antix.gpservices/files/instant-run/dex/slice-slice_7-classes.dex", dex file "/data/data/com.antix.gpservices/files/instant-run/dex/slice-slice_6-classes.dex", dex file "/data/data/com.antix.gpservices/files/instant-run/dex/slice-slice_5-classes.dex", dex file "/data/data/com.antix.gpservices/files/instant-run/dex/slice-slice_4-classes.dex", dex file "/data/data/com.antix.gpservices/files/instant-run/dex/slice-slice_3-classes.dex", dex file "/data/data/com.antix.gpservices/files/instant-run/dex/slice-slice_2-classes.dex", dex file "/data/data/com.antix.gpservices/files/instant-run/dex/slice-slice_1-classes.dex", dex file "/data/data/com.antix.gpservices/files/instant-run/dex/slice-slice_0-classes.dex", dex file "/data/data/com.antix.gpservices/files/instant-run/dex/slice-internal_impl-22.2.0_8fae82206cfeaf548c88228d9d275c36506bfff7-classes.dex", dex file "/data/data/com.antix.gpservices/files/instant-run/dex/slice-internal_impl-22.2.0_3e4e6db100a8d15d56ef414ccabf8b2c481590c4-classes.dex", dex file "/data/data/com.antix.gpservices/files/instant-run/dex/slice-gideros_0cd2e4a6fca1d7e673748468f07b98172fc6ab8f-classes.dex", dex file "/data/data/com.antix.gpservices/files/instant-run/dex/slice-com.google.android.gms-play-services-wearable-7.8.0_84753af2eb9feb06a901a7adfc8831ef0f1f3656-classes.dex", dex file "/data/data/com.antix.gpservices/files/instant-run/dex/slice-com.google.android.gms-play-services-wallet-7.8.0_5b4b8eb4cc4419b89d47cda0630e2bdd057e3750-classes.dex", dex file "/data/data/com.antix.gpservices/files/instant-run/dex/slice-com.google.android.gms-play-services-vision-7.8.0_760c773cb92c4c5b8a23fd3ba37fef78357a23df-classes.dex", dex file "/data/data/com.antix.gpservices/files/instant-run/dex/slice-com.google.android.gms-play-services-safetynet-7.8.0_1244e0875b6121a2e4072f4678aaadc910bb2ccb-classes.dex", dex file "/data/data/com.antix.gpservices/files/instant-run/dex/slice-com.google.android.gms-play-services-plus-7.8.0_9ad15f624b6cedb3878de23582b658ec4485f7f6-classes.dex", dex file "/data/data/com.antix.gpservices/files/instant-run/dex/slice-com.google.android.gms-play-services-panorama-7.8.0_42f6f69db756ec64d40a50af7d06e110677aa40d-classes.dex", dex file "/data/data/com.antix.gpservices/files/instant-run/dex/slice-com.google.android.gms-play-services-nearby-7.8.0_ea580d8431ed3eb57729ca7bfabcf8521a7518c1-classes.dex", dex file "/data/data/com.antix.gpservices/files/instant-run/dex/slice-com.google.android.gms-play-services-maps-7.8.0_427796bfb8025452a06f387a45bfb4bad2d2ef8a-classes.dex", dex file "/data/data/com.antix.gpservices/files/instant-run/dex/slice-com.google.android.gms-play-services-location-7.8.0_bbfc3713d7ab1c3ade38999d1a9c7ae1b9f23efb-classes.dex", dex file "/data/data/com.antix.gpservices/files/instant-run/dex/slice-com.google.android.gms-play-services-identity-7.8.0_bdb34cc76cec1b57f836d692d4e9b2f753a6ea23-classes.dex", dex file "/data/data/com.antix.gpservices/files/instant-run/dex/slice-com.google.android.gms-play-services-gcm-7.8.0_342f80e25a0a5382336d3bd4c5fd40218eb208b9-classes.dex", dex file "/data/data/com.antix.gpservices/files/instant-run/dex/slice-com.google.android.gms-play-services-games-7.8.0_09c295c682d3bbc4140d743516053e829e9068d1-classes.dex", dex file "/data/data/com.antix.gpservices/files/instant-run/dex/slice-com.google.android.gms-play-services-fitness-7.8.0_343544f557e7c08948af2723e58a668775384325-classes.dex", dex file "/data/data/com.antix.gpservices/files/instant-run/dex/slice-com.google.android.gms-play-serv
    07-07 07:27:13.030 24247-24247/com.antix.gpservices D/Error: ERR: exClass=java.lang.UnsatisfiedLinkError
  • ar2rsawseenar2rsawseen Maintainer
    I see,
    so I think you need to somehow reference google-play-services in Android Studio.

    my guess would be it is to list it as dependency in build.gradle as specified here:
    https://developers.google.com/android/guides/setup
  • antixantix Member
    Thanks. I already had my gradle modified though :(
    apply plugin: 'com.android.application'
    android {
        compileSdkVersion 'Google Inc.:Google APIs:23'
        buildToolsVersion '23.0.3'
        defaultConfig {
            applicationId "com.antix.gpservices"
            minSdkVersion 9
            targetSdkVersion 23
        }
        buildTypes {
            release {
                minifyEnabled false
                proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.txt'
            }
        }
        productFlavors {
        }
    }
    dependencies {
        compile 'com.google.android.gms:play-services:7.8.0'
        compile files('libs/gideros.jar')
    }
  • simwhisimwhi Member
    @antix Try changing the the version number for gms-play-services to 8.4.0. That;s the version that is working for me.
  • simwhisimwhi Member
    @antix. I thought I would look into this a bit, but I'm not sure which plugin you trying to get working.
    1.PNG
    649 x 171 - 9K
    1.PNG 8.9K
  • antixantix Member
    @simwhi the plugin I am trying to get working is googleplay, thanks :)

    I'll try 8.4.0 directly and report back.
  • simwhisimwhi Member
    @antix What is the gaming plugin? Do you know?
  • antixantix Member
    How strange, now on building I get this error..
    C:\Projects\Android Studio\gpservices\app\src\main\java\com\giderosmobile\android\plugins\googleplaygame\GameHelper.java
    Error:(32, 39) error: cannot find symbol class AppStateManager
    Error:(294, 28) error: cannot find symbol variable AppStateManager
    Error:(295, 30) error: cannot find symbol variable AppStateManager
    C:\Projects\Android Studio\gpservices\app\src\main\java\com\giderosmobile\android\plugins\googleplaygame\GGooglePlay.java
    Error:(12, 39) error: cannot find symbol class AppStateManager
    Error:(13, 55) error: package com.google.android.gms.appstate.AppStateManager does not exist
    Error:(14, 55) error: package com.google.android.gms.appstate.AppStateManager does not exist
    Error:(15, 39) error: cannot find symbol class AppStateStatusCodes
    Error:(484, 21) error: cannot find symbol class StateResult
    Error:(484, 43) error: cannot find symbol variable AppStateManager
    Error:(485, 22) error: cannot find symbol class StateResult
    Error:(486, 30) error: cannot find symbol class StateResult
    Error:(488, 32) error: cannot find symbol class StateResult
    Error:(492, 30) error: cannot find symbol variable AppStateStatusCodes
    Error:(492, 77) error: cannot find symbol variable AppStateStatusCodes
    Error:(494, 28) error: package AppStateManager does not exist
    Error:(495, 34) error: package AppStateManager does not exist
    Error:(509, 28) error: cannot find symbol variable AppStateStatusCodes
    Error:(513, 33) error: cannot find symbol variable AppStateStatusCodes
    Error:(517, 33) error: cannot find symbol variable AppStateStatusCodes
    Error:(521, 33) error: cannot find symbol variable AppStateStatusCodes
    Error:(525, 33) error: cannot find symbol variable AppStateStatusCodes
    Error:(529, 33) error: cannot find symbol variable AppStateStatusCodes
    Error:(546, 22) error: cannot find symbol class StateResult
    Error:(546, 44) error: cannot find symbol variable AppStateManager
    Error:(547, 23) error: cannot find symbol class StateResult
    Error:(548, 34) error: cannot find symbol class StateResult
    Error:(550, 36) error: cannot find symbol class StateResult
    Error:(554, 34) error: cannot find symbol variable AppStateStatusCodes
    Error:(554, 81) error: cannot find symbol variable AppStateStatusCodes
    Error:(556, 32) error: package AppStateManager does not exist
    Error:(557, 38) error: package AppStateManager does not exist
    Error:(569, 32) error: cannot find symbol variable AppStateStatusCodes
    Error:(573, 37) error: cannot find symbol variable AppStateStatusCodes
    Error:(577, 37) error: cannot find symbol variable AppStateStatusCodes
    Error:(581, 37) error: cannot find symbol variable AppStateStatusCodes
    Error:(585, 37) error: cannot find symbol variable AppStateStatusCodes
    Error:(589, 37) error: cannot find symbol variable AppStateStatusCodes
    Error:(602, 8) error: cannot find symbol variable AppStateManager
    Error:(609, 7) error: cannot find symbol variable AppStateManager
    Error:(615, 21) error: cannot find symbol class StateDeletedResult
    Error:(615, 50) error: cannot find symbol variable AppStateManager
    Error:(616, 22) error: cannot find symbol class StateDeletedResult
    Error:(617, 30) error: cannot find symbol class StateDeletedResult
    Error:(619, 32) error: cannot find symbol class StateDeletedResult
    Error:(622, 30) error: cannot find symbol variable AppStateStatusCodes
    Error:(631, 28) error: cannot find symbol variable AppStateStatusCodes
    Error:(635, 33) error: cannot find symbol variable AppStateStatusCodes
    Note: Some input files use or override a deprecated API.
    Note: Recompile with -Xlint:deprecation for details.
    :app:compileDebugJavaWithJavac FAILED
    Error:Execution failed for task ':app:compileDebugJavaWithJavac'.
    > Compilation failed; see the compiler error output for details.
    Information:BUILD FAILED
    Information:Total time: 15.657 secs
    Information:48 errors
    Information:0 warnings
    Information:See complete output in console
  • test29test29 Member
    @antix, AppStateManager not existing in new google play. You must remove all references for it from GameHelper.java and GGooglePlay.java.

    Likes: antix

    +1 -1 (+1 / -0 )Share on Facebook
  • test29test29 Member
    Here is the modified GameHelper and GGooglePlay. Just replace it with versions from this zip file. Also here is support v4 library that you must add as depedencies to your project.
    zip
    zip
    GameHelper.zip
    15K
    zip
    zip
    support-v4-23.0.0.zip
    1M

    Likes: antix

    +1 -1 (+1 / -0 )Share on Facebook
  • ar2rsawseenar2rsawseen Maintainer
    Or you can try to use Gaming Interface, which as I remember was more up to date and probably will be updated, but google play plugin as a standalone was deprecated
  • simwhisimwhi Member
    @antix How's it going?
  • antixantix Member
    @simwhi I'm just messing around with my beta and I have some stuff that @test29 has uploaded so I will look at that in a little while.
  • antixantix Member
    @test29 okay I know how to copy and paste the java files into the correct folders but what the heck am I doing with the support stuff?
  • test29test29 Member
    Unpack it to the same directory where is google-play-services_lib and then add it to the your project like you do for google-play-services_lib. (I'm using Eclipse, but for Android Studio it should be similar)
  • antixantix Member
    Nope, no idea how to do this stuff. It should be easy but it's not. It might be similar to Eclipse but I don't use Eclipse, have no idea how to use it, and have little to no idea how to use Android Studio.

    Thanks for trying to help though, I appreciate it, even if I'm too stupid to grasp what you are trying to have me do.
  • antixantix Member
    If you could writeup how to do it in Eclipse I would give it a try. I succumbed and installedit so will try google gaming services tomorrow with it.

    I would be willing to have a look at Gaming interface, does that do Achievements, Leaderboards, and In App Purchases too? There doesn't seem to be any docs or anything in it's folder though.
  • I finally got the gaming plugin working on android studio.
    I've made some fairly garbled notes here:
    http://giderosmobile.com/forum/discussion/6553/android-studio-google-play-services#Item_21
    Hope you can make sense of it. A few gotchas that weren't in the docs and largely a case if using an older version of the google play library.
    Hope it helps and sorry if it's incoherent :)

    Likes: antix

    +1 -1 (+1 / -0 )Share on Facebook
Sign In or Register to comment.