使用Android Studio不能添加模块依赖于CordovaLib的科尔多瓦项目 [英] Can't add module dependency to CordovaLib for Cordova project using Android Studio
问题描述
我不能锻炼如何添加 CordovaLib
目录作为Android Studio中一个模块依赖。
I can't workout how to add the CordovaLib
directory as a module dependency in Android Studio.
的(注意:这是我用过的Android Studio中的第一次,所以我可能只是不知道我在做什么)的
我使用的是:
- OSX约塞米蒂
- Android的工作室1.1.0
- 科尔多瓦4.3
下面是我所采取的步骤:
Here are the steps I have taken:
- 创建新项目科尔多瓦
- 添加Android平台和一些插件科尔多瓦
- 导入生成的项目进入Android的工作室(注:当问及gradle这个包装,我说没有,只是指出它在那里我有gradle这个安装 -
的/ usr /本地/库/ gradle这个/ 2.2.1 / libexec目录
) - 尝试建立 - 在这一点上,它会抱怨好了
无法找到符号类CordovaPlugin科尔多瓦插件
显然,它不知道有关 CordovaLib
子项目。 这就是我试图修复。
Obviously it doesn't know about the CordovaLib
subproject. This is what I'm trying to fix.
我不知道如何告诉了Android Studio中 CordovaLib
是一个模块依赖。
I can't work out how to tell the Android Studio that CordovaLib
is a module dependency.
我已经去了的项目结构的窗口,但看不到任何方式链接到CordovaLib。
I've gone to the Project Structure window, but can't see any way to link to CordovaLib.
点击+按钮,没有做任何事情。我不能工作了,如果我做错了什么,或者有Android Studio中导入项目时的错误...
Clicking the "+" buttons does not do anything. I can't work out if I'm doing something wrong, or there are bugs in Android Studio when importing the project...
有人请证实,如果我做错了什么?
或请确认他们是否能够导入科尔多瓦生成的项目到Android Studio中,使用的科尔多瓦4.3 的和的 Android的工作室1.1.0 的
Or please confirm if they are able to import Cordova generated projects into Android Studio, using Cordova 4.3 and Android Studio 1.1.0.
谢谢!
推荐答案
首先感谢@jcesarmobile为把我在正确的轨道上。
First, thanks to @jcesarmobile for putting me on the right track.
下面是如何利用最新的科尔多瓦-的Android
直接(4.0.0-DEV)从GitHub与Android工作室:
Here is how to use the latest cordova-android
directly (4.0.0-dev) from Github with Android Studio:
-
克隆科尔多瓦 - 机器人回购:
Clone the cordova-android repo:
git clone git@github.com:apache/cordova-android.git
该平台添加到您的科尔多瓦项目
Add the platform to your cordova project
cordova platform add /path/to/cloned/repo/cordova-android
生成项目
Build the project
cordova build android
导入到Android的工作室作为一个非Android工作室项目
Import into Android Studio as a non-android-studio project
这篇关于使用Android Studio不能添加模块依赖于CordovaLib的科尔多瓦项目的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!