Making apk for android (Failed)

I developed a new game using cocos-js and cocos code IDE, it is working perfect on Andorid remote debugging, I am trying now to generate the apk, but unfortunately, I am getting an error when I use cocos-js V3.0 final version and when I use RC2 version, I am able to generate the apk but when I download it to the device it is giving blank black screen…

any idea please…

We will need more informations, like the error message, your game code snippets, etc to be able to help you

Thank you for your reply.

I will explain what I did exactly:
1- I create a new cocos-js project using runtime template
2- I followed the instructions to include facebook SDK.
3- I tried to make the .apk file without changing any line of code
4- I am getting the below message (“could you please advise me if there is any document that can help me to add plugins to my game, I really spend more than two days surfing the net without any hope.”)

Android NDK: WARNING: APP_PLATFORM android-19 is larger than android:minSdkVersion 9 in ./AndroidManifest.xml
Android NDK: D:\Projects\Cocos\plugins\MyJSGame\frameworks\runtime-src\proj.android…/…/js-bindings/cocos2d-x/cocos/editor-support/cocostudio/Android.mk: Cannot find module with tag ‘…/js-bindings/cocos2d-x/plugin/jsbindings/cocos2d-x/plugin/jsbindings’ in import path
Android NDK: Are you sure your NDK_MODULE_PATH variable is properly defined ?
Android NDK: The following directories were searched:
Android NDK:
make.exe: Entering directory D:/Projects/Cocos/plugins/MyJSGame/frameworks/runtime-src/proj.android' make.exe: Leaving directoryD:/Projects/Cocos/plugins/MyJSGame/frameworks/runtime-src/proj.android’
Runing command: compile
Building mode: release
building native
The Selected NDK toolchain version was 4.8 !
running: ‘d:\android-ndk-r9d\ndk-build -C D:\Projects\Cocos\plugins\MyJSGame\frameworks\runtime-src\proj.android -j1 NDK_MODULE_PATH=D:\Projects\Cocos\plugins\MyJSGame\frameworks\runtime-src\proj.android…/…/js-bindings;D:\Projects\Cocos\plugins\MyJSGame\frameworks\runtime-src\proj.android…/…/js-bindings/external;D:\Projects\Cocos\plugins\MyJSGame\frameworks\runtime-src\proj.android…/…/js-bindings/cocos2d-x;D:\Projects\Cocos\plugins\MyJSGame\frameworks\runtime-src\proj.android…/…/js-bindings/cocos2d-x/cocos;D:\Projects\Cocos\plugins\MyJSGame\frameworks\runtime-src\proj.android…/…/js-bindings/cocos2d-x/external’

Error running command, return code: 2

Do you have your ndk at this address “d:\android-ndk-r9d\ndk-buil” ?
Otherwise, @honghui_zhang can you please help our friend

yes it is there pandamicro…

Can you just enter this command in the command line tool to see whether it works or not?
d:\android-ndk-r9d\ndk-build

If it doesn’t, there should be a problem with your ndk, you may need to redownload it

yes it is working

C:\Users\shadi>d:\android-ndk-r9d\ndk-build
Android NDK: Could not find application project directory !
Android NDK: Please define the NDK_PROJECT_PATH variable to point to it.
d:\android-ndk-r9d\build/core/build-local.mk:148: *** Android NDK: Aborting . Stop.

making apk is working fine with me if I don’t add the stuff related to facebook integration, so do u have any step by step tutorial to get the plugins working with cocos-js, this can help me alot.

I really appreciate your quick responses.

This is the android integrate guide
http://www.cocos2d-x.org/docs/manual/framework/html5/facebook-sdk/facebook-sdk-on-android/en

unfortunately, this is the exact file I followed, :frowning:
and I did it many time step by step and always same results…

Which engine version are you using?

3.0 final version

We will test it and tell you the result

WAAWW… really I appreciate this level of support…I am waiting your test results.

We have tested it and it works well, we suggest you to do the following,

You may have two options:

  1. Create a project with the default template:

    • cocos new -l js
    • follow the tutorial of Facebook integration.
  2. If you want to use the runtime template, please create your project with Code IDE, do not use cocos commande.

Did you do that in Windows cmd with cocos console? Make sure your ndk version is r9d and your cocos in environment variables is correctly referenced to 3.0final path.

I will test this today and let you know the results.
and I will document the steps one by one to be useful for others if it works.

Thank you and good luck !

Hi Pandamirco,

I’ve tested your approach and document it step by step, everything went smooth, and I could be able to generate the apk file, but whenever I deploy and run it on the phone, it is giving a blank black screen showing just the GL vers, GL calls, and frame rate :frowning:

could you please check the attached document and let me know what is missing.facebook Integration Step by Step.zip (977.7 KB)

I’ve run the project in eclipse and lunch it to the device, I got the attached LogCat Items.log.zip (1.6 KB)

I hope this can help to figure out the issue.