magnusja / libaums

Open source library to access USB Mass Storage devices on Android without rooting your device

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

GettingMissing permission to access usb device .

nnitesh786 opened this issue · comments

Hi ,

I ma trying to initilize the usb device but i am getting below Exception .

07-14 21:05:48.228 10322 10322 E AndroidRuntime: FATAL EXCEPTION: main
07-14 21:05:48.228 10322 10322 E AndroidRuntime: Process: com.example.myusbmanager, PID: 10322
07-14 21:05:48.228 10322 10322 E AndroidRuntime: java.lang.IllegalStateException: Missing permission to access usb device: UsbDevice[mName=/dev/bus/usb/001/012,mVendorId=1921,mProductId=21863,

I am calling like this to get the file system partition .

           try {
               device.init();
           } catch (IOException e) {
               Log.e(TAG, "exception: " + e);
           }

FileSystem mCurrenntFs = device.getPartitions().get(0).getFileSystem();

Please help me how to solve this issue.

The log even says that you are missing permission to access the usb device. You have to request permission from the user first. This is described in the readme. For further reference please consult the official Android docs