JS buindings absolutly UNUSABLE on Android!

Hello.

My company used JS buildings for several iOS projects with great success, but on the Android it is just nightmare. It is absolutely unreliable technology.

The biggest problem is NO ONE WARN about POOR state on technology on Android.

If you download latest stable release of cocos-2dx and will try to run ANY sample on e.g. LG-P500 480x320 that NOTHING will work. It works sometimes on tablets, but it mostly fails on phones. It is very hard and time consuming to debug it.

I have no hope that developers of cocos-2dx will fix, but I want to warn people who do real-life projects NEVER use it and never start Android project with JS bindings.

Cheers.

Did you try it on other android phones?
Do you mean that jsb can’t work on all android phones?

Hi Draco,

First, congratulation for the success on iOS.

JS binding for iOS and Android are almost the same. They use the same JS engine, use the same JS binding codes.
So there are not big difference between them.

Yep, it is hard to debug on Android with NDK, but it is not caused by JS binding.
Of course, it is hard to debug js codes now, no matter on iOS or Android. But we are resolving this problem.

About JS samples, i haven’t met the problem you said. I can run them on HTC G10, i9100, Nexus X i9023, and SAMSUNG Galaxy Note II.
I don’t want to say JS binding can work on all Android devices, because there are too many types. What i want to say is that, JS binding
on Android is not so bad.

Draco, thank you for your feedback. I hope more developers can write feedback here.
Thank you.

Minggo Zhang wrote:

Hi Draco,
>
First, congratulation for the success on iOS.
>
JS binding for iOS and Android are almost the same. They use the same JS engine, use the same JS binding codes.
So there are not big difference between them.
>
Yep, it is hard to debug on Android with NDK, but it is not caused by JS binding.
Of course, it is hard to debug js codes now, no matter on iOS or Android. But we are resolving this problem.
>
About JS samples, i haven’t met the problem you said. I can run them on HTC G10, i9100, Nexus X i9023, and SAMSUNG Galaxy Note II.
I don’t want to say JS binding can work on all Android devices, because there are too many types. What i want to say is that, JS binding
on Android is not so bad.
>
Draco, thank you for your feedback. I hope more developers can write feedback here.
Thank you.

Hello, Minggo Zhang.

I also have run it on more than 7 android devices, but this changes nothing. There a lot of devices there we can not run it. We are not kids who trying to make the first game. In real-life customers have QA department and your company is not being paid until it run on of most devices. And you will not get money after you tell them “hey, it works on 7 devices for me”.

Try to run JS tests or any of sample JS games on Android phones with resolution 480*320 or 320*240, maybe you will figure out something useful.

@ Draco, LLC Draco

Issue #1726 was created. I will fix it ASAP. Thanks for your feedback.

James Chen wrote:

@ Draco, LLC Draco
>
Issue #1726 was created. I will fix it ASAP. Thanks for your feedback.

Thanks, James Chen.
That is awesome.

But if you will not do it today or tomorrow please give a short guide on how to do this - we really need to fix it ASAP.

Fixed at https://github.com/cocos2d/cocos2d-x/pull/1993.
Could you try again?

James Chen wrote:

Fixed at https://github.com/cocos2d/cocos2d-x/pull/1993.
Could you try again?

James Chen, you are awesome! It works. Thanks one million times.

Did you use android-ndk-r8d ? When i switched ndk to r8b, there was a linking error.

Draco, LLC Draco wrote:

James Chen wrote:
> Fixed at https://github.com/cocos2d/cocos2d-x/pull/1993.
> Could you try again?
>
James Chen, you are awesome! It works. Thanks one million times.

James Chen wrote:

Did you use android-ndk-r8d ? When i switched ndk to r8b, there was a linking error.
>
Draco, LLC Draco wrote:
> James Chen wrote:
> > Fixed at https://github.com/cocos2d/cocos2d-x/pull/1993.
> > Could you try again?
>
> James Chen, you are awesome! It works. Thanks one million times.

Yes, I use android-ndk-r8d.

If building with android-ndk-r8b, there is a linking error as follows:

Prebuilt       : js_static.a <= /Users/james/Project/cocos2d-x/template/multi-platform-js/proj.android/../../../scripting/javascript/spidermonkey-android/./lib/armeabi/
StaticLibrary  : libscriptingcore-spidermonkey.a
SharedLibrary  : libcocos2djs.so
/Users/james/Software/android/android-ndk-r8b/toolchains/arm-linux-androideabi-4.6/prebuilt/darwin-x86/bin/../lib/gcc/arm-linux-androideabi/4.6.x-google/../../../../arm-linux-androideabi/bin/ld: ./obj/local/armeabi/libscriptingcore-spidermonkey.a(ScriptingCore.o)(.text._ZL19removeJSTouchObjectP9JSContextPN7cocos2d7CCTouchERN2JS5ValueE.isra.8+0xb6): unresolvable R_ARM_THM_CALL relocation against symbol `memcmp'
/Users/james/Software/android/android-ndk-r8b/toolchains/arm-linux-androideabi-4.6/prebuilt/darwin-x86/bin/../lib/gcc/arm-linux-androideabi/4.6.x-google/../../../../arm-linux-androideabi/bin/ld: final link failed: Nonrepresentable section on output
collect2: ld returned 1 exit status

I don’t know whether it’s the bug of ndk-r8b.