当前位置 : 主页 > 手机开发 > cordova >

cordova – 离子框架错误:无法安装’com.ionic.keyboard’

来源:互联网 收集:自由互联 发布时间:2021-06-10
刚开始尝试离子框架,当我想添加 android平台时,我遇到了一些麻烦.当我运行命令时: ionic platform add android 我得到以下内容 Done adding default Ionic resourcesAdding icons for platform: androidrunning cor
刚开始尝试离子框架,当我想添加 android平台时,我遇到了一些麻烦.当我运行命令时:

ionic platform add android

我得到以下内容

Done adding default Ionic resources
Adding icons for platform: android
running cordova platform add android
Adding android project...
Creating Cordova project for the Android platform:
    Path: platforms/android
    Package: com.ionicframework.tester166478
    Name: tester
    Activity: MainActivity
    Android target: android-22
Copying template files...
Android project created with cordova-android@4.0.0
Running command: "/media/denny/New Volume/projects/mobile/tester/hooks/after_prepare/010_add_platform_class.js" "/media/denny/New Volume/projects/mobile/tester"
Installing "com.ionic.keyboard" for android
Failed to install 'com.ionic.keyboard':Error: /media/denny/New Volume/projects/mobile/tester/platforms/android/cordova/version: Command failed with exit code EACCES
    at ChildProcess.whenDone (/usr/lib/node_modules/cordova/node_modules/cordova-lib/src/cordova/superspawn.js:131:23)
    at ChildProcess.emit (events.js:95:17)
    at Process.ChildProcess._handle.onexit (child_process.js:818:12)
Error: /media/denny/New Volume/projects/mobile/tester/platforms/android/cordova/version: Command failed with exit code EACCES
    at ChildProcess.whenDone (/usr/lib/node_modules/cordova/node_modules/cordova-lib/src/cordova/superspawn.js:131:23)
    at ChildProcess.emit (events.js:95:17)
    at Process.ChildProcess._handle.onexit (child_process.js:818:12)

可能导致上述错误的原因是什么?

根据错误消息,由于缺少权限,平台添加失败

Command failed with exit code EACCES

在尝试创建文件夹/ media / denny / New Volume / projects / mobile / tester / platforms / android / cordova / version时.

如果你正在运行Mac,你应该看到用户holmescn的this回答.

如果您正在运行Linux,请尝试运行

chmod -r 777 *

在您的项目root上获取足够的权限.

网友评论