Problem with Crashing

I’m trying to write a smartapp based on the code in an existing SmartApp by Barry A. Burke called “Home on Code Unlock”. The premise of my SmartApp is not drastically different from Barry’s, but the problem is that when I install the app and try to configure it, the entire Android SmartThings app crashes.

Given that I can’t configure the smartapp, I can’t even uninstall it now. Any ideas why that smartapp is crashing the SmartThings app?

Are you able to run it in the simulator?

Ben I am seeing this too with the first app I created. Crashes on config… works fine in simulator. My app code is at:

I am growing frustrated as every “not quite out of the box” thing I have tried with SmartThings has failed (miserably).

@Ben I’ve never been able to figure out how to run the simulator…

How are you writing that app? If you are using the IDE (which I assume you are) the simulator is just to the right of that.

I am using the IDE, but the only thing on the right is “Location”

@csader select a location in the drop down and then you can start installing the app in the IDE. You can use your real devices to test or virtual devices. Keep in mind, they are installed just like any app from within the mobile app. So they will continue to run even after leaving the IDE. You need to uninstall them from the app code page or from the SmartApps page.

@ronnycarr I have “Home” selected, but nothing happens. I see a “Set Location” button, but that doesn’t seem to do anything.

By any chance does your app have an input type set as a “string”? Instead of a “number” or “text”? I found that apps containing the type “string” would crash the Android app but work OK in the simulator and work OK in the iOS app. If, so change it to “text” or “number”. Assuming it is an input that is not an item selection, etc.

1 Like

@gwithers105 I think you’re right. The Android app has trouble with preferences and some types of inputs.

@gwithers105

BINGO!!! Thanks for this. You have saved much tooth enamel.

That took me a while to figure out. It was a matter of removing code in the app until it stopped crashing and then adding them back to find the offending code. For a while I just used my iOS device to work the apps that had this code but that got annoying so I set to fixing it. Glad you didn’t have to spend the time figuring this out.