androidthings / sample-simplepio

Basic Peripheral I/O examples with Android Things
Apache License 2.0
187 stars 79 forks source link

Error on openGpio(pinName) Caller lacks required permission com.google.android.things.permission.USE_PERIPHERAL_IO #8

Closed ideepdave closed 6 years ago

ideepdave commented 6 years ago

Facing Problem While running first blink app with RbPi 3 Caused by: java.lang.SecurityException: Caller lacks required permission com.google.android.things.permission.USE_PERIPHERAL_IO at android.os.Parcel.readException(Parcel.java:2004) at android.os.Parcel.readException(Parcel.java:1950) at com.google.android.things.pio.IPeripheralManagerClient$Stub$Proxy.GetGpioClient(IPeripheralManagerClient.java:759) at com.google.android.things.pio.GpioImpl.<init>(GpioImpl.java:50) at com.google.android.things.pio.PeripheralManager.openGpio(PeripheralManager.java:197) at com.example.androidthings.simplepio.BlinkActivity.onCreate(BlinkActivity.java:51)

JesseScott commented 6 years ago

I am also seeing this - and also for the code at https://developer.android.com/things/training/first-device/peripherals#blink_an_led

I have added the permission as a parent of the main tag and have restarted the device (as i believe that Things is supposed to grant permssions on startup ?)

I have toggled Instant Run off and On too, as some Stack Overflow posts have suggested (for a different permission error) to no effect.

ideepdave commented 6 years ago

@JesseScott Please let me know if you found any solution for this one.. Thanks and regards

Fleker commented 6 years ago

Which version of Android Things are being run on your device?

ideepdave commented 6 years ago

@Fleker Sorry for delayed response Android Things 1.0 it is.

JesseScott commented 6 years ago

Haha. It was a typo for me - I had USE_PERIPHERAL_ID instead of _IO

Fleker commented 6 years ago

You should be able to at the very least manually grant the permission with ADB. Can you see if that resolves the error?

ideepdave commented 6 years ago

Alright i guess it Should work after manually permission. thanks for your support

dinusha94 commented 5 years ago

Use this Permission settings in Manifest.xml