Problem with Crashing

(Csader) #1

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?

(Ben Edwards) #2

Are you able to run it in the simulator?

(Convinced ST will never be unbroken…) #3

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).

(Csader) #4

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

(Ben Edwards) #5

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.

(Csader) #6

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

(Ronny Carr) #7

@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.

(Csader) #8

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

(Greg) #9

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.

(Andrew Urman) #10

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

(Convinced ST will never be unbroken…) #11


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

(Greg) #12

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.