# Native Android app crashes on open

**URL:** <https://community.thunkable.com/t/native-android-app-crashes-on-open/1388113>\
**Category:** Questions about Thunkable X\
**Created:** [July 9, 2021, 11:35pm UTC](https://community.thunkable.com/t/native-android-app-crashes-on-open/1388113 "2021-07-09T23:35:10Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![bnice](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/bnice/32/110648_2.png) [@bnice](https://community.thunkable.com/u/bnice)\
**Post date:** [July 9, 2021, 11:35pm UTC](https://community.thunkable.com/t/native-android-app-crashes-on-open/1388113/1 "2021-07-09T23:35:10Z")

</div>

Hello,  
I am having an issue with one of my apps. I am testing this app over a variety of platforms: Desktop web, iOS native, iOS web, Thunkable Live, Android web, and Android Native. My app works on all of these except for the Android native. I have rearranged things, tried to minimize code, etc. No luck. My test user is able to open the app and get to my “Sign In” screen, and then it crashes. After the first download, it crashes just on the open, so it doesn’t even make it to the “Sign In” page. I will attach screenshots of my first two screens. (It doesn’t get past these) Any help would be much appreciated. My deadline for the demo is early next week. Thanks in advance!  
**Screen one (Opening loading screen)**

 ![Screen1](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/0/0/002187e1b74ed28cb6e5e3a58d9874e869b21006.png)

**Screen two (Sign-In Screen)**

 ![Screen2](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/a/0/a09cbfa64a90bb5f03e00d11b8515f607974c22b.png)

---

<div class="post-metadata">

**Author:** ![catsarisky](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/catsarisky/32/100661_2.png) [@catsarisky](https://community.thunkable.com/u/catsarisky)\
**Post date:** [July 10, 2021, 12:24am UTC](https://community.thunkable.com/t/native-android-app-crashes-on-open/1388113/2 "2021-07-10T00:24:44Z")

</div>

You’re not checking that stored variable TechID is not null before you check if your list contains it.

---

<div class="post-metadata">

**Author:** ![catsarisky](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/catsarisky/32/100661_2.png) [@catsarisky](https://community.thunkable.com/u/catsarisky)\
**Post date:** [July 10, 2021, 12:49am UTC](https://community.thunkable.com/t/native-android-app-crashes-on-open/1388113/3 "2021-07-10T00:49:40Z")

</div>

That’s pretty straightforward code, and although I suggested that not checking for null might be a problem, I can’t cause the crash with sample code. I wonder if this is the same bug reported here:

> [@App keeps crashing on Android APK & Live](https://community.thunkable.com/t/app-keeps-crashing-on-android-apk-live/1309554/28):
>
> This is what I did for the web viewer to work (DnD UI) to make it work. It never worked good if set to invisible. [image]

It looked like the “navigate to” blocks were the problem initially (which was really weird!), but turned out to be an invisible web viewer problem, and it was an android specific problem. Any chance you’ve got an invisible web viewer somewhere on one of the screens you’re supposed to be navigating to?

---

<div class="post-metadata">

**Author:** ![bnice](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/bnice/32/110648_2.png) [@bnice](https://community.thunkable.com/u/bnice)\
**Post date:** [July 10, 2021, 1:45am UTC](https://community.thunkable.com/t/native-android-app-crashes-on-open/1388113/4 "2021-07-10T01:45:29Z")

</div>

I don’t have any web viewers on either of those screens. I have some later, but I believe they are all visible. They are later in the app anyway.

---

<div class="post-metadata">

**Author:** ![catsarisky](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/catsarisky/32/100661_2.png) [@catsarisky](https://community.thunkable.com/u/catsarisky)\
**Post date:** [July 10, 2021, 1:46am UTC](https://community.thunkable.com/t/native-android-app-crashes-on-open/1388113/5 "2021-07-10T01:46:37Z")

</div>

Rats.

If you put a vibrate block right before the navigate block, does the phone vibrate before crashing?

---

<div class="post-metadata">

**Author:** ![bnice](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/bnice/32/110648_2.png) [@bnice](https://community.thunkable.com/u/bnice)\
**Post date:** [July 10, 2021, 1:58am UTC](https://community.thunkable.com/t/native-android-app-crashes-on-open/1388113/6 "2021-07-10T01:58:29Z")

</div>

I will give that a try. I am an iOS user, and my primary Android phone walked out of the office an hour ago. I have an old Android I can try it with. But of course, I get to wait the lovely wait time for the APK to compile and send to my email 🙂

---

<div class="post-metadata">

**Author:** ![catsarisky](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/catsarisky/32/100661_2.png) [@catsarisky](https://community.thunkable.com/u/catsarisky)\
**Post date:** [July 10, 2021, 2:00am UTC](https://community.thunkable.com/t/native-android-app-crashes-on-open/1388113/7 "2021-07-10T02:00:05Z")

</div>

Does it only crash in a downloaded apk, not in live?

---

<div class="post-metadata">

**Author:** ![bnice](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/bnice/32/110648_2.png) [@bnice](https://community.thunkable.com/u/bnice)\
**Post date:** [July 10, 2021, 2:01am UTC](https://community.thunkable.com/t/native-android-app-crashes-on-open/1388113/8 "2021-07-10T02:01:10Z")

</div>

I have not tried it with live on Android (Didn’t think if that)… it doesn’t on web. Again, it’s someone else’s phone for the Android, so I try not to ask them to install too much.

---

<div class="post-metadata">

**Author:** ![muneer](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/muneer/32/75210_2.png) [@muneer](https://community.thunkable.com/u/muneer)\
**Post date:** [July 10, 2021, 2:49am UTC](https://community.thunkable.com/t/native-android-app-crashes-on-open/1388113/9 "2021-07-10T02:49:35Z")

</div>

What does `sthRememberLogInID` (in Login screen) suppose to contain?

---

<div class="post-metadata">

**Author:** ![bnice](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/bnice/32/110648_2.png) [@bnice](https://community.thunkable.com/u/bnice)\
**Post date:** [July 10, 2021, 2:59am UTC](https://community.thunkable.com/t/native-android-app-crashes-on-open/1388113/10 "2021-07-10T02:59:10Z")

</div>

sth Is my shorthand for switch. This is referencing the toggle switch which says “Remember Me” on the login screen.

And I have an update that is essentially saying “Ha, you didn’t investigate, and here are the consequences”. I booted up my old Android which is running 8.1.0, and I installed both the Thunkable Live app and the APK for my app, and it all worked perfectly. I am now thinking the problem was with my tester user’s device and not the app. (Although, I thought I saw something that was saying OS 9 was having some problems, so it might have been in that too.) Thank you all for your help.

---

<div class="post-metadata">

**Author:** ![muneer](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/muneer/32/75210_2.png) [@muneer](https://community.thunkable.com/u/muneer)\
**Post date:** [July 10, 2021, 4:31am UTC](https://community.thunkable.com/t/native-android-app-crashes-on-open/1388113/11 "2021-07-10T04:31:56Z")

</div>

Android 9 is more strict and it is where the `web viewer` visibility issue started.

When you have a chance to test again with a device having Android 9 test you condition in the first screen

 ![Screenshot_20210710_072528](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/1/5/1540fedc6256a904e7a62efdeb1e98d6921cc472.jpeg)

And make it only test for `null` and see if it takes you to your Login screen every time not only the first time.

---

<div class="post-metadata">

**Author:** ![Balanced\_Kitchen](https://avatars.discourse-cdn.com/v4/letter/b/839c29/32.png) [@Balanced\_Kitchen](https://community.thunkable.com/u/Balanced_Kitchen)\
**Post date:** [July 10, 2021, 6:03am UTC](https://community.thunkable.com/t/native-android-app-crashes-on-open/1388113/12 "2021-07-10T06:03:15Z")

</div>

The intervention of Thunkable’s staff is definitely needed. Time to clarify or stop options that would cause failures. I’ve been researching my project for a month now and found that the crash possibilities are endless and not limited to the web viewer, gifs also cause crashes, date viewers can also crash in certain conditions, navigators too. In general, all crashes are caused by parameters in the design of the screen and I think it is caused by the last update of about no more than a month. Before that, my application was running on Android 10. About a month ago, it suddenly started collapsing 🙂 . But when it comes to this platform, each problem can be individual

You just wake up in the morning and realize that something is wrong with your app!

---

<div class="post-metadata">

**Author:** ![bnice](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/bnice/32/110648_2.png) [@bnice](https://community.thunkable.com/u/bnice)\
**Post date:** [July 10, 2021, 3:06pm UTC](https://community.thunkable.com/t/native-android-app-crashes-on-open/1388113/13 "2021-07-10T15:06:33Z")

</div>

Well, now that you mention it, my app does have a GIF on both my loading and login screen. It sounds like you have had an issue with this before?

@muneer Is this issue with only Android 9. I think my test user has a newer phone, so there is a good chance it is running higher than 9. Would they be getting the same issue?

---

<div class="post-metadata">

**Author:** ![muneer](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/muneer/32/75210_2.png) [@muneer](https://community.thunkable.com/u/muneer)\
**Post date:** [July 10, 2021, 5:40pm UTC](https://community.thunkable.com/t/native-android-app-crashes-on-open/1388113/14 "2021-07-10T17:40:55Z")

</div>

I would not blame Android 9 only. It must be something changed within Thunkable codes or in the updated React Native libraries. Things were working fine but the last couple of updates from Thunkable side really made me re-visit my codes to make them work again. I am sure my `web viewer` component was working while set to **invisible** but suddenly stopped.

I use a lot of JavaScript codes to make certain options available like reading and writing text files but since the last couple of updates JavaScript that are loaded as assets in the project do not work on Android.

GIF seems to act weird when made as background of a column in the screen but works well when used directly as the background of the screen and other small issues.

I hope to have answered your question.

---

<div class="post-metadata">

**Author:** ![bnice](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/bnice/32/110648_2.png) [@bnice](https://community.thunkable.com/u/bnice)\
**Post date:** [July 12, 2021, 3:37pm UTC](https://community.thunkable.com/t/native-android-app-crashes-on-open/1388113/15 "2021-07-12T15:37:42Z")

</div>

Hello everyone,  
I have an update on this issue. I opened my testing pool and I tried what @catsarisky said regarding adding a vibrating block before the screen switch. All of the newer devices I tested (Which are somewhere around Android 10 or 11) complete the vibrate but fail and crash (Hard) on the screen switch. Does anyone have any further thoughts?

---

<div class="post-metadata">

**Author:** ![catsarisky](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/catsarisky/32/100661_2.png) [@catsarisky](https://community.thunkable.com/u/catsarisky)\
**Post date:** [July 12, 2021, 3:43pm UTC](https://community.thunkable.com/t/native-android-app-crashes-on-open/1388113/16 "2021-07-12T15:43:05Z")

</div>

It’s probably not the navigate block, but where the navigate block is going TO.

---

<div class="post-metadata">

**Author:** ![bnice](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/bnice/32/110648_2.png) [@bnice](https://community.thunkable.com/u/bnice)\
**Post date:** [July 12, 2021, 4:06pm UTC](https://community.thunkable.com/t/native-android-app-crashes-on-open/1388113/17 "2021-07-12T16:06:10Z")

</div>

Here is the screen I am going to next. It is my home screen which has a navigation, hidden text box (DevMode code), and a data viewer list. It is really simple. Here are the screenshots. What do you think?

Screen:

 ![HomeScreen](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/0/7/076111beb635bdb55bf711c0f55f2ac1781677e6.png)

Code:

 ![HomeCode](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/8/e/8ef41a8948c39f256acffd91b4febbd52c8d4909.png)

---

<div class="post-metadata">

**Author:** ![catsarisky](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/catsarisky/32/100661_2.png) [@catsarisky](https://community.thunkable.com/u/catsarisky)\
**Post date:** [July 12, 2021, 4:29pm UTC](https://community.thunkable.com/t/native-android-app-crashes-on-open/1388113/18 "2021-07-12T16:29:33Z")

</div>

I’d speculate its that data viewer refresh - if you disconnect that block, does the crash go away?

Crashes on refresh were reported here:

> [@Refresh Data List View causing Live crash](https://community.thunkable.com/t/refresh-data-list-view-causing-live-crash/1231432/3):
>
> Same issue here! I make heavy use of the data view list / grid and two of them crash everytime I refresh them. Any ideas anyone?

> [@Data Viewer List glitches when visibility is changed](https://community.thunkable.com/t/data-viewer-list-glitches-when-visibility-is-changed/1325923):
>
> Hi there, When the screen opens, the data viewer automatically starts loading itself & I also have another normal text list-viewer to load its content. I’ve created a custom top-tab navigator (it just has buttons instead) The buttons’ job is to switch back and forth (hide & show) on both lists. When the screen opens, the data viewer is shown first, and when I switch to my text-list tab & come back to the data viewer tab, the data viewer sort of whites out(?) It just glitches and creates huge g…

---

<div class="post-metadata">

**Author:** ![bnice](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/bnice/32/110648_2.png) [@bnice](https://community.thunkable.com/u/bnice)\
**Post date:** [July 12, 2021, 5:04pm UTC](https://community.thunkable.com/t/native-android-app-crashes-on-open/1388113/19 "2021-07-12T17:04:48Z")

</div>

@catsarisky No, I took the block out and it still didn’t work.

---

<div class="post-metadata">

**Author:** ![catsarisky](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/catsarisky/32/100661_2.png) [@catsarisky](https://community.thunkable.com/u/catsarisky)\
**Post date:** [July 12, 2021, 5:08pm UTC](https://community.thunkable.com/t/native-android-app-crashes-on-open/1388113/20 "2021-07-12T17:08:33Z")

</div>

Interesting. I’d start unplugging blocks from that screen until it stops crashing.

Does app variable DevMode exist and have a value?

[Next page](https://community.thunkable.com/t/native-android-app-crashes-on-open/1388113.md?page=2)
