react-native-usbserial icon indicating copy to clipboard operation
react-native-usbserial copied to clipboard

No interface method pushMap

Open theorime opened this issue 4 years ago • 5 comments

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 !

theorime avatar Apr 28 '21 17:04 theorime

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

Nash171 avatar May 15 '21 13:05 Nash171

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 avatar Jun 30 '21 11:06 vmaury

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' }
}

vmaury avatar Jun 30 '21 11:06 vmaury

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

theorime avatar Oct 04 '21 08:10 theorime

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

LjMax avatar Mar 26 '22 11:03 LjMax