felHR85 / UsbSerial

Usb serial controller for Android
MIT License
1.78k stars 582 forks source link

okio.buffer not found #284

Closed mbhassan closed 3 years ago

mbhassan commented 4 years ago

Having an issue when calling createUsbSerialDevice function.

using v6.1.0

javadang.NoClassDefFoundError: okio.Buffer
com.felhhusbmrial.SerialBuffer$SynchronizedBuffeheine,(Sed  
alBuffehjava:97)
com.felhhusbmrial.SerialBuffeheine,(SerialBuffehjave:21)
com.felhhusbmrial.UsbSerialDevice.einit>(.1obSerialDevice.jave  
:58)
com.felhhusbmrial.FTDISerialDevice,init4TDISerialDevice.ja  
ve:110)
com.felhhusbmrial.UsbSerialDevice.createUsbSerialDevice(Usb  
Serial0evice.jave:77)
com.felhhusbmrial.UsbSerialDevice.createUsbSerialDevice(Usb  
SerialDevice.jave:53)
cornins.Runtime.calIJSMethodNative(Native Method)
comIns.Runtime.dispetchCallJSMethodNative(Runtime.javal  
209)
comIns.Runtime.calIJSMethodImpl(Runtime.jave:1095)  
comIns.Runtime.calIJSMethod(Runtime.javal 083)  
comIns.Runtime.calIJSMethod(Runtime.javal 053)  
comIns.Runtime.calIJSMethod(Runtime.javal 055)
comIns.gen.javadang.Object_vendor_119581_32_ClickListener  
ImpLonClick(Object_vendor_119581_32_ClickListenerImpl.java:  
18)
android.view.View.performClick(View.java:4508)  
android.view.ViewSPerformClickrunNiew.jave:18575)  
android.os.liandlehhandleCallback(Handlehjave:733)  
android.os.Handler.dispetchMessage(Handlehjava:95)  
android.os.Looperdoop(Looperlaval 30
android.app.ActivityThread.main(ActiviiyThread.java:5590)

sorry if some functions are mis-spelt. Had to do an ocr on screenshot..

Am using the aar file imported into a nativescript-angular project. Have tried rebuilding the aar file from source but the resulting file has the same error.

nam-van-nguyen commented 4 years ago

I get this to work by:

  1. Get the source from https://github.com/square/okio
  2. Build it
  3. Copy the output .jar file to a new folder called "libs"
  4. Update the build.gradle of any failed modules with the dependency:

dependencies { implementation fileTree(dir: 'libs', include: ['*.jar']) ...

  1. Rebuild
mbhassan commented 3 years ago

thanks. worked out