I am working on android things(Pico i.MX7D I/O).I got android.os.ServiceSpecificException: GPIO2_IO02 is already in use (code 16) exception,What it means by this? Please help me.
My sample program is cloned from https://github.com/androidthings/sample-button.
This means another app is running in the background and is currently accessing this pin. This may happen if one app is not fully stopped before a new one is opened.
You can see all your installed apps by running: adb shell pm list packages -3
You can force stop a program by running adb shell am force-stop <package name>
Uninstalling or force stopping the rogue app should allow you to properly get control of it.
Edit: As a comment pointed out, I did not include the command to do uninstalling. adb uninstall <package-name>
来源:https://stackoverflow.com/questions/48437428/android-os-servicespecificexception-gpio2-io02-is-already-in-use-code-16