本文介绍了使用Cordova-Android 6.2.0的Cordova错误 - getFileResources不是一个函数的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个离子/ cordova项目使用:

I have an ionic/cordova project using:

[email protected]
[email protected]
cordova cli 6.4.0
ionic 1.3.3

当我尝试添加Android平台时,我得到以下输出

When I try to add the Android platform, I get the following output

================

$ ionic platform add [email protected]

Adding android project...


Creating Cordova project for the Android platform:

    Path: platforms/android
    Package: com.ionicframework.name
    Name: name
    Activity: MainActivity
    Android target: android-25

Subproject Path: CordovaLib

Android project created with [email protected]




推荐答案

看来这个问题与[email protected]中的错误有关。 0,如此处所确认:

It seems this issue is related to a bug in [email protected], as confirmed here: https://issues.apache.org/jira/browse/CB-12633

我现在已将我的系统更新为cordova-cli - [email protected][email protected],它似乎工作。

I have now updated my system to cordova-cli - [email protected] and [email protected], and it seemed to work.

更新至cordova cli版本6时:

Update to version 6 of cordova cli with:

npm install -g cordova@6

然后添加正确版本的cordova-android

And then add the correct version of cordova-android

cordova platform add android@6

与此问题没有直接关系,但是一旦我开始工作,我的系统确实抱怨在我尝试构建应用程序时没有设置gradle路径,所以我按照这里的步骤进行操作:,现在所有构建成功。

Not directly related to this issue, but once I got it working, my system did complain about the gradle path not being set when I tried building my app, and so I followed the steps here: https://gradle.org/install#with-homebrew, and now all builds successfully.

这篇关于使用Cordova-Android 6.2.0的Cordova错误 - getFileResources不是一个函数的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

10-29 03:20