Android build with cocos2d-js fails, fresh install

-Windows 7 x64
-ndk r9d
-cocos2d-js 3.2 RC0

Setup.py says:

Setting up cocos2d-x...
->Check environment variable COCOS_CONSOLE_ROOT
  ->Find environment variable COCOS_CONSOLE_ROOT...
    ->COCOS_CONSOLE_ROOT is found : C:\Desarrollo\cocos-js\tools\cocos2d-console
\bin

->Configuration for Android platform only, you can also skip and manually edit y
our environment variables

->Check environment variable NDK_ROOT
  ->Find environment variable NDK_ROOT...
    ->NDK_ROOT is found : C:\Desarrollo\ndk\ndk-r9d

->Check environment variable ANDROID_SDK_ROOT
  ->Find environment variable ANDROID_SDK_ROOT...
    ->ANDROID_SDK_ROOT is found : C:\Desarrollo\android

->Check environment variable ANT_ROOT
  ->Find environment variable ANT_ROOT...
    ->ANT_ROOT is found : C:\Desarrollo\ant\bin

android-build.py says:

C:\Desarrollo\cocos-js\build>python android-build.py -p 19 js-tests
C:\Desarrollo\ndk\ndk-r9d\ndk-build -j4 -C C:\Desarrollo\cocos-js\build\..\sampl
es/js-tests/project/proj.android NDK_TOOLCHAIN_VERSION=4.8 NDK_DEBUG=1 NDK_MODUL
E_PATH=C:\Desarrollo\cocos-js\build\..\frameworks/js-bindings/cocos2d-x/..;C:\De
sarrollo\cocos-js\build\..\frameworks/js-bindings/cocos2d-x;C:\Desarrollo\cocos-
js\build\..\frameworks/js-bindings/cocos2d-x/external;C:\Desarrollo\cocos-js\bui
ld\..\frameworks/js-bindings/cocos2d-x/cocos
Android NDK: WARNING:C:\Desarrollo\cocos-js\build\..\frameworks/js-bindings/coco
s2d-x/../cocos2d-x/plugin/protocols/proj.android/jni/Android.mk:PluginProtocolSt
atic: LOCAL_LDLIBS is always ignored for static libraries
make.exe: Entering directory `C:/Desarrollo/cocos-js/samples/js-tests/project/pr
oj.android'
[armeabi] Compile++ thumb: cocostudio_static <= CSParseBinary.pb.cc
[armeabi] StaticLibrary  : libcocos2d.a
C:/Desarrollo/ndk/ndk-r9d/toolchains/arm-linux-androideabi-4.8/prebuilt/windows-
x86_64/bin/arm-linux-androideabi-ar: ./obj/local/armeabi/libcocos2d.a: No such f
ile or directory
make.exe: *** Waiting for unfinished jobs....] Error 1◙
C:\Desarrollo\cocos-js\build\..\frameworks/js-bindings/cocos2d-x/cocos/editor-su
pport/cocostudio/CSParseBinary.pb.cc:20202:1: fatal error: opening dependency fi
le ./obj/local/armeabi/objs-debug/cocostudio_static/CSParseBinary.pb.o.d: No suc
h file or directory
 }  // namespace protocolbuffers
 ^
compilation terminated.
make.exe: *** [obj/local/armeabi/objs-debug/cocostudio_static/CSParseBinary.pb.o
] Error 1
make.exe: Leaving directory `C:/Desarrollo/cocos-js/samples/js-tests/project/pro
j.android'
Build dynamic library for project [ C:\Desarrollo\cocos-js\build\..\samples/js-t
ests/project/proj.android ] fails!

What’s wrong? :frowning:

How did you update Cocos2d-JS to v3.2 RC0 ? Via the official download link ? Or update it via github ?

@joshua_astray do you have any idea ?

I don’t know. Maybe try to clean and rebuilt.

It’s a clean installation. I downloaded it via the official download link.
Here’s what I did, I hope it is right:
-Downloaded the Java JDK, version 7_71, for x86_64
-Set “JAVA_HOME” pointing to the JDK location
-Include the “bin” folder in the JDK in the PATH
-Downloaded Cocos2d-JS 3.0 RC0 from the official link
-Downloaded ndk r9d for x86_64
-Downloaded android ant for x86_64 from the apache official link
-Downloaded android tools, opened the SDK manager using a modified android.bat since the last version of android tools can’t even open the damn SDK manager without that fix (the “set swt_path=lib\x86_64” fix)
-Installed android platform 19, android build tools, android platform tools

  • Run setup.py, set NDK_ROOT, ANDROID_SDK_ROOT, ANT_ROOT_ COCOS_CONSOLE_ROOT
  • Run android-build.py -p 19 js-tests

What am I missing? Here’s a screeshot of my PATH variables, I think I can’t give more detailed info lol:



I find this amusing since I’ve (supposedly) done a fresh install of every relevant part of the environment.

EDIT: in the screenshot you can see that in the user path and in the console_root variable I’m pointing to the version 3.1 of cocos2d. That was just a test and the error is still there after changing it anyway.

P.S.: the previous version of Cocos doesn’t seem to be working either. Changing “-p 19” to another version of Android does not affect anything. Changing “js-tests” to “js-moonwarriors” does not affect anything.

I should probably just create a VirtualBox machine with Windows 7 32 bit and compile there. Lol

How do I do that? Also look at my previous post, I hope it helps

Oooh wait, someone said somewhere that if you use the JRE that is included with the JDK you might run into problems or something. I don’t know if that’s correct but I’m going to try anyway.
Edit: changing the java line in the path from JDK\bin to JRE\bin did not affect anything. Sigh.
(Neither did changing the jdk and the jre to the x86 version)

BTW looks like the error is because it can’t find two files in “./obj/local/armeabi/”, and I don’t know but that path is nowhere to be found in the cocos2d directory. Is that directory supposed to exist? Where if so?

The path should be

frameworks ▸ runtime-src ▸ proj.android ▸ obj ▸ local

You can try to delete all files in obj folder then recompile, not sure it helps

Well I created a virtual machine with Windows XP and it’s working. Not much of a hassle to build there anyway.