gpt4 book ai didi

android - 无法在 ionic v2 中安装非原生 cordova 插件

转载 作者:太空狗 更新时间:2023-10-29 13:08:16 36 4
gpt4 key购买 nike

我正在构建一个 Ionic 2 移动应用程序。我想获取网络的 IP 地址。

所以我想安装插件cordova-plugin-networkinterface

https://github.com/salbahra/cordova-plugin-networkinterface

下面是我的 ionic 信息

global packages:

@ionic/cli-utils : 1.4.0
Cordova CLI : 7.0.1
Ionic CLI : 3.4.0

local packages:

@ionic/app-scripts : 1.1.3
@ionic/cli-plugin-cordova : 1.1.2
@ionic/cli-plugin-ionic-angular : 1.1.2
Ionic Framework : ionic-angular 2.1.0

System:

Node : v6.10.2
OS : macOS Sierra
Xcode : Xcode 8.3.1 Build version 8E1000a
ios-deploy : 1.9.1
ios-sim : 5.0.13
npm : 4.5.0

但是,当我尝试使用命令安装插件时

ionic cordova plugin add cordova-plugin-networkinterface

我收到以下错误:

Cordova encountered an error.
You may get more insight by running the Cordova command above directly.

[ERROR] An error occurred while running cordova plugin add cordova-plugin-networkinterface --save (exit code 1):

Installing "cordova-plugin-networkinterface" for android
ANDROID_HOME=/Users/ankarthik/Library/Android/sdk
JAVA_HOME=/Library/Java/JavaVirtualMachines/jdk1.8.0_121.jdk/Contents/Home
Subproject Path: CordovaLib
Failed to install 'cordova-plugin-networkinterface': Error: spawn EACCES
at exports._errnoException (util.js:1018:11)
at ChildProcess.spawn (internal/child_process.js:319:11)
at Object.exports.spawn (child_process.js:378:9)
at exports.spawn
(/Users/ankarthik/Documents/projects/Juventus/platforms/android/cordova/node_modules/cordova-common/src/superspawn.js:134:31)
at /Users/ankarthik/Documents/projects/Juventus/platforms/android/cordova/lib/builders/GradleBuilder.js:261:16
at _fulfilled
(/Users/ankarthik/Documents/projects/Juventus/platforms/android/cordova/node_modules/q/q.js:854:54)
at self.promiseDispatch.done
(/Users/ankarthik/Documents/projects/Juventus/platforms/android/cordova/node_modules/q/q.js:883:30)
at Promise.promise.promiseDispatch
(/Users/ankarthik/Documents/projects/Juventus/platforms/android/cordova/node_modules/q/q.js:816:13)
at /Users/ankarthik/Documents/projects/Juventus/platforms/android/cordova/node_modules/q/q.js:877:14
at runSingle (/Users/ankarthik/Documents/projects/Juventus/platforms/android/cordova/node_modules/q/q.js:137:13)
Error: spawn EACCES

已尝试解决以下链接中建议的权限问题:

getting Error: spawn EACCES while ionic build android in ubuntu 14.04

也尝试将我的 Ionic CLI 降级到 2.1.0,但仍然出现相同的错误。我在这里错过了什么吗?

最佳答案

删除android平台文件夹并重新添加。如果不检查文件夹权限,它应该可以解决您的问题。

关于android - 无法在 ionic v2 中安装非原生 cordova 插件,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/44642177/

36 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com