简体   繁体   English

在 react-native-serialport 上 gradlew assembleDebug 时出错

[英]error while gradlew assembleDebug on react-native-serialport

I tried to use https://github.com/mikafi/react-native-serialport我尝试使用https://github.com/mikafi/react-native-serialport

change build.gradle at node_modules\react-native-serialport\android implementation fileTree(dir: 'libs', include: ['usbserial-6.0.5-release.aar']) to to implementation 'com.github.felHR85:UsbSerial:6.1.0'将 build.gradle at node_modules\react-native-serialport\android implementation fileTree(dir: 'libs', include: ['usbserial-6.0.5-release.aar'])更改to implementation 'com.github.felHR85:UsbSerial:6.1.0'

add添加

implementation 'com.google.guava:guava:20.0'

implementation 'com.github.felHR85:UsbSerial:6.1.0'

to build.gradle at android\app build.gradle 在 android\app

and i try to add我尝试添加

import com.melihyarikkaya.rnserialport; not work不行

import com.reactlibrary.RNSerialportPackage; not work不行

any idea?任何的想法? this is the error这是错误

MainActivity.java:6: error: package com.melihyarikkaya does not exist import com.melihyarikkaya.rnserialport; ^

react-native-serial error png react-native-serial 错误 png

the following package had a import problem, the lib was copyied over the /libs folder instead of using maven. I fixed it and rereleased on my branch.以下 package 有一个导入问题,lib 被复制到 /libs 文件夹而不是使用 maven。我修复了它并在我的分支上重新发布。

https://github.com/Goostavo/react-native-serialport https://github.com/Goostavo/react-native-serialport

Change your package on package.json to:将您在 package.json 上的package.json更改为:

    "react-native-serialport": "github:goostavo/react-native-serialport",

Or check the changes on github and modify manually your package.或者在github上查看修改,手动修改你的package。

My branch is currently using the library default version 6.0.5.我的分支当前使用的是库默认版本 6.0.5。 But checking on gradle you can update to 6.1.0.但是检查 gradle 你可以更新到 6.1.0。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM