使用 Trigger.IO Forge 构建 Android / html 混合应用程序。使用 Android 密钥库签署应用程序,运行构建,转移到手机。
成功启动应用程序,它打开了。尝试使用 Facebook (Forge.facebook.authorize) 登录 - 在 ABD Logcat 中看到有关不匹配 Facebook 密钥哈希的错误:
D/Forge (14638): Returning: {"content":{"type":"EXPECTED_FAILURE","message":"i
nvalid_key:Android key mismatch. Your key \"mykeywasherexxxxxxxxx\" does n
ot match the allowed keys specified in your application settings. Check your app
lication settings at http:\/\/www.facebook.com\/developers"},"status":"error","c
allid":"89C92BE0-XXXX-4E13-BA20-19F330DF353E"}
在developers.facebook.com 上更新了keyhash
现在,当应用程序启动时,初始 html 屏幕(如成功登录后所见)部分呈现,然后应用程序立即崩溃。从 logcat 捕获:
D/AndroidRuntime(11373): Shutting down VM
W/dalvikvm(11373): threadid=1: thread exiting with uncaught exception (group=0x4
0f80300)
E/AndroidRuntime(11373): FATAL EXCEPTION: main
E/AndroidRuntime(11373): java.lang.NullPointerException
E/AndroidRuntime(11373): at io.trigger.forge.android.core.ForgeActivity$2
.onConsoleMessage(ForgeActivity.java:179)
E/AndroidRuntime(11373): at android.webkit.CallbackProxy.handleMessage(Ca
llbackProxy.java:796)
E/AndroidRuntime(11373): at android.os.Handler.dispatchMessage(Handler.ja
va:99)
E/AndroidRuntime(11373): at android.os.Looper.loop(Looper.java:137)
E/AndroidRuntime(11373): at android.app.ActivityThread.main(ActivityThrea
d.java:4745)
E/AndroidRuntime(11373): at java.lang.reflect.Method.invokeNative(Native
Method)
E/AndroidRuntime(11373): at java.lang.reflect.Method.invoke(Method.java:5
11)
E/AndroidRuntime(11373): at com.android.internal.os.ZygoteInit$MethodAndA
rgsCaller.run(ZygoteInit.java:786)
E/AndroidRuntime(11373): at com.android.internal.os.ZygoteInit.main(Zygot
eInit.java:553)
E/AndroidRuntime(11373): at dalvik.system.NativeStart.main(Native Method)
W/ActivityManager( 304): Force finishing activity com.wewana.play/io.trigger.
forge.android.core.ForgeActivity
D/dalvikvm( 304): GC_FOR_ALLOC freed 1780K, 21% free 32600K/41031K, paused 106m
s, total 106ms
D/Forge (11373): Native call "launchimage.hide" with task.params: {}
D/Forge (11373): Returning: {"status":"success","callid":"15C77379-8B2F-4DBC-9
34D-0D1B0BB96E14"}
W/ActivityManager( 304): Activity pause timeout for ActivityRecord{41fe8630 com
.wewana.play/io.trigger.forge.android.core.ForgeActivity}