gpt4 book ai didi

android - Cordova平台添加android报错

转载 作者:塔克拉玛干 更新时间:2023-11-02 08:19:21 24 4
gpt4 key购买 nike

使用 ubuntu 12.04

cordova platform add android
Creating android project...

/usr/local/lib/node_modules/cordova/node_modules/q/q.js:126
throw e;
^
Error: An error occured during creation of android sub-project.

/home/admin/.cordova/lib/android/cordova/3.3.0/bin/node_modules/q/q.js:126
throw e;
^
Error: An error occurred while listing Android targets
at /home/admin/.cordova/lib/android/cordova/3.3.0/bin/lib/check_reqs.js:87:29
at _rejected (/home/admin/.cordova/lib/android/cordova/3.3.0/bin/node_modules/q/q.js:808:24)
at /home/admin/.cordova/lib/android/cordova/3.3.0/bin/node_modules/q/q.js:834:30
at Promise.when (/home/admin/.cordova/lib/android/cordova/3.3.0/bin/node_modules/q/q.js:1079:31)
at Promise.promise.promiseDispatch (/home/admin/.cordova/lib/android/cordova/3.3.0/bin/node_modules/q/q.js:752:41)
at /home/admin/.cordova/lib/android/cordova/3.3.0/bin/node_modules/q/q.js:574:44
at flush (/home/admin/.cordova/lib/android/cordova/3.3.0/bin/node_modules/q/q.js:108:17)
at process._tickCallback (node.js:415:13)

at /usr/local/lib/node_modules/cordova/src/platform.js:244:30
at ChildProcess.exithandler (child_process.js:641:7)
at ChildProcess.EventEmitter.emit (events.js:98:17)
at maybeClose (child_process.js:735:16)
at Socket.<anonymous> (child_process.js:948:11)
at Socket.EventEmitter.emit (events.js:95:17)
at Pipe.close (net.js:466:12)

我做错了什么?

最佳答案

我遇到了类似的问题。确保将 ADT 工具和平台工具添加到系统路径;这样做为我解决了问题。转到您的 .bashrc 文件(在您的主目录中)并添加如下内容:

export PATH=${PATH}:/your-path/android-sdk-linux/platform-tools:/your-path/android-sdk-linux/tools

然后重新启动您的 session 或执行 $ source .bashrc 以启用更改。现在 cordova 应该能够很好地创建 Android 项目。

关于android - Cordova平台添加android报错,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/20897115/

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