安装react-native-vcard软件包时出错

时间:2018-09-02 10:24:03

标签: android react-native npm-install vcard

我正在尝试为我的react-native应用程序安装“ React Native vCards”插件。但是当我运行

public void onLocationChanged(Location location) { Intent intent = new Intent("location_update"); float speed = location.getSpeed() * 3600 / 1000; intent.putExtra("speed", speed); speedcounts.add(speed); //size of speedcounts is only 1 for(int i = 0; i < speedcounts.size(); i++) { //just loop once averSpeedcount += speedcounts.get(i); Log.d(TAG,"int "+i); averSpeed = averSpeedcount / speedcounts.size(); } intent.putExtra("avg_speed",averSpeed); sendBroadcast(intent); }

我遇到以下错误

npm install react-native-vcards@https://github.com/idxbroker/react-native-vcards.git --save

2 个答案:

答案 0 :(得分:0)

代替此命令

npm install react-native-vcards@https://github.com/idxbroker/react-native-vcards.git --save

"vcards-js": "git+https://git@github.com/idxbroker/vCards-js#react-native"添加到package.json依赖项

并运行npm install

并将此插件用作import vCard from 'vcards-js';

答案 1 :(得分:0)

试试这个

npm install react-native-vcards@https://github.com/hammadj/react-native-vcards --save