我刚开始研究Ionic框架并使用CLI创建了一个项目。 我已经添加了对android平台的支持,使用以下命令生成了一个android项目:
ionic platform add android这已经成功完成,现在我正在将android项目导入到Android工作室但是得到以下与gradle相关的错误。
FAILURE: Build failed with an exception. * What went wrong: Task '' not found in root project 'android'. * Try: Run gradle tasks to get a list of available tasks. Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.以下是cordovaLib文件夹中可用的build.gradle文件的内容
因此,如果我在导入项目时缺少某些内容,或者需要更新build.gradle?
I just started working on Ionic framework and created a project using CLI. I have added support for android platform generated an android project using the following command:
ionic platform add androidThis has been done successfully, Now i am importing tha android project to android studio but getting the following error related with gradle.
FAILURE: Build failed with an exception. * What went wrong: Task '' not found in root project 'android'. * Try: Run gradle tasks to get a list of available tasks. Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.Following are the contents of build.gradle file available in cordovaLib folder
So if am i missing something while importing project or build.gradle needs to be updated?
最满意答案
我弄清楚出了什么问题。 我将从CLI创建的离子项目导入到Android工作室。
在离子项目中我有两个单独的build.gradle文件。 一个在根android项目中,另一个在CordovaLib项目中。 在这两个gradle文件中,buildToolVersion在运行时被识别。 因此,Android Studio可能无法解析构建版本。
将硬编码构建版本设置为“19.1”,将SDK版本设置为21修复了该问题。
I figured out the thing that was going wrong. I imported the ionic project that i created from CLI to Android studio.
There i got two seperate build.gradle files in ionic project. One was in the root android project and other one was in CordovaLib project. In both the gradle files buildToolVersion was being identified at the run time. So may be Android Studio was unable to resolve the build version.
Setting hardcoded build version to "19.1" and SDK version to 21 fixed the issue.
更多推荐
发布评论