使用Cordova-Android 6.2.0的Cordova错误 - getFileResources不是一个函数 [英] Cordova Error using Cordova-Android 6.2.0 - getFileResources is not a function

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

问题描述

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

I have an ionic/cordova project using:

cordova-android@6.2.0
cordova-plugin-crosswalk-webview@2.3.0
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 android@6.2.0

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 cordova-android@6.2.0




错误:cordovaProject.projectConfig.getFileResources不是函数

Error: cordovaProject.projectConfig.getFileResources is not a function


推荐答案

看来这个问题与cordova-android@6.2中的错误有关。 0,如此处所确认: https://issues.apache.org/jira/browse/CB -12633

It seems this issue is related to a bug in cordova-android@6.2.0, as confirmed here: https://issues.apache.org/jira/browse/CB-12633

我现在已将我的系统更新为cordova-cli - cordova@6.5.0和cordova-android@6.2.1,它似乎工作。

I have now updated my system to cordova-cli - cordova@6.5.0 and cordova-android@6.2.1, 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路径,所以我按照这里的步骤进行操作: https://gradle.org/install#with-homebrew ,现在所有构建成功。

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不是一个函数的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆