-
Notifications
You must be signed in to change notification settings - Fork 19
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
java.lang.RuntimeException: TouchThroughTouchHandlerInterface was not set on app activity #5
Comments
Hi @kristfal Yes. This will be the new official repo location. I will move everything until next week to this repo. I did a small research and I can imagine one problem. setActivityListener uses the getCurrentActivity It can be that getCurrentActivity returns null. Are you able to reproduce the problem with one of your users. If yes, I can add a check here for null to see if this is the problem. If the value is null then we have to figure out why. |
Hey! Checked this. Read up on: Essentially, we need to do a null guard in Java side and have a retry timer on the JS side for this. The reason is that RN can call into native side when the app is in background, which can cause null activity. |
Are you that we have to use a timer. When the app comes back from background I think this gets called automatically? |
I think the timer is a safeguard. I don’t fully understand the lifecycle of RN and Android, so I don’t have a solid answer. |
@kristfal I made a new version can you please check it? |
Thanks! I’ll include it next weeks release. |
Hi, I'm running the same error TouchThroughTouchHandlerInterface was not set on app activity, I've installed the lib like this in my package.json ("react-native-touch-through-view": "github:simonhoss/react-native-touch-through-view") is it good ? |
Hi @jeremyscatigna you can use directly the npm package https://www.npmjs.com/package/react-native-touch-through-view Because of the error, did you follow the android installation instruction as described here: https://github.com/simonhoss/react-native-touch-through-view#android-installation |
@simonhoss I can confirm that the fix does indeed prevent the crash, but what happens now is that it doesn't initialize properly in the cases where it would crash. As a result, touches doesn't get passed from the TouchThroughView down to the component underneath. I do believe we need a timer/retry strategy for attaching to the activity to solve this properly. A workaround on our end will be to wait for the app to enter foreground before we initialize the TouchThroughView and Wrapper. |
@kristfal Thank you for the feedback. Is it also not possible to touch trough when you leave the view and enter it again? When my thoughts are right it should then work. If this is correct I have to figure out how we can register again when the app comes back from the background. |
Hey again @simonhoss, we use the touch through view in our “main” view which is never unloaded from the app, so no way to test just that. I’ll have a task to review this in our current sprint. Will likely fix this with a PR. |
Hey Simon,
Is this the new "official" repo location? If so, got a crash report. Affects about 0.1% of our users in production. Any thoughts on root cause?
The text was updated successfully, but these errors were encountered: