Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug] java.lang.SecurityException: Requires VIBRATE permission #16769

Closed
chocky335 opened this issue Nov 9, 2017 · 6 comments
Closed

[Bug] java.lang.SecurityException: Requires VIBRATE permission #16769

chocky335 opened this issue Nov 9, 2017 · 6 comments
Labels
Ran Commands One of our bots successfully processed a command. Resolution: Locked This issue was locked by the bot.

Comments

@chocky335
Copy link

Is this a bug report?

Yes

Have you read the Contributing Guidelines?

Yes

Environment:

OS: macOS Sierra 10.12.6
Node: 8.4.0
Yarn: 1.3.2
npm: 5.5.1
Watchman: 4.9.0
Xcode: Xcode 9.1 Build version 9B55
Android Studio: 2.3 AI-162.4069837

Packages: (wanted => installed)
react: 16.0.0-alpha.12 => 16.0.0-alpha.12
react-native: ^0.48.4 => 0.48.4

Target Platform: android 5.1.1 (XIAOMI Redmi 3) | Android versions less than 6.0

Steps to Reproduce

  1. Add permission to AndroidManifest.xml:
    <uses-permission android:name="android.permission.VIBRATE"/>
  2. Add to project file
    import { Vibration } from "react-native
  3. Run a vibration
    Vibration.vibrate()

Tried to use:

<uses-permission android:name="android.permission.VIBRATE" />
<uses-permission android:name="android.permission.VIBRATE" android:maxSdkVersion="18" />
 <uses-permission-sdk-23 android:name="android.permission.VIBRATE"/>

This one works for android 6+:

<uses-permission-sdk-23 android:name="android.permission.VIBRATE"/>

Expected Behavior

It shouldn't throw an error

Actual Behavior

it doesn't work

Reproducible Demo


@mihaiblaga89
Copy link

same problem here

@wangghon
Copy link

wangghon commented Dec 13, 2017

@chocky335 have you tired both together?
uses-permission-sdk-23 android:name="android.permission.VIBRATE"
uses-permission android:name="android.permission.VIBRATE"
I am wondering if the 2 permissions would cover all the version of Android from 4.x to 8.0

@Squidski
Copy link

Squidski commented Feb 1, 2018

Same problem here. I do have an external library that uses a vibration that works just fine, so obviously the permission is working for some things. I just can't use the React Native built-in vibration system.

@react-native-bot
Copy link
Collaborator

Thanks for posting this! It looks like you may not be using the latest version of React Native, v0.53.0, released on January 2018. Can you make sure this issue can still be reproduced in the latest version?

I am going to close this, but please feel free to open a new issue if you are able to confirm that this is still a problem in v0.53.0 or newer.

How to ContributeWhat to Expect from Maintainers

@react-native-bot react-native-bot added Ran Commands One of our bots successfully processed a command. Stale There has been a lack of activity on this issue and it may be closed soon. labels Feb 24, 2018
@stale stale bot removed the Stale There has been a lack of activity on this issue and it may be closed soon. label Feb 24, 2018
@okkan
Copy link

okkan commented Mar 6, 2018

I'm having same problem on RN 0.53.0 with

<uses-permission android:name="android.permission.VIBRATE"/>

but

<uses-permission-sdk-23 android:name="android.permission.VIBRATE"/>

works.

@drorbiran
Copy link

We are experiencing the same issue.
In a native project, this will work
<uses-permission android:name="android.permission.VIBRATE"/>
But when using Vibration from React-Native only using:

<uses-permission-sdk-23 android:name="android.permission.VIBRATE"/>

works and only for Android 6+. android < 6 will crash.

@facebook facebook locked as resolved and limited conversation to collaborators Feb 24, 2019
@react-native-bot react-native-bot added the Resolution: Locked This issue was locked by the bot. label Feb 24, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Ran Commands One of our bots successfully processed a command. Resolution: Locked This issue was locked by the bot.
Projects
None yet
Development

No branches or pull requests

7 participants