Android things: DP 7 retired PeripheralManagerService and I have issue with PeripheralManager

Multi tool use
Multi tool use


Android things: DP 7 retired PeripheralManagerService and I have issue with PeripheralManager



I have 1 project based on this: https://github.com/Nilhcem/i2cfun-androidthings
https://github.com/neuberfran/SmartDrive5 (the latter is my project)



But, when I change PeripheralManagerService to PeripheralManager (DP 7 and APi level 27)


try {
PeripheralManager manager = PeripheralManager.getInstance();
mDevice = manager.openI2cDevice(I2C_DEVICE_NAME, I2C_ADDRESS);
} catch (IOException e) {
Log.w(TAG, "Unable to access I2C device", e);
}



I have this issue: https://drive.google.com/file/d/1kXfknYcu4RUF7AT1549_sjJiVSG2_Jjo/view?usp=sharing in this line: https://drive.google.com/file/d/1nTXOV0qiQDe5XldzIuLsY26oIdyfs3x3/view?usp=sharing



I know about this: PeripheralManagerService throws NoClassDefFoundError
but not solved.



Can you help me





You should update your device operating system and the library to version 1.0.0 as a number of APIs have changed or been updated.
– Nick Felker
Jul 2 at 19:45





@NickFelker How to I do this without necessarily pulling another install image and burning a sd card?
– Neuber
Jul 2 at 23:02





If you're still on the developer preview, your best bet is to install a new image. After that you'll be able to create new images and OTA update them to the device.
– Nick Felker
Jul 3 at 1:50





@NickFelker I create: OS version 1.0.1 (latest). I can run motors with pio i2c I2C1 0x1B write-raw 0x46 128 0x05 0x00 0xD1. But 1.0.1 not exist and compileOnly 'com.google.android.things:androidthings:1.0' I have this issue: drive.google.com/file/d/1OeDRh23QEr0utkWrDglhI9iNjS4Z6ABS/… drive.google.com/file/d/10hCYyfJ0PGw0QflMiVjc12f-7B9h0Ryz/…
– Neuber
Jul 3 at 19:15





compileOnly 'com.google.android.things:androidthings:1.0' is the latest dependency. As you're seeing the permissions issue, you should add the permission to your manifest and then install the app again and then do a reboot.
– Nick Felker
Jul 3 at 20:09




1 Answer
1



The class not found exception means that peripheral manager is not on the operating system. You are trying to use a new API on a device that has an older version.



You need to have the Android things library dependency in sync with the version installed on your device.



And as it has been suggested, you should get everything into the stable release.






By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

4vHyDRFXUF1olsIazb8ea8ItR1,q1SOlL3m9S,vIOtGT 9bj,PU6OXy5y,K
49MpVj3qPI9Fpgytpku0aWD D,ERkY9,YlDLkoP7w6MfFY4NpqaICnHCyXo7 ahkmWuA77yau,O

Popular posts from this blog

PHP contact form sending but not receiving emails

Do graphics cards have individual ID by which single devices can be distinguished?

Create weekly swift ios local notifications