Hi,
We are trying to build Google Instant App with Corona Native SDK (via Android Studio).
We followed instructions on:
https://codelabs.developers.google.com/codelabs/android-instant-apps/index.html#0
After finishing above tutorial we are able to build “install” version of the app, which runs ok.
“Instant” version of the app builds, but when it runs it crashes with fatal exception:
Caused by: java.lang.NullPointerException: Attempt to invoke virtual method ‘boolean android.app.KeyguardManager.inKeyguardRestrictedInputMode()’ on a null object reference
(stacktrace below).
We believe that project is set up correctly - if we replace CoronaActivity with some other (empty) activity, instant app builds and runs fine.
(test project is here https://www.dropbox.com/sh/xckc150l2ndbji1/AACbLspdhww0W2uZ54NGM6uea?dl=0 )
Is it even possible to build instant app with Corona Native or are we missing something? Does Corona Labs have a plan to support instant app in the near future?
Any help or suggestion would be greatly appreciated.
Best regards,
mimoz
STACKTRACE:
11/22 12:33:12: Launching instant
INFO - Analyzing files…
INFO - Checking device…
INFO - Pushing instant app to device…
INFO - Launching app…
INFO - Instant app started
Client not ready yet…Waiting for process to come online
Connected to process 4226 on device samsung-sm_a520f-520003d14ba135bf
Capturing and displaying logcat messages from application. This behavior can be disabled in the “Logcat output” section of the “Debugger” settings page.
E/Zygote: isWhitelistProcess - Process is Whitelisted
E/libpersona: scanKnoxPersonas
Couldn’t open the File - /data/system/users/0/personalist.xml - No such file or directory
W/SELinux: SELinux selinux_android_compute_policy_index : Policy Index[2], Con:u:r:zygote:s0 RAM:SEPF_SM-A520F_8.0.0_0010, [-1 -1 -1 -1 0 1]
I/SELinux: SELinux: seapp_context_lookup: seinfo=untrusted, level=s0:c512,c768, pkgname=com.bubadu.instanttest
I/zygote: Late-enabling -Xcheck:jni
D/TimaKeyStoreProvider: TimaKeyStore is not enabled: cannot add TimaSignature Service and generateKeyPair Service
D/ActivityThread: Added TimaKeyStore provider
I/MultiDex: VM with version 2.1.0 has multidex support
Installing application
VM has multidex support, MultiDex support library is disabled.
I/System.out: CAP: onCreate will
I/zygote: Thread[1,tid=4226,Native,Thread*=0xf0cef000,peer=0x73ab74d8,“main”] recursive attempt to load library “/data/app/com.bubadu.instanttest-reokZ8pPuRinJUaboT-88A==/lib/arm/libjnlua5.1.so”
I/OpenAL_SLES: alc_opensles_init
I/System.out: CAP: onCreate did
W/System.err: java.lang.NullPointerException: Attempt to invoke virtual method ‘boolean java.lang.String.equals(java.lang.Object)’ on a null object reference
W/System.err: at com.ansca.corona.CoronaActivity.initializeOrientation(CoronaActivity.java:435)
at com.ansca.corona.CoronaActivity.onCreate(CoronaActivity.java:227)
at android.app.Activity.performCreate(Activity.java:7183)
at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1220)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2910)
W/System.err: at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3032)
at android.app.ActivityThread.-wrap11(Unknown Source:0)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1696)
at android.os.Handler.dispatchMessage(Handler.java:105)
at android.os.Looper.loop(Looper.java:164)
at android.app.ActivityThread.main(ActivityThread.java:6944)
W/System.err: at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.Zygote$MethodAndArgsCaller.run(Zygote.java:327)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1374)
W/SoundPool: Use of stream types is deprecated for operations other than volume control
See the documentation of SoundPool() for what to use instead with android.media.AudioAttributes to qualify your playback use case
W/SystemServiceRegistry: No service published for: trust
D/AndroidRuntime: Shutting down VM
E/AndroidRuntime: FATAL EXCEPTION: main
Process: com.bubadu.instanttest, PID: 4226
java.lang.RuntimeException: Unable to resume activity {com.bubadu.instanttest/com.ansca.corona.CoronaActivity}: java.lang.NullPointerException: Attempt to invoke virtual method ‘boolean android.app.KeyguardManager.inKeyguardRestrictedInputMode()’ on a null object reference
at android.app.ActivityThread.performResumeActivity(ActivityThread.java:3790)
at android.app.ActivityThread.handleResumeActivity(ActivityThread.java:3830)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3038)
at android.app.ActivityThread.-wrap11(Unknown Source:0)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1696)
at android.os.Handler.dispatchMessage(Handler.java:105)
at android.os.Looper.loop(Looper.java:164)
at android.app.ActivityThread.main(ActivityThread.java:6944)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.Zygote$MethodAndArgsCaller.run(Zygote.java:327)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1374)
Caused by: java.lang.NullPointerException: Attempt to invoke virtual method ‘boolean android.app.KeyguardManager.inKeyguardRestrictedInputMode()’ on a null object reference
at com.ansca.corona.SystemMonitor.isScreenLocked(SystemMonitor.java:133)
at com.ansca.corona.CoronaActivity.requestResumeCoronaRuntime(CoronaActivity.java:1977)
at com.ansca.corona.CoronaActivity.onResume(CoronaActivity.java:1794)
at android.app.Instrumentation.callActivityOnResume(Instrumentation.java:1361)
at android.app.Activity.performResume(Activity.java:7361)
at android.app.ActivityThread.performResumeActivity(ActivityThread.java:3765)
at android.app.ActivityThread.handleResumeActivity(ActivityThread.java:3830)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3038)
at android.app.ActivityThread.-wrap11(Unknown Source:0)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1696)
at android.os.Handler.dispatchMessage(Handler.java:105)
at android.os.Looper.loop(Looper.java:164)
at android.app.ActivityThread.main(ActivityThread.java:6944)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.Zygote$MethodAndArgsCaller.run(Zygote.java:327)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1374)