gauravsaini93 opened a new issue #1219:
URL: https://github.com/apache/cordova-android/issues/1219
### Issue Type
<!-- Please check the boxes by putting an x in the [ ] like so: [x] -->
- [ ] Bug Report
- [ ] Feature Request
- [X] Support Question
## Description
**Security Exception when tried to run app on physical device.**
```
Package name: io.cordova.hellocordova
Failed to execute shell command "input,keyevent,82" on device: Error:
Command failed with exit code 1: adb -s b4e471c9 shell input keyevent 82
java.lang.SecurityException: Injecting to another application requires
INJECT_EVENTS permission
at android.os.Parcel.createException(Parcel.java:2074)
at android.os.Parcel.readException(Parcel.java:2042)
at android.os.Parcel.readException(Parcel.java:1990)
at
android.hardware.input.IInputManager$Stub$Proxy.injectInputEvent(IInputManager.java:925)
at
android.hardware.input.InputManager.injectInputEvent(InputManager.java:886)
at com.android.commands.input.Input.injectKeyEvent(Input.java:355)
at com.android.commands.input.Input.access$100(Input.java:41)
at
com.android.commands.input.Input$InputKeyEvent.sendKeyEvent(Input.java:203)
at com.android.commands.input.Input$InputKeyEvent.run(Input.java:190)
at com.android.commands.input.Input.onRun(Input.java:107)
at com.android.internal.os.BaseCommand.run(BaseCommand.java:56)
at com.android.commands.input.Input.main(Input.java:71)
at com.android.internal.os.RuntimeInit.nativeFinishInit(Native Method)
at com.android.internal.os.RuntimeInit.main(RuntimeInit.java:380)
Caused by: android.os.RemoteException: Remote stack trace:
at
com.android.server.input.InputManagerService.injectInputEventInternal(InputManagerService.java:665)
at
com.android.server.input.InputManagerService.injectInputEvent(InputManagerService.java:639)
at
android.hardware.input.IInputManager$Stub.onTransact(IInputManager.java:422)
at android.os.Binder.execTransactInternal(Binder.java:1021)
at android.os.Binder.execTransact(Binder.java:994)
```
## Information
I am new to Cordova, I used **getting started guide** to run the sample
application on my physical device. Everything went smoothly until the **cordova
run android** command.
### Command or Code
1.) cordova create MyApp
2.) cordova platform add android
3.) cordova platform add ios
4.) cordova plugin add cordova-plugin-dialogs
5.) cordova plugin add cordova-plugin-network-information
6.) Updated www/js/index.js with
`function onDeviceReady() {
if(navigator.connection.type == Connection.NONE){
navigator.notification.alert('You are not connected to the
internet.');
} else{
window.location = "http://www.mywebsite.domain";
}
}`
7.) Cordova build android
8.) Cordova run android
### Environment, Platform, Device
Machine : Mac mini M1
Device: Red Note 9 Pro with MIUI Global 12.0.2 Stable and Android
10QKQ1.191215.002
Android SDK installed on machine : 11(R), 10(Q)
Usb Debugging: On
Install via USB: On
### Version information
Cordova version: 10.0.0
Latest Android Studio installed.
## Checklist
- [x] I searched for already existing GitHub issues about this
- [x] I updated all Cordova tooling to their most recent version
- [x] I included all the necessary information above
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]