Problems Setting Up With Android

Problems Setting Up With Android
0.0 0



I just started working with cocos2dx and I was able to create a small game and got it to compile and run on both win32 using visual studio 2010 and xcode on the mac. Now my only problem is I can’t seem to create a project for an android build. I modified the ‘create-android-project.bat’ as follows:

@echo off
:: This script is used to create an android project.
:: You should modify ANDROIDTOOLSCYGBIN *NDKROOT to work under your environment.
:: Don’t change it until you know what you do.
:: Check if it was run under cocos2d-x root
if not exist “cd-android-project.bat” echo Error! You should run it under cocos2dx root & pause & exit 2
if not exist “" echo Script “”\ not\ found\ &\ pause\ &\ exit\ 3
::\ modify\ it\ to\ work\ under\ your\ environment\
set\ CYGBIN=C:if\ not\ exist\ “_CYGBIN”\ echo\ Couldn’t\ find\ Cygwin\ at\ “_CYGBIN”\ &\ pause\ &\ exit\ 4
::\ modify\ it\ to\ work\ under\ your\ environment
if\ not\ exist\ “_ANDROIDTOOLS”\ echo\ Couldn’t\ find\ android\ sdk\ tools\ at\ “_ANDROIDTOOLS”\ &\ pause\ &\ exit\ 5
::\ modify\ it\ to\ work\ under\ your\ environment
set\ NDKROOT=C:-ndk-r8b
if\ not\ exist\ “_NDKROOT”\ echo\ Couldn’t\ find\ ndk\ at\ “_NDKROOT”\ &\ pause\ &\ exit\ 6
::\ create\ android\ project
set\ /P
PACKAGEPATH=Please\ enter\ your\ package\ path.\ For\ example:\ org.cocos2dx.example:
set\ /P\ PROJECTNAME=Please\ enter\ your\ project\ name:
if\ exist\ "CD
PROJECTNAME"\ echo\ “*PROJECTNAME”\ exists,\ please\ use\ another\ name\ &\ pause\ &\ exit\ 7
echo\ "Now\ cocos2d-x\ suppurts\ Android\ 2.1-update1,\ 2.2,\ 2.3\ &\ 3.0"
echo\ "Other\ versions\ have\ not\ tested."
call\ “*ANDROIDTOOLS\android.bat”\ list\ targets
set\ /P\ _TARGETID=Please\ input\ target\ id:

echo\ Create\ android\ project
echo\ Create\ Android\ project\ inside\
call\ “*ANDROIDTOOLS\android.bat”\ create\ project\ -n\ *PROJECTNAME\ -t\ *TARGETID\ -k\ *PACKAGEPATH\ -a\ *PROJECTNAME\ -p\ *PROJECTDIR\
call\ “*ANDROIDTOOLS\android.bat”\ update\ project\ -l\ …/…/cocos2dx/platform/android/java\ -p\ *PROJECTDIR\
::\ Resolve\\ to\ /cygdrive\ based\ *nix\ path\ and\ store\ in\ *CYGSCRIPT
for\ /f\ “delims=”\ A\ in\ ('CYGBIN\cygpath.exe\ "”‘) do set CYGSCRIPT=A
:: Resolve current dir to cygwin path
for /f “delims=” A in do set
:: Resolve ndk dir to cygwin path
for /f “delims=” A in (’_CYGBIN.exe “_NDKROOT”’) do set

:: Throw away temporary env vars and invoke script, passing any args that were passed to us


Whenever I run this script which is located in this path: C:Studio 2010\Projects\cocos2dx\cocos2d-2.0-x-2.0.4

All it does is creates a set of folders with nothing inside this is the path that it makes: C:Studio 2010\Projects\cocos2dx\cocos2d-2.0-x-2.0.4\2010\Projects\cocos2dx\cocos2d-2.0-x-2.0.4\Cocos2dxSimpleGame

If someone can help me sort out this issue that would be great.



I am facing issues on Mac as well…when the project is created, the java files required are not being copied to the directory. I fixed it by compying the files myself…you could just get the older version of cocos2d-x