Best practices to avoid crash on android

I have many problems with apps that works fine on IoS, but keeps crashing on Android at load.

Is there some best practices on what to do / not to do, to make sure that it will work on both platforms?.

1 Like

We have a few issues documented on our troubleshooting page but we’re curious to know the other issues users are facing.

Albert

Hi Albert
I have tried to check thet troubleshooting page, but that did not solve it.

I have tried alot more today, and have found out that every page needs a open and a start block (Even it they don’t do anything).
Adding that solved many crashes on my pages.

At the moment it only seems to crash on anything related to maps markes or positions if configured via a block. (I thought you solved that. ?.).

Is there a way to solve this at the moment?.

Claus,

Is there any chance that you could share with us a simple app that crashes without a start and open block but works with them defined and empty? That might help us a lot in diagnosing the problem!

Thanks in advance.

-Mark

2 Likes

Hi Mark,

I also have problems with the android app. It crashes when the app is loading, which is not an issue on the iOS. I tried to make a simple app but it did not crash there. How can I show you my app? Could you help me with that?

(My app includes tab navigator with 3 screens, Webviewer, share, local DB, buttons, List_viewers.)

I am looking forward to your response.

Cheers,
Serdar

I have tried to reproduce it in a new simple app, but for some reason, that works fine.

Maybe it is some combination with other pages. I will keep testing, to see what causes the crash.

What about the map component, is there any hope to get that to work on Android?.

Claus

Same here. My app works fine on IOS, but crashes immediately on Android (Genymotion emulator).
In the log, the following message shows up, maybe that is a clue?

2018-09-01%2021_52_00-Window

@Mark also willing to share my app, if that is helpful for you. Just let me know if you are interested.

Regards
Rob

How do you get a log output?..

Claus

When the app crashes, I get a screen with a button “show log”. :wink:
Don’t know if that is Genymotion specific or normal Android.

Regards Rob

Thanks, Claus. Let us know what you find!

We were not aware of the map component not working on Android. Would you please file a bug here about that.

-Mark

Thanks, @Rob_Schoemaker! If you can share a relatively simple app that demonstrates the problem it would be very helpful. Unfortunately the error message that you mentioned is pretty generic and not all that helpful :frowning:

-Mark

Serdar, Here are the instructions for sharing your app. If it’s possible to simplify your app and still have it crash, that would be most useful.

-Mark

Hi Mark,

Thank you. I just removed the simplest screen and added again and it worked out just by luck and I cannot reproduce the crash anymore. :slight_smile:

Serdar

I will do that…

This block will crash the android app every time.

@Claus_Holbech, Can you try passing numbers instead of strings to the Add Marker block and let me know if that works?

Mark,

This is a stripped version of my app (only the first two screens). Also, of course the Firebase calls don’t work anymore, but still this version works on IOS and crashes on Android (immediately after launch, even before it switches to the second screen). Hope this helps for identifying the issue.

https://x.thunkable.com/copy/5df52d25397baf820f5ae97fe0f8836e

Regards Rob

Thanks, Rob. We’ll take a look.

-Mark

Thanks… In my project, I had qouted my lat and long values in the json output.
Removing those solved the crashes on android.

Claus

Yes, that is what I meant when i said to “try passing numbers instead of strings” in my reply above. Great to hear that your crashes were solved!

-Mark

Hi @Mark
Just to let you know that it occured to me that maybe the issue was caused because the local storage blocks are executed async and maybe I created some kind of race condition by first writing and immediately reading from local storage (write not finished at the moment i read). So I changed my blocks as follows:

However, the Android version still crashes. (same error message as reported before)

Regards Rob

BTW: Just to clarify: I write the value and read immediately as a temporary “quick and dirty” fix: the current version of the app is just for one team, but in the future i want to extend that to multiple teams. So the idea is that if “teamid” does not exist, the user will be presented a screen to select the team, which is then stored in local storage. All the other screens use the teamid to load the correct data from firebase. So for now, I just write the team hard-coded.