system.vibrate() causes crash

I am using the Corona SDK on a Windows Machine and tested on an Incredible running Android 2.2.1.

In the Simulator, system.vibrate() does nothing. The documentation says it should beep.

On the phone, system.vibrate() causes the app to crash immediately.

Any advice? [import]uid: 70391 topic_id: 12820 reply_id: 312820[/import]

Did you remember to include the correct Android permission for your device? You need android.permission.VIBRATE in your build.settings
http://developer.anscamobile.com/content/configuring-projects#Application_Permissions_Android [import]uid: 6787 topic_id: 12820 reply_id: 47221[/import]

Snarla,

  1. Thanks a lot (re: very much) for your response, I had not considered this page and will review

  2. I was under the impression Vibrate was a permission Corona Apps requested by default (?)

  3. Should it really crash if Vibrate permission is not granted? Any way to check first via code if vibrating is a-ok? What if the user denies vibrate permission to their apps via Android, will my app still crash then? If so I would consider this a bug. [import]uid: 70391 topic_id: 12820 reply_id: 47230[/import]

I have added a build.settings file with android.permission.VIBRATE included, and it still does not beep when called in Simulator, as the documentation says it should. [import]uid: 70391 topic_id: 12820 reply_id: 47291[/import]

The Android permission is so that it does not crash on Android device.
The not producing sound on Windows Simulator is a bug, thanks for reporting it! [import]uid: 6787 topic_id: 12820 reply_id: 47399[/import]

could you please post an example code of your build file? im having the same issue, but when i add android.permission.VIBRATE to my build file it screws up the orientation of my game, i have it setup to play horizontally

this is what i have:
[lua]android.permission.VIBRATE

settings =
{
orientation =
{
default = “landscapeRight”,
supported =
{
“landscapeLeft”, “landscapeRight”
}
}
}[/lua] [import]uid: 19620 topic_id: 12820 reply_id: 48864[/import]

“android.permission.VIBRATE”
What about iOS? [import]uid: 75366 topic_id: 12820 reply_id: 50173[/import]

No need to set permissions for iOS in order to allow vibration - or any other permission… [import]uid: 68130 topic_id: 12820 reply_id: 50593[/import]

Can bring us an example project? Can’t find help in google, forums etc

Can bring us an example project? Can’t find help in google, forums etc