Still not working. It builds and runs, but apparently the AndroidManifest.xml is confused. Running the gradle script removed my own app Native parts. I can get either my own CoronaApplication to start or the get googleSignIn CoronaApplication to work, but not both. How do I merge this so that they both work?
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools"
package="com.phosphorlearn.SilkRoad"
android:installLocation="auto">
<permission android:name="com.phosphorlearn.SilkRoad.permission.C2D_MESSAGE" android:protectionLevel="signature" />
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="com.google.android.c2dm.permission.RECEIVE" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-permission android:name="com.android.vending.CHECK_LICENSE" />
<uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED" />
<uses-feature android:glEsVersion="0x00020000" />
<uses-feature android:name="android.hardware.telephony" android:required="false" />
<uses-feature android:name="android.hardware.screen.portrait" android:required="true" />
<uses-feature android:name="android.hardware.screen.landscape" android:required="false" />
<!-- Add android:name="CoronaApplication" to reactivate Application Delegate in Native Builds-->
<application android:label="Corona App"
android:name="CoronaApplication"
tools:replace="android:name"
>
<!--application android:icon="@mipmap/ic_launcher"
android:banner="@drawable/banner"
android:label="@string/app_name"
android:largeHeap="true"
android:label="Corona App"
android:name="CoronaApplication"
tools:replace="android:name"
android:networkSecurityConfig="@xml/network_security_config"
tools:replace="android:icon"
-->
<meta-data android:name="targetedAppStore" android:value="google" />
<!-- The main Corona activity that runs the Corona project. -->
<activity android:name="com.ansca.corona.CoronaActivity"
[...]
The result depends on timing, but usually this result from googleSignIn.init(…):
[Correction: init() appears to work fine, but the googleSignIn.signIn(googleSIListener) fails)
E/AndroidRuntime: FATAL EXCEPTION: GLThread 331
Process: com.phosphorlearn.SilkRoad, PID: 8329
java.lang.NullPointerException: null
at com.naef.jnlua.LuaState.lua_pushstring(Native Method)
at com.naef.jnlua.LuaState.pushString(LuaState.java:691)
at plugin.googleSignIn.LuaLoader$MyHandler$1.executeUsing(LuaLoader.java:210)
at com.ansca.corona.CoronaRuntimeTaskDispatcher$TaskEvent.Send(CoronaRuntimeTaskDispatcher.java:179)
at com.ansca.corona.events.EventManager.sendEvents(EventManager.java:100)
at com.ansca.corona.Controller.updateRuntimeState(Controller.java:325)
at com.ansca.corona.graphics.opengl.CoronaGLSurfaceView$CoronaRenderer.onDrawFrame(CoronaGLSurfaceView.java:434)
at com.ansca.corona.graphics.opengl.GLSurfaceView$GLThread.guardedRun(GLSurfaceView.java:1625)
at com.ansca.corona.graphics.opengl.GLSurfaceView$GLThread.run(GLSurfaceView.java:1380)
In case it helps, here is the lua call:
googleSignIn.init({
android={
clientId = GAPICID,
scopes= {"https://www.googleapis.com/auth/fitness.activity.read https://www.googleapis.com/auth/userinfo.email"}
}
})
googleSignIn.signIn(googleSIListener)