Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

AppGameKit Classic Chat / Error when building APK with google play template

Author
Message
Parry
AGK Developer
14
Years of Service
User Offline
Joined: 16th Dec 2009
Location: Swampstone
Posted: 20th Apr 2018 23:32 Edited at: 20th Apr 2018 23:34
I'm getting 4 errors when trying to build a apk with android googleplay template: (AGK2 version 2018.04.12 / Android Studio version 3.1.1 / NDK version 11)

error: cannot find symbol class GoogleSignIn
error: cannot find symbol class GoogleSignInStatusCodes
error: cannot find symbol class GoogleSignIn
error: cannot find symbol class GoogleSignInClient


A made the following changes to allow the template to build a apk:

In build.gradle in the AGK2Template folder after:

compile 'com.google.android.gms:play-services-location:11.8.0'

add:

compile 'com.google.android.gms:play-services-drive:11.8.0'
compile 'com.google.android.gms:play-services-auth:11.8.0'

AGKHelper.java

At line 39 add the following:

import com.google.android.gms.auth.api.signin.GoogleSignIn;
import com.google.android.gms.auth.api.signin.GoogleSignInAccount;
import com.google.android.gms.auth.api.signin.GoogleSignInClient;
import com.google.android.gms.auth.api.signin.GoogleSignInStatusCodes;
import com.google.android.gms.auth.api.signin.GoogleSignInOptions;
Parry
AGK Developer
14
Years of Service
User Offline
Joined: 16th Dec 2009
Location: Swampstone
Posted: 21st Apr 2018 02:47
Sorry but my fix allowed the apk to build but it crashes when it runs:

--------- beginning of crash
04-20 21:38:57.734 20789-20789/com.mycompany.mytemplate E/AndroidRuntime: FATAL EXCEPTION: main
Process: com.mycompany.mytemplate, PID: 20789
java.lang.UnsatisfiedLinkError: Unable to load native library "/data/app/com.mycompany.mytemplate-1/lib/arm/libandroid_player.so": undefined symbol: ANativeActivity_onCreate
at android.app.NativeActivity.onCreate(NativeActivity.java:182)
at com.thegamecreators.agk_player.AGKActivity.onCreate(AGKActivity.java:30)
at android.app.Activity.performCreate(Activity.java:6672)
at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1140)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2612)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2724)
at android.app.ActivityThread.-wrap12(ActivityThread.java)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1473)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:154)
at android.app.ActivityThread.main(ActivityThread.java:6123)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:867)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:757)
Paul Johnston
TGC Developer
21
Years of Service
User Offline
Joined: 16th Nov 2002
Location: United Kingdom
Posted: 23rd Apr 2018 14:27
It looks like something went wrong when compiling the C++ portion, but I've not seen that happen before. Did you use the jniCompile.bat file provided or did you compile it some other way?
Parry
AGK Developer
14
Years of Service
User Offline
Joined: 16th Dec 2009
Location: Swampstone
Posted: 23rd Apr 2018 15:32
I found my mistake. I didn't update my NDK to r16b. I was still using r11c.

Also if anyone else has warnings and cannot compile with NDK 16. Add this line to turn off "Treat Warnings as Errors"

LOCAL_DISABLE_FATAL_LINKER_WARNINGS = true

in this file:

android-ndk-r16b\build\core\build-binary.mk

Thanks!

Login to post a reply

Server time is: 2024-04-19 21:22:59
Your offset time is: 2024-04-19 21:22:59