App Inventor 2: RUNTIME ERROR: Invalid Destination Address. (What should I do?)

447 views
Skip to first unread message

Mark Kesselring

unread,
Oct 21, 2016, 1:00:17 AM10/21/16
to mitappinv...@googlegroups.com

Hello everyone, I am making an app that texts a parent every certain amount of minutes(selected on a spinner) with the child's (person with the phone that contains the app)  location.

Although I am getting an error message right when I launch the app, I get this Runtime Error:


I was not getting this error when my code was like this:





Then I wanted the people to be able to be able to choose every x minutes it would send the message, and I did that:





After I did that, my app started getting that error when I launch it. What do I do to fix it? Thank you!

Abraham Getzler

unread,
Oct 21, 2016, 11:38:58 AM10/21/16
to MIT App Inventor Forum
How long does the location tracker component take to get a fix on current location?

What do you get if you ask it too soon?

What is the value of a Spinner Selection before the Spinner has been touched?

ABG

Mark Kesselring

unread,
Oct 21, 2016, 12:20:03 PM10/21/16
to MIT App Inventor Forum
Thank for answering Abraham, so this is a screenshot of the component Location Tracker:





This is of the spinner:




And what do you mean by: 
"What do you get if you ask it too soon?"


Thank you for helping!


Abraham Getzler

unread,
Oct 21, 2016, 12:31:44 PM10/21/16
to MIT App Inventor Forum
And what do you mean by: 
"What do you get if you ask it too soon?"


I haven't used the Location Tracker component yet, but I assume it works by GPS technology.
 
My GPS take a while to gather satellite data before it can tell me where I am.
In the meantime, it shows a message to that effect.

What does the   Location Tracker  return under such circumstances?
I don't see any blocks to test for such a situation in your code.

Would changing the default Selection of the Spinner to something longr (more patient) help?

ABG

Abraham Getzler

unread,
Oct 21, 2016, 12:34:56 PM10/21/16
to MIT App Inventor Forum
From the Designer help (?) on that component:

Non-visible component providing location information, including longitude, latitude, altitude (if supported by the device), speed (if supported by the device), and address. This can also perform "geocoding", converting a given address (not necessarily the current one) to a latitude (with theLatitudeFromAddress method) and a longitude (with theLongitudeFromAddress method).

In order to function, the component must have its Enabledproperty set to True, and the device must have location sensing enabled through wireless networks or GPS satellites (if outdoors).

Location information might not be immediately available when an app starts. You'll have to wait a short time for a location provider to be found and used, or wait for the OnLocationChanged event

ABG 

Mark Kesselring

unread,
Oct 21, 2016, 12:37:59 PM10/21/16
to MIT App Inventor Forum
It returns the current address, in this case, and if the app was already on, it would just keep on sending the message, if it was not, the user would have to set it on the UI.
Changing the default Selection of the Spinner didn't help.

I attached the .aia document so you can take a better look at it.


testwhereareyou__v5.aia

Mark Kesselring

unread,
Oct 21, 2016, 12:43:49 PM10/21/16
to MIT App Inventor Forum

I don't understand why when I was setting the clock timeInterval to 3000, the app would not give me this error, and then when I set it to 60000 x SpinnerSelection it gives me that error.

Abraham Getzler

unread,
Oct 21, 2016, 12:55:40 PM10/21/16
to MIT App Inventor Forum
See this GPS post:
and the doc it mentions.

Also, how soon does your device go to sleep?

ABG

Mark Kesselring

unread,
Oct 21, 2016, 1:02:07 PM10/21/16
to MIT App Inventor Forum
I did not see anything relating to my error on that post.
And my device go to sleep after 10 minutes without using it. Why would this help?

Abraham Getzler

unread,
Oct 21, 2016, 2:15:35 PM10/21/16
to MIT App Inventor Forum
I should have started my diagnosis here ...
https://www.google.com/search?q=RUNTIME+ERROR%3A+Invalid+Destination+Address

It was the SMS address.
The posts in the search tell how to avoid it.

ABG

Reply all
Reply to author
Forward
0 new messages