play-co / devkit

HTML 5 game platform for browser and mobile
http://docs.gameclosure.com
627 stars 126 forks source link

build android error #224

Open mbaatartsogt opened 9 years ago

mbaatartsogt commented 9 years ago

Error: spawn ENOENT at errnoException (child_process.js:1011:11) at Process.ChildProcess._handle.onexit (child_process.js:802:34)

vnodecg commented 9 years ago

ENOENT is Error No ENTry probably permission issue. Try running as sudo

softvar commented 9 years ago

Not working even with sudo. Any solution?

fairfieldt commented 9 years ago

What operating system are you running?

Do you have the android sdk and ndk installed?

Is your path setup correctly? You should be able to run ant and ndk-build from the commandline.

softvar commented 9 years ago

I'm on OS X 10.10.3 Android SDK is installed, I even downloaded NDK and run build but ant and ndk-build commands not working. How to correct the paths and make them accessible inside my game-folder? Any help would be appreciated.

softvar commented 9 years ago

I have successfully installed ndk-build and set path in my ~/.zshrc. Also, I installed ant using brew.

Now when I type ant in terminal, I get

Apache Ant(TM) version 1.9.4 compiled on April 29 2014

and when ndk-build:

Android NDK: Could not find application project directory !
Android NDK: Please define the NDK_PROJECT_PATH variable to point to it.
/Users/softvar/Downloads/android-ndk-r10d/build/core/build-local.mk:148: *** Android NDK: Aborting    .  Stop.

Now both are installed, running devkit debug native-android --no-compress --debug --clean

      [android]    android create project --target android-15 --name demoAccelerometer --path /Users/softvar/side-projects/devkit/demoAccelerometer/build/debug/native-android --activity demoAccelerometerActivity --package com.gameclosure.demoAccelerometer

events.js:72
        throw er; // Unhandled 'error' event
              ^
Error: spawn ENOENT
    at errnoException (child_process.js:988:11)
    at Process.ChildProcess._handle.onexit (child_process.js:779:34)
softvar commented 9 years ago

Ok..now ndk-build, ant and android commnads are working fine in terminal.

No more error like the following:

 [android]    android create project --target android-15 --name demoAccelerometer --path /Users/softvar/side-projects/devkit/demoAccelerometer/build/debug/native-android --activity demoAccelerometerActivity --package com.gameclosure.demoAccelerometer

events.js:72
        throw er; // Unhandled 'error' event
              ^
Error: spawn ENOENT
    at errnoException (child_process.js:988:11)
    at Process.ChildProcess._handle.onexit (child_process.js:779:34)

But now running devkit debug native-android --no-compress --debug --clean, the process gets started but with warnings of build error: Screenshot 1: https://www.dropbox.com/s/0yoood8oegglxxo/Screenshot%202015-05-13%2014.04.53.png?dl=0 Screenshot 2: https://www.dropbox.com/s/yectm7ygfoeaex0/Screenshot%202015-05-13%2014.05.09.png?dl=0

and gets stuck at:

[native-android]    Reading plugin XML: /Users/softvar/side-projects/devkit/demoAccelerometer/modules/devkit-accelerometer/android/manifest.xml
[native-android]    Transforming XML with plugin XSL for /Users/softvar/side-projects/devkit/demoAccelerometer/modules/devkit-accelerometer/android/manifest.xsl
[native-android]    [error]  settings for AndroidManifest: value for gameHash is not a string
     [jvmtools]    connected to localhost:59159
[native-android]    Applying final XSL transformation
[native-android]    [error]  settings for AndroidManifest: value for gameHash is not a string

Please help!

fairfieldt commented 9 years ago

The first error looks like the actual problem.

Can you make a new project devkit init testproject

and then try running the build in there? That way we can eliminate any issue with the demo project.

softvar commented 9 years ago

I created a new project as you mentioned, install google API target 19. devkit init testproject

then run devkit debug native-android --no-compress --debug --clean But again errors:

 [ndk-build]   make: *** [obj/local/armeabi/objs-debug/tealeaf/js/js.o] Error 1
    [ndk-build]   make: *** [obj/local/armeabi/objs-debug/tealeaf/js/js_build.o] Error 1
    [ndk-build]   In file included from jni/js/js_console.h:18:0,
                 from jni/js/js_console.cpp:17:
jni/js/js.h:18:26: fatal error: core/core_js.h: No such file or directory
 #include "core/core_js.h"
                          ^
    [ndk-build]   compilation terminated.
    [ndk-build]   make: *** [obj/local/armeabi/objs-debug/tealeaf/js/js_console.o] Error 1
        [build]    [error]  build failed
        [build]    [error]  2
        [build]    1.75 seconds elapsed
[native-android]    No plugin XML to inject
[native-android]    Applying final XSL transformation
[native-android]    [error]  settings for AndroidManifest: value for gameHash is not a string
     [jvmtools]    connected to localhost:57911

My aim is to run https://github.com/gameclosure/demoAccelerometer demo on my Android phone - 4.4.4 Kitkat. I have coded for a game but not able to test it on a real device, this is frustrating now!

softvar commented 9 years ago

@fairfieldt Can you please help?

fairfieldt commented 9 years ago

It looks like you might have an out of date android plugin. Make sure you have the latest devkit.

Don't worry - we'll get this figured out :-)

softvar commented 9 years ago

Devkit version: 2.1.1 and android is also latest.

collingreen commented 9 years ago

@softvar can you post the commit of native-android you are on?

From your project's root folder:

cd modules/devkit-core/modules/native-android
git status

HEAD detached at 6e0c763