Closed pawlowskim closed 7 years ago
I made a huge mistake, I used iOS token instead of Android :/ Routes works well right now. I have another question. I would like to handle deeplinks manually, so I map them manually, and then I will parse them as well. But when I receive a deeplink, application doesn't shows in foreground. I wanted to send new intent to main activity but when I do, I receive crash from HokoActivity:
04-13 12:54:16.517: E/AndroidRuntime(24448): FATAL EXCEPTION: main
04-13 12:54:16.517: E/AndroidRuntime(24448): Process: com.my_app, PID: 24448
04-13 12:54:16.517: E/AndroidRuntime(24448): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.my_app/com.hokolinks.activity.HokoActivity}: java.lang.NullPointerException: Attempt to invoke virtual method 'java.lang.String android.content.Context.getPackageName()' on a null object reference
04-13 12:54:16.517: E/AndroidRuntime(24448): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2325)
04-13 12:54:16.517: E/AndroidRuntime(24448): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2387)
04-13 12:54:16.517: E/AndroidRuntime(24448): at android.app.ActivityThread.access$800(ActivityThread.java:151)
04-13 12:54:16.517: E/AndroidRuntime(24448): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1303)
04-13 12:54:16.517: E/AndroidRuntime(24448): at android.os.Handler.dispatchMessage(Handler.java:102)
04-13 12:54:16.517: E/AndroidRuntime(24448): at android.os.Looper.loop(Looper.java:135)
04-13 12:54:16.517: E/AndroidRuntime(24448): at android.app.ActivityThread.main(ActivityThread.java:5254)
04-13 12:54:16.517: E/AndroidRuntime(24448): at java.lang.reflect.Method.invoke(Native Method)
04-13 12:54:16.517: E/AndroidRuntime(24448): at java.lang.reflect.Method.invoke(Method.java:372)
04-13 12:54:16.517: E/AndroidRuntime(24448): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:903)
04-13 12:54:16.517: E/AndroidRuntime(24448): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:698)
04-13 12:54:16.517: E/AndroidRuntime(24448): Caused by: java.lang.NullPointerException: Attempt to invoke virtual method 'java.lang.String android.content.Context.getPackageName()' on a null object reference
04-13 12:54:16.517: E/AndroidRuntime(24448): at android.content.ComponentName.<init>(ComponentName.java:77)
04-13 12:54:16.517: E/AndroidRuntime(24448): at android.content.Intent.<init>(Intent.java:4160)
04-13 12:54:16.517: E/AndroidRuntime(24448): at com.my_app.hoko.HokoHelper.notifyNewDeeplink(HokoHelper.java:29)
04-13 12:54:16.517: E/AndroidRuntime(24448): at com.my_app.MainApplication$2.deeplinkOpened(MainApplication.java:100)
04-13 12:54:16.517: E/AndroidRuntime(24448): at com.hokolinks.model.RouteImpl.execute(RouteImpl.java:15)
04-13 12:54:16.517: E/AndroidRuntime(24448): at com.hokolinks.deeplinking.Routing.openDeeplink(Routing.java:249)
04-13 12:54:16.517: E/AndroidRuntime(24448): at com.hokolinks.deeplinking.Routing.handleOpenURL(Routing.java:194)
04-13 12:54:16.517: E/AndroidRuntime(24448): at com.hokolinks.deeplinking.Routing.openURL(Routing.java:165)
04-13 12:54:16.517: E/AndroidRuntime(24448): at com.hokolinks.deeplinking.Deeplinking.openURL(Deeplinking.java:166)
04-13 12:54:16.517: E/AndroidRuntime(24448): at com.hokolinks.deeplinking.Deeplinking.openURL(Deeplinking.java:153)
04-13 12:54:16.517: E/AndroidRuntime(24448): at com.hokolinks.activity.HokoActivity.onCreate(HokoActivity.java:26)
04-13 12:54:16.517: E/AndroidRuntime(24448): at android.app.Activity.performCreate(Activity.java:5990)
04-13 12:54:16.517: E/AndroidRuntime(24448): at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1106)
04-13 12:54:16.517: E/AndroidRuntime(24448): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2278)
04-13 12:54:16.517: E/AndroidRuntime(24448): ... 10 more
04-13 12:54:21.146: E/InputDispatcher(467): channel '1071b7dc com.my_app/com.my_app.MainActivity (server)' ~ Channel is unrecoverably broken and will be disposed!
04-13 12:54:21.153: E/EGL_xap(467): egl: current context mark for deletion
com.my_app.hoko.HokoHelper is my helper that I will use to communicate with JS (because it's react native app).
Hi @pawlowskim,
We tried to figure out the problem, but we have never developed in react native and I don't seem to understand what's going on.
Sorry about that. Is there a chance you can try to follow the error and see what's going on in here?:
com.hokolinks.model.RouteImpl.execute(RouteImpl.java:15)
Thanks
I was able to fix it. Application is opening after depplink opens but I faced other issues. This is most certain related with react. Thanks.
Hi, I'm trying to setup hoko on Android (react-native) app but I got the same error over and over.
After opening the app I got this:
After +/- 30s I got this:
And when I open a smart link (that works on iOS) I got this:
On the web page, in template I cannot see any routes under Android rules as well. Documentation doesn't mention about those errors at all and they coming from the server side so I cannot look through source code of hoko-android as well.
I will appreciate your help