Download

How do I debug refusal to connecto to Google Play services?

I have an app that successfully connected to Google Play and unlocked achievements a few days ago.
Now, however, that has stopped working. Unfortunately, I don’t remember exactly when.
As far as I can tell, all the blueprint nodes related to caching achievements still run the same as before; they just don’t succeed.
This is using a deployment/release build, installing with the .bat script onto the device.

I have defined and published my google play services, so they should all be available.

This is probably something stupid I’ve accidentally changed, but I can’t figure out what it is, and worse, I can’t figure out how to debug it.
Logcat doesn’t print much useful things. There are a bunch of errors about W/Adreno-EGL(28619): <qeglDrvAPI_eglGetConfigAttrib:632>: EGL_BAD_ATTRIBUTE but that’s unlikely to be related :slight_smile:

Here are the log messages:


V/Zygote  (28619): Switching descriptor 34 to /dev/null
V/Zygote  (28619): Switching descriptor 9 to /dev/null
I/ActivityManager(  794): Start proc com.enchantedage.supercellpop1 for activity com.enchantedage.supercellpop1/com.epic
games.ue4.GameActivity: pid=28619 uid=10131 gids={50131, 3003, 1028, 1015}
I/ActivityManager(  794): Config changes=480 {1.0 310mcc410mnc en_US ldltr sw360dp w640dp h335dp 480dpi nrml long land f
inger -keyb/v/h -nav/h s.81 themeResource=null}
I/InputReader(  794): Reconfiguring input devices.  changes=0x00000004
I/InputReader(  794): Device reconfigured: id=5, name='synaptics-rmi-ts', size 1080x1920, orientation 1, mode 1, display
 id 0
D/PhoneStatusBar( 1017): mSettingsPanelGravity = 55
D/ActivityThread(28619): handleBindApplication:com.enchantedage.supercellpop1
D/ActivityThread(28619): setTargetHeapUtilization:0.75
D/ActivityThread(28619): setTargetHeapMinFree:2097152
D/dalvikvm(28619): Trying to load lib /data/app-lib/com.enchantedage.supercellpop1-1/libgnustl_shared.so 0x41d8e848
D/dalvikvm(28619): Added shared lib /data/app-lib/com.enchantedage.supercellpop1-1/libgnustl_shared.so 0x41d8e848
D/dalvikvm(28619): No JNI_OnLoad found in /data/app-lib/com.enchantedage.supercellpop1-1/libgnustl_shared.so 0x41d8e848,
 skipping init
D/dalvikvm(28619): Trying to load lib /data/app-lib/com.enchantedage.supercellpop1-1/libUE4.so 0x41d8e848
D/dalvikvm(28619): Added shared lib /data/app-lib/com.enchantedage.supercellpop1-1/libUE4.so 0x41d8e848
W/IInputConnectionWrapper( 1208): showStatusIcon on inactive InputConnection
I/Timeline(28619): Timeline: Activity_idle id: android.os.BinderProxy@41d7fc30 time:164216424
I/ActivityManager(  794): Displayed com.enchantedage.supercellpop1/com.epicgames.ue4.GameActivity: +293ms
I/Timeline(  794): Timeline: Activity_windows_visible id: ActivityRecord{42b95320 u0 com.enchantedage.supercellpop1/com.
epicgames.ue4.GameActivity t61} time:164216440
I/Adreno-EGL(28619): <qeglDrvAPI_eglInitialize:410>: EGL 1.4 QUALCOMM build: AU_LINUX_ANDROID_LNX.LA.3.5.2.2_RB1.04.04.0
4.087.028_msm8974_LNX.LA.3.5.2.2_RB1__release_AU ()
I/Adreno-EGL(28619): OpenGL ES Shader Compiler Version: E031.24.00.15
I/Adreno-EGL(28619): Build Date: 07/31/14 Thu
I/Adreno-EGL(28619): Local Branch:
I/Adreno-EGL(28619): Remote Branch: quic/LNX.LA.3.5.2.2_rb1
I/Adreno-EGL(28619): Local Patches: NONE
I/Adreno-EGL(28619): Reconstruct Branch: AU_LINUX_ANDROID_LNX.LA.3.5.2.2_RB1.04.04.04.087.028 +  NOTHING
W/Adreno-EGL(28619): <qeglDrvAPI_eglGetConfigAttrib:632>: EGL_BAD_ATTRIBUTE
W/Adreno-EGL(28619): <qeglDrvAPI_eglGetConfigAttrib:632>: EGL_BAD_ATTRIBUTE
W/Adreno-EGL(28619): <qeglDrvAPI_eglGetConfigAttrib:632>: EGL_BAD_ATTRIBUTE
W/Adreno-EGL(28619): <qeglDrvAPI_eglGetConfigAttrib:632>: EGL_BAD_ATTRIBUTE
W/Adreno-EGL(28619): <qeglDrvAPI_eglGetConfigAttrib:632>: EGL_BAD_ATTRIBUTE
W/Adreno-EGL(28619): <qeglDrvAPI_eglGetConfigAttrib:632>: EGL_BAD_ATTRIBUTE
W/Adreno-EGL(28619): <qeglDrvAPI_eglGetConfigAttrib:632>: EGL_BAD_ATTRIBUTE
W/Adreno-EGL(28619): <qeglDrvAPI_eglGetConfigAttrib:632>: EGL_BAD_ATTRIBUTE
W/Adreno-EGL(28619): <qeglDrvAPI_eglGetConfigAttrib:632>: EGL_BAD_ATTRIBUTE
W/Adreno-EGL(28619): <qeglDrvAPI_eglGetConfigAttrib:632>: EGL_BAD_ATTRIBUTE
W/Adreno-EGL(28619): <qeglDrvAPI_eglGetConfigAttrib:632>: EGL_BAD_ATTRIBUTE
W/Adreno-EGL(28619): <qeglDrvAPI_eglGetConfigAttrib:632>: EGL_BAD_ATTRIBUTE
W/Adreno-EGL(28619): <qeglDrvAPI_eglGetConfigAttrib:632>: EGL_BAD_ATTRIBUTE
W/Adreno-EGL(28619): <qeglDrvAPI_eglGetConfigAttrib:632>: EGL_BAD_ATTRIBUTE
W/Adreno-EGL(28619): <qeglDrvAPI_eglGetConfigAttrib:632>: EGL_BAD_ATTRIBUTE
W/Adreno-EGL(28619): <qeglDrvAPI_eglGetConfigAttrib:632>: EGL_BAD_ATTRIBUTE
W/Adreno-EGL(28619): <qeglDrvAPI_eglGetConfigAttrib:632>: EGL_BAD_ATTRIBUTE
W/Adreno-EGL(28619): <qeglDrvAPI_eglGetConfigAttrib:632>: EGL_BAD_ATTRIBUTE
I/WindowManager(  794): Screen frozen for +320ms due to Window{429556b8 u0 StatusBar}
E/MediaPlayer(28619): stop called in state 1
E/MediaPlayer(28619): error (-38, 0)
E/MediaPlayer(28619): Error (-38,0)
I/ActivityManager(  794): START u0 {act=android.intent.action.MAIN cat=[android.intent.category.HOME] flg=0x10200000 cmp
=com.cyanogenmod.trebuchet/org.cyanogenmod.trebuchet.CustomHomeLauncher} from pid 794
I/InputReader(  794): Reconfiguring input devices.  changes=0x00000004
I/InputReader(  794): Device reconfigured: id=5, name='synaptics-rmi-ts', size 1080x1920, orientation 0, mode 1, display
 id 0
I/ActivityManager(  794): Config changes=480 {1.0 310mcc410mnc en_US ldltr sw360dp w360dp h615dp 480dpi nrml long port f
inger -keyb/v/h -nav/h s.82 themeResource=null}
D/PhoneStatusBar( 1017): mSettingsPanelGravity = 55
I/WindowManager(  794): Screen frozen for +163ms due to Window{429556b8 u0 StatusBar}
W/IInputConnectionWrapper(28619): showStatusIcon on inactive InputConnection
I/Timeline(  794): Timeline: Activity_windows_visible id: ActivityRecord{4249e388 u0 com.cyanogenmod.trebuchet/org.cyano
genmod.trebuchet.CustomHomeLauncher t1} time:164223486
I/Timeline( 1208): Timeline: Activity_idle id: android.os.BinderProxy@41a2cdd8 time:164223636
I/ActivityManager(  794): START u0 {act=android.intent.action.MAIN cat=[android.intent.category.HOME] flg=0x10200000 cmp
=com.cyanogenmod.trebuchet/org.cyanogenmod.trebuchet.CustomHomeLauncher} from pid 794

If I could just figure out where the Unreal game log file goes, that might be something, but I can’t even find those.
“adb shell” tells me that my game is installed in /storage/emulated/legacy/SuperCellPop1 but that directory just contains a bunch of ini files.


ls -R

.:
Epic Games
SuperCellPop1

./Epic Games:
KeyValueStore.ini

./SuperCellPop1:
Intermediate
Saved

./SuperCellPop1/Intermediate:
Config

./SuperCellPop1/Intermediate/Config:
CoalescedSourceConfigs

./SuperCellPop1/Intermediate/Config/CoalescedSourceConfigs:
DeviceProfiles.ini
Engine.ini
Game.ini
GameUserSettings.ini
Input.ini
Scalability.ini

./SuperCellPop1/Saved:
Config

./SuperCellPop1/Saved/Config:
Android

./SuperCellPop1/Saved/Config/Android:
DeviceProfiles.ini
Engine.ini
Game.ini
GameUserSettings.ini
Input.ini
Scalability.ini

EGL_BAD_ATTRIBUTE is harmless; this is just the engine checking for capabilities which the driver does not support in this case so are disabled.

The logcat is where the game sends all logging. You can look for engine log data with tag UE4 (adb logcat -s UE4).

Are you sure you have a working Google Play Services? I noticed cyanogenmod in the log.

That’s what I assumed, but what I pasted in the message above is the full (unfiltered) logcat, and does not include any UE4 messages.
Where do those messages go?
Also, where do savegames go? I’m using a plugin that writes some persistent data next to the savegames, so perhaps I can write some debugging data there too, if I could figure out where this would be…

Yes, that is the stock OS on my OnePlus One phone. Just like HTC has Sense and Samsung has … whatever they call theirs … OnePlus chose Cyanogen OS as their flavor of Android. (Which is different from the “rooted” Cyanogen Mod you may be thinking about.)

Logging is only enabled for Development or Test builds. Shipping disables all logging. Google Play Services does have its own log messages you should see. I would expect to see them after “Displayed com.enchantedage.supercellpop1/com.epicgames.ue4.GameActivity”.

I would expect so, too, but I don’t.
How do I debug this?

So, going back to non-shipping builds, i can get log outputs. It claims that the Google Play online system module is not available.



D/UE4     (20563): [2015.04.22-03.21.07:347]  0]LogModuleManager:Warning: ModuleManager: Module 'OnlineSubsystemGooglePlay' not found - its StaticallyLinkedModuleInitializers function is null.
D/UE4     (20563): [2015.04.22-03.21.07:347]  0]LogOnline:Warning: Unable to load default OnlineSubsystem module GooglePlay, using NULL interface
D/UE4     (20563): [2015.04.22-03.21.07:347]  0]LogModuleManager:Warning: ModuleManager: Module 'OnlineSubsystemNull' not found - its StaticallyLinkedModuleInitializers function is null.


Now, looking inside ./Source/…/MyGame.Build.cs I find a line about needing to uncomment online services:



		// Uncomment if you are using online features
		// PrivateDependencyModuleNames.Add("OnlineSubsystem");


Uncommenting this and re-building and re-packaging does not solve the problem, though.

Also, I notice from the google play sticky thread:

What does “configured for the … Google Play Services in the project settings” mean? Just that it doesn’t complain that it’s not configured for these?

Here are my android settings:

2015-04-21-android-settings.jpg

In addition to “OnlineSubsystem” you can try adding the “OnlineSubsystemGooglePlay” module as a dependency in your Build.cs file as well.

Some more hints: I created a brand new empty blueprint project, and set it up with the same settings in the dialog box (app ID, package name, etc,) and it does connect to Google Play just fine.
This project does not have C++ code.

Then, when I add an empty C++ class to the project and compile it, and re-package, and now it fails to connect to Google Play.

Adding the OnlineSubsystem and OnlineSubsystemGooglePlay modules then generates a link error:


Error LINK : fatal error LNK1181: cannot open input file 'C:\UnrealEngine\Unreal Engine\4.7\Engine\Intermediate\Build\Win64\UE4Editor\Development\UE4Editor-OnlineSubsystemGooglePlay.lib'


I presume this is because you don’t support Google Play for Windows. (Yet? It’d actually be kind-of nice to have this for desktop apps!)

Re-packaging for Android with this addition, does build without errors. However, the app does not correctly connect to Google Play even after this.

I get these errors:



D/UE4     (23301): [2015.04.23-02.42.27:762]  0]LogModuleManager:Warning: ModuleManager: Module 'OnlineSubsystemGooglePlay' not found - its StaticallyLinkedModuleInitializers function is null.

D/UE4     (23301): [2015.04.23-02.42.27:762]  0]LogOnline:Warning: Unable to load default OnlineSubsystem module GooglePlay, using NULL interface

D/UE4     (23301): [2015.04.23-02.42.27:763]  0]LogModuleManager:Warning: ModuleManager: Module 'OnlineSubsystemNull' not found - its StaticallyLinkedModuleInitializers function is null.



The way I added the modules was:



		PrivateDependencyModuleNames.Add("OnlineSubsystem");
        if (Target.Platform == UnrealTargetPlaform.Android)
        {
            PrivateDependencyModuleNames.Add("OnlineSubsystemGooglePlay");
        }


Correct, Google Play is not supported on Windows. Google would need to provide support for their services in desktop apps before we would add this to the engine.

There is a bug (tracked as UE-13075) where UnrealBuildTool doesn’t automatically detect changes in Build.cs files. If you regenerate the Visual Studio project files, do the OnlineSubsystem modules get picked up then?

I had already re-generated the files and re-built the C++, and that did not help.

(They do support web browsers, and in general, any arbitrary REST client. I’m just sayin’ … :slight_smile:

If you fix the “adding C++ breaks online services for android” bug, though, that would be the high-order bit of priority.

I have the same issue with OnlineSubsystemNull:
https://answers.unrealengine.com/questions/217983/modulemanager-module-onlinesubsystemnull-not-found.html

My issue is also packaging for Mac, not just for Android. Is it the same bug?
How of I re-generate the needed files?

Note that as written this code should fail to compile. UnrealTargetPlaform should be UnrealTargetPlatform.

I can’t reproduce this issue in 4.7.6, even without regenerating the project files. Specifically, after adding a C++ class to a Blueprint project, I:

  1. Added OnlineSubsystem and OnlineSubsystemGooglePlay to the PrivateDependencyModuleNames list in the project’s Build.cs file.
  2. Switched back to the Unreal Editor and choose File -> Package Project -> Android ->Android (ATC) (or any other texture format appropriate for your device)
  3. Ran the Install_*.bat file in the final packaged directory
  4. Start the app on the phone, and notice that the line “FOnlineSubsystemAndroid::Init” appears in logcat. This indicates the engine was able to find the OnlineSubsystemGooglePlay module.

Can you confirm that after following these steps, you still see the “Module ‘OnlineSubsystemGooglePlay’ not found” error in logcat?

I am having trouble with this as well - Android In App Purchase operation always fails - UE4 AnswerHub

I see little tidbits here and there on how to enable google play - could we get an example solution or a youtube video end to end please?

From my testing just now

Hello Ryan,

A modified version of your instructions worked for me. I am running 4.7.6 and just ran into this thread’s issue, of adding C++ to a Blueprints project and experiencing a failure to access Google Play services, after it had worked just fine before.

In the [project].Build.cs, I added “OnlineSubsystemGooglePlay” in the PublicDependencyModuleNames list.

Google Play services now work in development (only the login for dev, of course) and distribution with Blueprints/C++!

Thanks for your help from a year ago!

Hopefully this bug can be addressed in a future engine version.

So, I’m having trouble with the OnlineSubsystemGooglePlay module too. When we try to get the online subsystem in code it comes back as saying it is not present despite adding OnlineSubsystem & OnlineSubsystemGooglePlay in PublicDependencyModuleNames for the Android target platform.

We are using 4.6.1, Am I to understand that if we have code then there is a bug which means we can not use OnlineSubsystemGooglePlay?

Thanks for the response, i’ll be away for a week but will check on this when I get back.

Something that might help getting the OnlineSubsystemGooglePlay working: Adding AndroidEngine.ini: https://forums.unrealengine.com/showthread.php?99143-Android-Compile-Errors