简体   繁体   English

Cordova和Android Studio的问题

[英]Issues with cordova and android studio

I have downloaded android studio, installed ant, node.js, cordova and jdk But I can not add platform to my cordova android app Here is the bashrc file: 我已经下载了android studio,安装了ant,node.js,cordova和jdk,但无法将平台添加到我的cordova android应用程序中这是bashrc文件:

JAVA_HOME=/usr/lib/jvm/jdk1.8.0
export JAVA_HOME
PATH=$PATH:$JAVA_HOME/bin
export PATH
export PATH=${PATH}:/home/Dev/android-studio/sdk/tools
export PATH=${PATH}:/home/Dev/android-studio/sdk/platform-tools

Whenever I try to add platform under my created app project it throws error: 每当我尝试在创建的应用程序项目下添加平台时,都会引发错误:

Creating android project...

/home/anupam/.cordova/lib/android/cordova/3.5.1/bin/node_modules/q/q.js:126
                    throw e;
                          ^
Error: An error occurred while listing Android targets
    at /home/anupam/.cordova/lib/android/cordova/3.5.1/bin/lib/check_reqs.js:87:29
    at _rejected (/home/anupam/.cordova/lib/android/cordova/3.5.1/bin/node_modules/q/q.js:808:24)
    at /home/anupam/.cordova/lib/android/cordova/3.5.1/bin/node_modules/q/q.js:834:30
    at Promise.when (/home/anupam/.cordova/lib/android/cordova/3.5.1/bin/node_modules/q/q.js:1079:31)
    at Promise.promise.promiseDispatch (/home/anupam/.cordova/lib/android/cordova/3.5.1/bin/node_modules/q/q.js:752:41)
    at /home/anupam/.cordova/lib/android/cordova/3.5.1/bin/node_modules/q/q.js:574:44
    at flush (/home/anupam/.cordova/lib/android/cordova/3.5.1/bin/node_modules/q/q.js:108:17)
    at process._tickCallback (node.js:419:13)
Error: /home/anupam/.cordova/lib/android/cordova/3.5.1/bin/create: Command failed with exit code 8
    at ChildProcess.whenDone (/usr/lib/node_modules/cordova/node_modules/cordova-lib/src/cordova/superspawn.js:135:23)
    at ChildProcess.emit (events.js:98:17)
    at maybeClose (child_process.js:756:16)
    at Process.ChildProcess._handle.onexit (child_process.js:823:5)

I an tired of searching all the answers in stackoverflow and google. 我厌倦了在stackoverflow和google中搜索所有答案。 Not a single guide could solve my problem. 没有一个指南可以解决我的问题。 Just one thing I want to use ANdroid studio, not eclipse. 我想使用ANdroid Studio只是一件事,而不是蚀。 SO please do not mention eclipse workarounds. 因此,请不要提及日食变通办法。 If there is any clean install method , please mention if needed. 如果有任何全新的安装方法,请根据需要提及。

I had a similar issue - if you have eclipse installed prior your cordova installation, then you probably don't have the latest API updates. 我有一个类似的问题-如果您在安装cordova之前先安装了eclipse,那么您可能没有最新的API更新。

Run android from your command line to open your SDK Manager - or find it in your android installation root folder (for CLI - Use Administrator) - or simply from your eclipse UI command. 从命令行运行android,以打开SDK Manager-或在android安装根文件夹(对于CLI-Use Administrator)中找到它-或仅通过eclipse UI命令即可。

In here find where updates are needed and install and run your android installation as you did before cordova platform add android 在此处找到需要更新的位置,并像在cordova平台添加android之前所做的那样安装并运行android安装

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

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