-
Notifications
You must be signed in to change notification settings - Fork 273
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
UsbMassStorageDeivce.init() throw exception #419
Comments
Facing same issues at my End also, while integrating mass storage USB on android 14 device. RESPONSE Found usb interface: UsbInterface[mId=0,mAlternateSetting=0,mName=null,mClass=8,mSubclass=6,mProtocol=80,mEndpoints=[ Found usb endpoint: UsbEndpoint[mAddress=129,mAttributes=2,mMaxPacketSize=64,mInterval=0] java.lang.IllegalArgumentException: buffer.remaining() must be multiple of blockSize! |
Problem
runing program on android 10 system。plugin a usb device, and then use the api UsbMassStorageDeivce.init(), this method throw exception like below
Expected behavior
init usb mass storage device success
Actual behavior
Stacktrace of Excpetion
java.lang.IllegalArgumentException
at java.nio.Buffer.limit(Buffer.java:290)
at java.nio.ByteBuffer.limit(ByteBuffer.java:818)
at me.jahnen.libaums.core.driver.scsi.ScsiBlockDevice.transferOneCommand(ScsiBlockDevice.kt:280)
at me.jahnen.libaums.core.driver.scsi.ScsiBlockDevice.requestSense(ScsiBlockDevice.kt:222)
at me.jahnen.libaums.core.driver.scsi.ScsiBlockDevice.handleCommandResult(ScsiBlockDevice.kt:207)
at me.jahnen.libaums.core.driver.scsi.ScsiBlockDevice.transferCommand(ScsiBlockDevice.kt:155)
at me.jahnen.libaums.core.driver.scsi.ScsiBlockDevice.transferCommandWithoutDataPhase(ScsiBlockDevice.kt:199)
at me.jahnen.libaums.core.driver.scsi.ScsiBlockDevice.initAttempt(ScsiBlockDevice.kt:115)
at me.jahnen.libaums.core.driver.scsi.ScsiBlockDevice.init(ScsiBlockDevice.kt:83)
at me.jahnen.libaums.core.UsbMassStorageDevice.setupDevice(UsbMassStorageDevice.kt:138)
at me.jahnen.libaums.core.UsbMassStorageDevice.init(UsbMassStorageDevice.kt:100)
at com.example.test.MainActivity.testlibaums(MainActivity.java:467)
at com.example.test.MainActivity.btnTestClicked(MainActivity.java:195)
at com.example.test.MainActivity.$r8$lambda$fyDzIc6E7gCccObvGSAp9XPEj5Y(Unknown Source:0)
at com.example.test.MainActivity$$ExternalSyntheticLambda1.onClick(D8$$SyntheticClass:0)
at android.view.View.performClick(View.java:7322)
at com.google.android.material.button.MaterialButton.performClick(MaterialButton.java:1213)
at android.view.View.performClickInternal(View.java:7296)
at android.view.View.access$3600(View.java:839)
at android.view.View$PerformClick.run(View.java:28319)
at android.os.Handler.handleCallback(Handler.java:900)
at android.os.Handler.dispatchMessage(Handler.java:103)
at android.os.Looper.loop(Looper.java:219)
at android.app.ActivityThread.main(ActivityThread.java:8673)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:513)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1109)
Code where problem occurs
The text was updated successfully, but these errors were encountered: