在Android的工作室导入科尔多瓦项目科尔、工作室、多瓦、项目

2023-09-07 03:22:26 作者:晚风亦是鹿

我想创建一个科尔多瓦项目。创建项目后科尔多瓦创建myProject的我想在Android的Studio中打开它。问题是...这是行不通的。

I am trying to create a Cordova project. After creating the project cordova create myProject I would like to open it in Android Studio. The problem is ... it doesn't work.

在CordovaLib不会建立与各种错误包装机器人。*不存在

The CordovaLib will not build with various errors package android.* does not exist.

有谁知道如何在Android的工作室导入科尔多瓦项目?

Does anyone know how to import a cordova project in Android Studio?

推荐答案

请确保您导入平台/ Android的目录中的科尔多瓦的项目之下(并且要导入项目,而不是打开项目)。

Make sure you import the "platform/android" directory underneath your cordova project (and you want to Import Project, not Open Project).

您将至少需要运行

cordova prepare android

执行导入之前

before doing the import

cordova build android 

也将工作,但它会创建一个将不会使用Android的工作室一些蚂蚁的目录,你将不得不进口,否则你会得到你的项目额外的库时主动忽略文件)。我虽然没有进口科尔多瓦应用到机器人工作室最近,它肯定工程在的IntelliJ 其中Android上的社区版Studio是基于(我昨天做了它与从头开始建立与科尔多瓦3.5项目)。我想不出任何的安卓Studio中的附加功能,是不是在的IntelliJ,因为其中大部分尚未回迁到的IntelliJ的增加是在preVIEW空间,这是不是将是有益的将与科尔多瓦上班呢(所有它要preVIEW是一个空白的WebKit的观点)。

will also work, but it will create some ant directories which will not be used by Android Studio and you will have to actively ignore the files when importing otherwise you will get extra libraries in your project). Although I haven't imported a Cordova app into android studio recently, it definitely works in the Community edition of Intellij which Android Studio is based on (I did it yesterday with a project built from scratch with Cordova 3.5). I can't think of any of the additional features in Android Studio that would be useful that aren't in Intellij, as most of the additions which haven't been backported to Intellij are in the preview space which isn't going to work with Cordova anyway (all it is going to preview is a blank webkit view).