同时采用CordovaInterface升级从科尔多瓦2.5至3.0科尔多瓦,面临的问题 [英] Upgrading from Cordova 2.5 to Cordova 3.0 , facing issue while using CordovaInterface

查看:376
本文介绍了同时采用CordovaInterface升级从科尔多瓦2.5至3.0科尔多瓦,面临的问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我从科尔多瓦2.5迁移我的项目科尔多瓦3。其次迁移过程中提到

I am migrating my project to Cordova 3 from Cordova 2.5. Followed the migration process mentioned in

http://cordova.apache.org/docs/ EN / 3.0.0 / guide_cli_index.md.html

不过,遗憾的是得到以下错误

But, unfortunately getting the following error

preparing Android项目[错误:没有Java文件中延伸   CordovaActivity]

Preparing android project [Error: No Java files found which extend CordovaActivity.]

在我们的应用程序,我们有延伸活动,实现CordovaInterface一类。而且这个类是在config.xml文件中提到的位置。

In our app, we have a class which extends activity and implements CordovaInterface. And moreover this class is in the location mentioned in config.xml.

不过,我对着下面的错误。 是强制替代CordovaInterface与CordovaActivity?我是pretty的肯定不会是强制的情况下。

Yet, I am facing the following error. Is it mandatory to substitute CordovaInterface with CordovaActivity? I am pretty sure that will not be the mandatory case.

推荐答案

这是导致一个笨蛋,坏了,科尔多瓦构建系统。

This is causes by a bonehead, broken, Cordova build system.

如果你只是在你的源代码树添加任何旧的类,旁边的活动,扩展CordovaActivity,构建会工作。 你甚至不必使用这个类,只是做一个。

If you simply add any old class in your source tree, next to your activity, that extends CordovaActivity, the build will work. You don't even have to use the class, just make one.

这就像他们有关于它应该如何工作的内部辩论,并一边拧比其他通过构建失败,如果他们没有得到他们的方式。

It's like they are having an internal debate about how it should work, and one side screwed over the other by making the build fail if they didn't get their way.

例如:

import org.apache.cordova.CordovaActivity;

/**
 * This class is simply here to make sure Cordova will build. Without it, even
 * though it's not used or otherwise referenced, you will get a build error that
 * looks like "Error: No Java files found which extend CordovaActivity".
 * 
 * This applies as of Cordova 3.5.0. It should be re-tested when upgrading to
 * Cordova 4.x.
 * 
 */
public class FakeCordovaActivityForBuild extends CordovaActivity {

}

幸运的是,有人在开发团队会发现这个小冲突,解决它,我想这应该被列为在他们的系统中的错误,但我还没有把它添加。

With luck, someone on the dev team will notice this little conflict and fix it, I suppose it should be listed as a bug in their system, but I have not added it.

这篇关于同时采用CordovaInterface升级从科尔多瓦2.5至3.0科尔多瓦,面临的问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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