-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
Android: Random crash with map view in Ti.UI.ListSection footer #13243
Comments
maybe this can help to debug a bit more: https://stackoverflow.com/questions/42205827/add-fragment-in-recyclerview-viewholder |
I hereby offer a bounty for fixing this issue in the SDK and/or ti.map. Is there anyone able to hack on this? |
Doesn't the trick with |
It does work so far, but the rendering is (visibly) delayed and iOS lags as well, causing a platform-specific implementation of the map. A fixed Android version would eliminate those issues. |
Actually, it still rarely crashes with the same error |
@hansemannn can you please try this one: |
Thanks Michael! Is there a commit I could cherry pick? We use a highly adjusted version of ti.map 😗 |
Sure: https://github.com/m1ga/ti.map/tree/testing |
Will test asap already! Note for later cleanup: Rename layout_lottie with layout_map 😇 |
yes 😄 At the moment I'm even not sure if the XML is needed at all. Was testing multiple stuff at once 🤣 |
Unfortunately I cannot test it, yet, because it collides with ti.animation:
Likely because of the same XML file? Will test later then! |
oh interesting. I've updated the name |
Interesting, thank you! Now it renders, but none of the properties are applied anymore (like annotations, mapStyle, padding etc.). EDIT: And sometimes it now doesn't render at all. |
ok, but it looks like we can change ti.map instead of stuff in the SDK 👍 Makes it a bit quicker to debug. |
I don't think so. Internally, you still use a A possible solution would be:
But I'm not sure how it will affect regular views (performance-wise). |
@drauggres Very interested in that approach! Another one could be https://developers.google.com/maps/documentation/android-sdk/lite which may be enough because the map does not have any interaction required |
@hansemannn |
Then it has to be the recyclerview itself. Worst case, it would need a static generated image..This now really shows the Titanium limits. |
prevent crash when using ti.map inside a ListView ref TIMOB-28583 fix tidev#13243
@hansemannn please try this patch: Though it does not crash, I'm not sure about memory leaks. UPD: I mean, if there was a memory leak, this patch does not fix it, but it shouldn't create more "leakage". |
Looking very good 👍 My test app doesn't crash! |
Whaaat? Super excited here! @drauggres Will try to test your solution as well! |
@drauggres Unfortunately still crashing sporadically :( |
with the same |
It's always |
ah ok, the "no view" part is the next line.
|
@hansemannn Please look for stacktrace in logcat. |
Checking! Never saw the above trace actually. But maybe crashlytics grabs it away, which I can't think of. Will check with adb logcat. |
When I remove the |
don't use my patched ti.map version! With the normal ti.map I had annoations and click working |
I don't. Having no changes on ti.map right now, but it could be a migration issue from moving back to the non-postlayout config. EDIT: NOT related to this change (!) Has to be something from the migration back. So the patch looks VERY solid right now! EDIT 2: Annotation issue was a client-side issue. Testing with a wider range of devs now. Still looks promising, @drauggres! |
Okay, so the crashes are now gone completely. What we do notice is that when opening the map view in non-listviews (e.g. own window), the map is always stuck at the equator line, which works 1:1 when changing the SDK version back. It may be fixable by timeout, because we currently use timeouts as well which may need to wait a bit longer now.
EDIT 2: The only glitch remaining is that the map is now redrawn every time a user scrolls down and up again. We still have to verify if thats only during your chance, but it's probably a whole other issue. EDIT 3: Confirmed: The redrawing is not happening with the old version. The new version also removes all polylines, which is very odd. The liteMode may help for that, but I am unsure how your change could have caused this. |
My guest is that you set location and do other api calls before map is actually created. |
liteMode has other issues with the patch. But I can confirm that the polyline is gone and there is a refresh. But my |
The region can be set with a small timeout (50ms) which works then, but the flickering is really odd. |
https://github.com/drauggres/ti.map.tests This app based on code from |
Nice test app. Multimap crashed for me the first time:
2nd time I could open it (I opened other items before). |
Yes, it also crashing in 10.1.1.GA. |
ah, wait. That issue is here: tidev/ti.map#480 with a "fix" inside. |
On the bright side, now it works more correctly: it frees resources. lol |
execution transaction on every "onAttachedToWindow" cause loss of objects on map refs tidev#13243
execution transaction on every "onAttachedToWindow" causes loss of objects on map refs tidev#13243
master...drauggres:bug/map_in_listview UPD: this should fix the problem with polylines. |
…ew being attached to a window prevent crash when using ti.map inside a ListView ref TIMOB-28583 fix tidev#13243
…iew being attached to a window prevent crash when using ti.map inside a ListView ref TIMOB-28583 fix tidev#13243
…iew being attached to a window prevent crash when using ti.map inside a ListView ref TIMOB-28583 fix tidev#13243
Quick update here: I thought we fixed it already by removing some duplicate re-rendering, but it sometimes happens again now. I will test your PR in more detail now! :) Do you know by any chance if the Btw: I will reach out to you the next weeks for the promised bounty! Didn't forget that - really thankful for your help here! 🚀 |
I have to reopen this one :( We still get some crashes:
A similar crash was reported for RN as well: software-mansion/react-native-screens#463 and it seems like it could be something related to the "FragmentTransaction" class and how it is reused (which would make sense in a ListView context). Happy to sponsor any work on this fix again! EDIT: Added it via a new issue in #13399! |
prevent crash when using ti.map inside a ListView ref TIMOB-28583 fix tidev#13243
https://jira.appcelerator.org/browse/TIMOB-28583
Exception
App sample
Original discussion
I think the reason is a race condition between FragmentTransaction and attaching view to a window, i.e. app will crash when the transaction is executed before the view has been attached.
P.S. somehow connecting to the app with debugger make it harder to reproduce the problem.
The text was updated successfully, but these errors were encountered: