mapaiva / react-native-usbserial

A USB serial React Native bridge
MIT License
57 stars 35 forks source link

No interface method pushMap #13

Open theorime opened 3 years ago

theorime commented 3 years ago

Hello ! Thank you for your work, it's really amazing for what I'm doing ! But there's a problem since React Native 0.6 that cause this error on the call of getDeviceListAsync :

Screenshot_20210428_185608.jpg

This is caused by the fact that in RN > 0.6, the method WritableArray.pushMap() does not accept WritableMap as argument anymore. It accepts only ReadableMap. I tried to modify the code in order transform it, but my knowledge in RN is too limited to do so...

How can we get through this problem ?

Thank you !

Nash171 commented 3 years ago

I got the same issue. still looking for a solution :(

ps: I just saw your fix in your fork. Is that working well? I will try to use it. Thanks

vmaury commented 3 years ago

I'd got same issue ... After a lot of tries (note I'm VERY bad in java,maven and so on, I hate Java, that's the main reason I chose react to code ;-)), It works You can find my realease here : http://vmaury.o2switch.net/tmp/react-native-usbserial.zip, feel free to modify it, and commit it somewhere

vmaury commented 3 years ago

Note that during this tries, I linked NOT with com.hoho.android:usb-serial-for-android:0.2.0-SNAPSHOT but with more recent com.github.mik3y:usb-serial-for-android:3.4.0 (I thought that was the bug source, no, but I think it's always better if It's linked with a more recent version). In my buid.gradle, I also add

dependencies {
    implementation 'com.github.mik3y:usb-serial-for-android:3.4.0' 
... 
}

and

repositories {
  maven { url 'https://jitpack.io' }
}
theorime commented 2 years ago

I just tried it and it's working ! Thank you so much

LjMax commented 2 years ago

@vmaury or someone else, can you share a working solution, since link you posted doesn't work anymore?