How to wrap cocos2d html5 with phonegap?

I try to wrap cocos2d HTML5 with phonegap but it’s failed.

cocos2d HTML5 version : 2.1
phonegap : 1.4.1, 2.3.0 android

I move helloworld sample src & res to “www” folder and set cocos2d library and update build.xml(directory setting)

eclipse LogCat error message is

01-16 05:46:21.784: D/CordovaLog(403): TypeError: Result of expression ‘cc.ActionInterval’ [undefined] is not an object.
01-16 05:46:21.784: E/Web Console(403): TypeError: Result of expression ‘cc.ActionInterval’ [undefined] is not an object. at file:///android_asset/www/libs/cocos2d/actions/CCActionProgressTimer.js:31
01-16 05:46:21.794: D/CordovaLog(403): TypeError: Result of expression ‘cc.ActionInterval’ [undefined] is not an object.
01-16 05:46:21.794: E/Web Console(403): TypeError: Result of expression ‘cc.ActionInterval’ [undefined] is not an object. at file:///android_asset/www/libs/cocos2d/actions/CCActionCamera.js:32
01-16 05:46:22.045: D/CordovaLog(403): TypeError: Result of expression ‘cc.TransitionScene’ [undefined] is not an object.
01-16 05:46:22.045: E/Web Console(403): TypeError: Result of expression ‘cc.TransitionScene’ [undefined] is not an object. at file:///android_asset/www/libs/cocos2d/layers_scenes_transitions_nodes/CCTransitionPageTurn.js:38
01-16 05:46:22.064: D/CordovaLog(403): TypeError: Result of expression ‘cc.TransitionScene’ [undefined] is not an object.
01-16 05:46:22.064: E/Web Console(403): TypeError: Result of expression ‘cc.TransitionScene’ [undefined] is not an object. at file:///android_asset/www/libs/cocos2d/layers_scenes_transitions_nodes/CCTransitionProgress.js:39
01-16 05:46:22.364: D/CordovaLog(403): TypeError: Result of expression ‘cc.Sprite’ [undefined] is not an object.
01-16 05:46:22.364: E/Web Console(403): TypeError: Result of expression ‘cc.Sprite’ [undefined] is not an object. at file:///android_asset/www/libs/cocos2d/label_nodes/CCLabelTTF.js:35
01-16 05:46:22.674: D/CordovaLog(403): TypeError: Result of expression ‘cc.ParticleSystem’ [undefined] is not an object.
01-16 05:46:22.674: E/Web Console(403): TypeError: Result of expression ‘cc.ParticleSystem’ [undefined] is not an object. at file:///android_asset/www/libs/cocos2d/particle_nodes/CCParticleSystemQuad.js:47
01-16 05:46:22.744: D/CordovaLog(403): TypeError: Result of expression ‘cc.LabelTTF’ [undefined] is not an object.
01-16 05:46:22.744: E/Web Console(403): TypeError: Result of expression ‘cc.LabelTTF’ [undefined] is not an object. at file:///android_asset/www/libs/cocos2d/text_input_node/CCTextFieldTTF.js:88
01-16 05:46:22.854: D/CordovaLog(403): TypeError: Result of expression ‘cc.ParticleSystemQuad’ [undefined] is not an object.
01-16 05:46:22.854: E/Web Console(403): TypeError: Result of expression ‘cc.ParticleSystemQuad’ [undefined] is not an object. at file:///android_asset/www/libs/cocos2d/particle_nodes/CCParticleExamples.js:35
01-16 05:46:23.124: D/CordovaLog(403): TypeError: Result of expression ‘element’ [null] is not an object.
01-16 05:46:23.124: E/Web Console(403): TypeError: Result of expression ‘element’ [null] is not an object. at file:///android_asset/www/libs/cocos2d/platform/CCApplication.js:153


build.xml.zip (0.9 KB)


index.html.zip (0.7 KB)

你的eclips或xcode可能没设好,检查一下phonegap的安装设置

我可以成功phonegap打包,但感觉cocos2d html5打包后,在手机中运行效率并不理想

i try to wrap helloworld sample with phonegap by same way like other web app.
how to wrap in your case?

watson wan wrote:

你的eclips或xcode可能没设好,检查一下phonegap的安装设置
>
我可以成功phonegap打包,但感觉cocos2d html5打包后,在手机中运行效率并不理想

do you wrap the sample with eclips or xcode?

I have wrapped the sample with eclips and xcode,It’s OK.

i use eclipse(indigo version).

watson wan wrote:

do you wrap the sample with eclips or xcode?
>
I have wrapped the sample with eclips and xcode,It’s OK.

Is any android sdk version problem with phonegap?

i use Android 2.2 proyo.
But Phonegap : Disabled addJavascriptinterface() bridge since Android version is old.

Android 2.2 OK? or I must use another sdk version?

Seok Kyu Lim wrote:

i use eclipse(indigo version).
>
watson wan wrote:
>
> do you wrap the sample with eclips or xcode?
>
> I have wrapped the sample with eclips and xcode,It’s OK.

I want to know your develop environment.
please told me your android sdk, phonegap, eclipse, cocos2d-html5, xcode, ios version.

watson wan wrote:

do you wrap the sample with eclips or xcode?
>
I have wrapped the sample with eclips and xcode,It’s OK.

I Think Phonegap Javascript Binding Problem : addJavascriptinterface() bug
Android 4.0 is OK….but sample game(MoonWarrioprs) is very slow(fps : 10 ~ 20).

Seok Kyu Lim wrote:

Is any android sdk version problem with phonegap?
>
i use Android 2.2 proyo.
But Phonegap : Disabled addJavascriptinterface() bridge since Android version is old.
>
Android 2.2 OK? or I must use another sdk version?
>
Seok Kyu Lim wrote:
> i use eclipse(indigo version).
>
> watson wan wrote:
>
> > do you wrap the sample with eclips or xcode?
> >
> > I have wrapped the sample with eclips and xcode,It’s OK.