Monday 9 July 2018

ADB Error : no permissions (udev requires plugdev group membership)


1. adb-devices - got following error

$ adb devices
List of devices attached
41a6a455 no permissions (udev requires plugdev group membership); see [http://developer.android.com/tools/device.html]

2. Find the bus and device id assigned by the kernel:

$ lsusb 

Bus 002 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
Bus 001 Device 003: ID 413c:2113 Dell Computer Corp. 
Bus 001 Device 002: ID 413c:301a Dell Computer Corp. 
Bus 001 Device 008: ID 05c6:9091 Qualcomm, Inc. 
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub

Note: The path comes from the output of lsusb: 001 is the Bus, and 008 is the Device.
lsusb: {idVendor=05c6 : idProduct=9091}

3. Check the permissions of the device file

$ ls -la /dev/bus/usb/001/008
crw-rw-r-- 1 root root 189, 5 Jul  3 11:11 /dev/bus/usb/001/008

4. Create a udev rules file, let’s say: /etc/udev/rules.d/51-android.rules

$ sudo vi /etc/udev/rules.d/51-android.rules

5. Add one rule for each unique idVendor:
SUBSYSTEM=="usb", ATTR{idVendor}=="05c6", ATTR{idProduct}=="9091", MODE="0666", GROUP="plugdev"

6. Restart udev

$ sudo udevadm control –reload-rules 
$ sudo service udev restart
7. Unplug/replug your device

8. Check the permissions of the device file
$ ls -la /dev/bus/usb/001/008
crw-rw-r-- 1 root plugdev 189, 9 Jul  3 11:48 /dev/bus/usb/001/008

9. To shoe devices using adb devices

$ adb devices

List of devices attached
41a6a455 device


Ref:

Monday 3 April 2017

Android jni : executing external native build for cmake cmakelists.txt file


1. Check in your build.gradle file for your App's module

externalNativeBuild {
        cmake {
            path "CMakeLists.txt"
        }
    }
 
2. remove above the cmake section

3. re-sync the project:   
   go to menu Build -> Refresh Linked C++ Projects 

4. Right-click on the module, such as the app module, select "Link C++ Project with Gradle" from the menu.

5. You should see a dialog similar to the one shown in below figure.


6. Click OK.