1

Example Link: https://github.com/androidthings/drivers-samples/blob/master/bmx280/src/main/java/com/example/androidthings/driversamples/TemperatureActivity.java

It shows a exception:

java.lang.RuntimeException: Unable to start activity ComponentInfo{com.kmk.test/com.kmk.test.MainActivity}: java.lang.SecurityException: Caller lacks required permission com.google.android.things.permission.MANAGE_SENSOR_DRIVERS

But I have added the permission in manifests.

Please Help me...

Andrii Omelchenko
  • 13,183
  • 12
  • 43
  • 79
Wenquan Jin
  • 33
  • 1
  • 10
  • "Note: If you are not using Android Studio 3.0 or later, you need to reboot your device after installing the app in order to gain the permission" https://developer.android.com/things/sdk/drivers/sensors.html – DigitalNinja Sep 26 '17 at 00:10
  • If that's not it (more than likely) then you may just need to ask for permission at runtime. https://developer.android.com/training/permissions/requesting.html – DigitalNinja Sep 26 '17 at 00:12
  • Android Things doesn't support permission requests at runtime. All permissions are granted, although it may take a reboot. – Nick Felker Sep 26 '17 at 01:36

2 Answers2

4

You usually need to reboot your device for the permissions to be granted.

See the following note: Android things overview

Distwo
  • 11,569
  • 8
  • 42
  • 65
0

com.google.android.things:androidthings:0.5.1-devpreview must work on Android Things 0.5. Can not work on 0.4 or lower version.

Wenquan Jin
  • 33
  • 1
  • 10