cocos2dx error Build dynamic library for project failed - android

'cocos' is not recognized as an internal or external command, operable program or batch file.
E:\cocos2d-x-3.14.1\build>python android-build.py -p 21 cpp-tests

Is your cocos is configure correctly? Try this, Open your cmd(command prompt) and type cocos
enter image description here

cmd not recognize cocos because cocos2d-x-3.14.1\tools\cocos2d-console\bin folder is not exist into environment path variable.
run python setup.py from your cocos2d-x-3.14.1 folder, before building test project.
setup.py set required Environment Variables, if already set then good otherwise prompt to set required NDK_ROOT, ANDROID_SDK_ROOT, ANT_ROOT, COCOS_CONSOLE_ROOT, COCOS_X_ROOT, COCOS_TEMPLETS_ROOT
COCOS_CONSOLE_ROOT is path to cocos2d-x-3.14.1\tools\cocos2d-console\bin
bin folder containing cocos.bat file that run cocos.py script

try this
switch from ndk9b to ndk9d.
the recent version of cocos2dx made a switch from ndk9b to ndk9d.
i hope thats helpfull for you

Related

ERROR android-emu/android/qt/qt_setup.cpp:28:Qt library not found at ..\emulator\lib64\qt\lib Could not launch 'C:\Users: No such file or directory

I am trying to work with the native native for a school project, but when executing the following command in cmd: emulator -version he returned this error to me:
[4640]:ERROR:android/android-emu/android/qt/qt_setup.cpp:28:Qt library not found at ..\emulator\lib64\qt\lib
Could not launch 'C:\Users\gusta..\emulator\qemu\windows-x86_64\qemu-system-i386.exe': No such file or directory
already changed the path in several ways and I think the problem is not this so if someone can help me grateful
There are two emulator executables in the sdk (as of now):
sdk/tools/emulator
sdk/emulator/emulator
The emulator executable has to be added in the PATH variable, in a way so that
sdk/emulator/emulator comes before sdk/tools/emulator
Do this to solve the error:
Edit the system environment variables
Make sure you have set user variable for ANDROID_HOME
Remove any variable /path/to/android-sdk/tools from user and system environment variable.
Save and exit
To resolve this error:
Your system variables should look like below:
“C:\Users\username\AppData\Local\Android\Sdk” -ANDROID_HOME
“C:\Users\username\AppData\Local\Android\Sdk\tools\bin” -PATH
“C:\Users\username\AppData\Local\Android\Sdk\platform-tools” -PATH
“C:\Users\username\AppData\Local\Android\Sdk\emulator” - PATH
“C:\Users\username\AppData\Local\Android\Sdk\tools" -PATH
This worked for me.
Based on the answer of IronBlossom.
On mac these are the important environment variables that need to be adjusted.
export PATH=$PATH:$ANDROID_HOME/emulator
export PATH=$PATH:$ANDROID_HOME/tools
Make sure that emulator comes before tools

Android Tess-two: library configuration using cygwin

i am following this tutorial here to use Tesseract libs for android. and in step(b) in the link posted, it says: b.export TESSERACT_PATH=${PWD}/external/tesseract-3.01
and in cygwin i wrote the following:
dm#me /cygdrive/e/Data/private/Fr/OCR/libs/tess-two-
master/tess-two-master/tess-two
but when i execute it i receive the belwo error:
$ export C:\Program Files (x86)\Tesseract-OCR=${PWD}\external\tesseract-3.01
-bash: syntax error near unexpected token `('
please let me know how to fix it, as i am a beginner to cygwin.
update:
i tried ezrepotein4 answer, and now it gives me "not a valid identifier". please , let me know what is "external\tesseract-3.01", i do not have these files/folders...and what is PWD. thanks
In this tutorial author uses few linux commands:
cd which changes directory - it is an equevalent of windows dir
export which sets environment variable
Before exporting any variable you should change directory to your project dir, because all $PWD strings in further commands will be replaced by your current directory.
This tutorial assumes that you compiled tesseract and leptonica and you keep them in project-dir/tess-two/external directory as tesseract-3.01 and leptonica-1.68. Source code for those libraries are in tess-two/jni directory in repository as stated in README.md https://github.com/rmtheis/tess-two/blob/master/README.md
Code which you are trying yo execute is incorrect both syntactically and semantically. It is incorrect syntactically because you all spaces are treated as separators between arguments. Semantically you are trying to set variable C:\Program Files (x86)\Tesseract-OCR to value of ${PWD}\external\tesseract-3.01. Instead you should set TESSERACT_PATH variable.
To do this try command TESSERACT_PATH=${PWD}/external/tesseract-3.01 as stated in tutorial. This means that you are setting variable TESSERACT_PATH to folder external/tesseract-3.01 in your current dir.
To further inspect a value of this variable type: echo $TESSERACT_PATH.

SDK Manager is executing in cmd but not opening

Config Details:
Windows 8 Pro 32bit
adt-bundle-windows-x86-20130717
jdk-6u26-windows-i586 32bit
Directories:
For Java - C:\Program Files\Java\jdk1.6.0_26
For Android Root - Z:\Program Files\Android
For Android SDK - Z:\Program Files\Android\sdk
Environmental Variables:
var_name: JAVA_HOME
var_value: C:\Program Files\Java\jdk1.6.0_26\
var_name: JDK_HOME
var_value: C:\Program Files\Java\jdk1.6.0_26\
var_name: Path
var_value: C:\Program Files\Java\jdk1.6.0_26\bin
Modification:
1)
set java_exe=
"%JAVA_HOME%\bin\java.exe"
if not defined java_exe goto :EOF
2)
for /f %%a in ('"%~dps0\find_java.exe" -s') do set java_exe=%%a
3)
for /f %%a in ('"%~dps0\find_java.exe" -s -w') do set javaw_exe=%%a
First i downloaded adt-bundle then extracted into Android Root directory (i installed java far earlier) then i installed ADT Plugins from https://dl-ssl.google.com/android/eclipse/ and successfully connected Eclipse IDE with Android SDK. Now i am trying to Android SDK Components but when i clicked on Window-> Android SDK Manager in Eclipse a dialogue box opened said SDK Manager will open in a while but it didn't. Whenever i try to open SDK Manager everytime a cmd prompt for a second then disappear and nothing happened while AVD Manager open properly.
Then i went through some solution in several forums and modified some line of code (as of modification 1 in tools\android.bat ; 2 and 3 in tools\lib\find_java.bat)
Now in command line
Z:\Program Files\Android\sdk\tools>android
Usage: java [-options] class [args...]
(to execute a class)
or java [-options] -jar jarfile [args...]
(to execute a jar file)
where options include:
-client to select the "client" VM
-server to select the "server" VM
-hotspot is a synonym for the "client" VM [deprecated]
The default VM is client.
-cp <class search path of directories and zip/jar files>
-classpath <class search path of directories and zip/jar files>
A ; separated list of directories, JAR archives,
and ZIP archives to search for class files.
-D<name>=<value>
set a system property
-verbose[:class|gc|jni]
enable verbose output
-version print product version and exit
-version:<value>
require the specified version to run
-showversion print product version and continue
-jre-restrict-search | -jre-no-restrict-search
include/exclude user private JREs in the version search
-? -help print this help message
-X print help on non-standard options
-ea[:<packagename>...|:<classname>]
-enableassertions[:<packagename>...|:<classname>]
enable assertions
-da[:<packagename>...|:<classname>]
-disableassertions[:<packagename>...|:<classname>]
disable assertions
-esa | -enablesystemassertions
enable system assertions
-dsa | -disablesystemassertions
disable system assertions
-agentlib:<libname>[=<options>]
load native agent library <libname>, e.g. -agentlib:hprof
see also, -agentlib:jdwp=help and -agentlib:hprof=help
-agentpath:<pathname>[=<options>]
load native agent library by full pathname
-javaagent:<jarpath>[=<options>]
load Java programming language agent, see java.lang.instrument
-splash:<imagepath>
show splash screen with specified image
Z:\Program Files\Android\sdk\tools>
As you can see that my attempts are successful and android.bat is executing but the problem is when i try to open SDK Manager directly or via IDE again nothing happened but executing in cmd. I cannot understand what happening actually and i am unable to found anything related with this in any forum. Please Help. Thanks in advance.
In your PATH environmental variable, move *C:\Program Files\Java\jdk1.6.0_26\bin* to the beginning of the collection, and see if that addresses the issue.
Most likely the directory structure of your sdk installation changed. Try running android.bat from the sdk directory
Z:\Program Files\Android\sdk>tools\android.bat
If the sdk Manager opens (close it) and set the work_dir in android.bat to the sdk directory. In android.bat change line
set work_dir="%cd%"
to
set work_dir="Z:\Program Files\Android\sdk"
or to
set work_dir="%~dp0.."
If the above does not work try to get more information what is wrong in calling java, output the java call to the console. In android.bat change line
call %java_exe% .....
to
echo call %java_exe% .....
Good luck
android.bat seems to have a problem running from a samba share mounted on my windows system. This fixes the problem for me.
V:\>android
Usage: java [-options] class [args...]
(to execute a class)
or java [-options] -jar jarfile [args...]
(to execute a jar file)
[snip]
V:\>c:
C:\Users\me>android
I had this same problem and I found that none of the "set" commands in beginning of the batch file worked correctly.
prog is set to ~f0.
work_dir is empty
cd /d ~dp0 results in an error "The filename, directory name, or volume label syntax is incorrect."
Android.bat requires command extensions enabled in order to run correctly.
Restore the original batch file and edit this line
from...
setlocal
to...
setlocal enableExtensions
This should set all the environment variables correctly so that they don't need to be hard coded.
You can also enable command extensions in the registry. Reboot after making this change.
HKEY_CURRENT_USER\Software\Microsoft\Command Processor\EnableExtensions = 1

Creating new, first, phonegap Android project on mac returns error: ANDROID_BIN="${ANDROID_BIN:=$( which android )}" exited with 1

I installed the all the recommended programs from PhoneGap's Getting Started Guide and followed the various steps.
I created the .bash_profile file and it looks like this:
export PATH=${PATH}:/Development/android-sdk-mac/sdk/platform-tools:/Development/android-sdk-mac/sdk/tools
The Development folder is located on my desktop. Upon navigating in terminal to my bin directory and creating a new PhoneGap project, i did like so:
./create /Users/joey/PhoneGapExample nl.symvoli.phonegapExample PhoneGapDemo
I get the following error:
An unexpected error occurred: ANDROID_BIN="${ANDROID_BIN:=$( which android )}" exited with 1
Deleting project...
I searched around what might cause this problem and everything seems to be pointing to value of the $PATH environment variable. When i ran echo $PATH in my terminal, it returns this:
/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/Development/android-sdk-mac/sdk/platform-tools:/Development/android-sdk-mac/sdk/tools
Any help would be much appreciated.
I'm on a Mac, running Mac OSX 10.8.3
just command this in terminal/console
export PATH=${PATH}:"/Applications/Android Studio.app/sdk/tools":"/Applications/Android Studio.app/sdk/platform-tools"
check with echo $PATH and you show this
/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/usr/local/git/bin:/usr/X11/bin:/Applications/Android Studio.app/sdk/tools:/Applications/Android Studio.app/sdk/platform-tools
have you executed the ./create script with sudo?
if you run the script with sudo:
sudo ./create .....
you have another environment setted.
otherwise you have to export ANDROID_BIN variable
export ANDROID_BIN=/<your_android_sdk>/tools/android
I had the same issue. For me the issue was that I had set the PATH variable as described in step 3 of the tutorial, but I made a mistake and the PATH I specified was actually wrong.
So if it does not work with sudo, you might want to try and check the path again.
When I ran ./create I immediately received an error:
An unexpected error occurred: ANDROID_BIN="${ANDROID_BIN:=$( which android )}" exited with 1
Deleting project...
If you open up the create file (phonegap-2.7.0/lib/android/bin/create) with textEdit, there is a line that lists
ANDROID_BIN=”${ANDROID_BIN:=$( which android )}”.
The “which android” is the cause of the issue
If you replace this line with the full path to your android tools (SDK), it should resolve the issue. It looked like this:
ANDROID_BIN=/Users/cswjs/Documents/Dev/adt-bundle/sdk/tools/android
Hope this could help someone!
you can also try this
1.
open ~/.bash_profile
2.
export PATH=${PATH}:"/Users/**username_here**/Documents/adt-bundle-mac-x86_64-20131030/sdk/platform-tools:/Users/**username_here**/Documents/adt-bundle-mac-x86_64-20131030/sdk/tools"
3.
source ~/.bash_profile
Close Terminal, open Termial again and ...
just like found in here: http://yandr.randy.boy.jp/?eid=6
didn't understand a word but saw the last link and it worked for me :D
I've the same issue, in my configuration (mac pro + android studio) the sdk path was "/Applications/Android Studio.app/sdk". The problem is how you specify in "export $PATH=..." a new path added (/Application/Android Studio.app/sdk/tools and so on), seem that using '"' work with export $PATH for bash but does not work with script "create" with Phonegap. My end solution it's to move sdk in an alternative directory without blank in is name.
This is probably because of a wrong PATH. Refer this blog post

phonegap android sample project not building

I'm trying to follow the setup instructions on phonegap-android's wiki page, but I'm having trouble. I've got all of the prereqs/path variables/etc set-up, but when I execute the command (in gitbash as per the instructions) for building the project, I get errors which I do not understand.
Here is the script which I run:
$ ruby ./droidgap "C:/android-sdk-windows" pgtest com.example.android.pgtest "C
:/xfer/input" "C:/xfer/output"
and here is the result I get:
Building the JAR...
'/*' is not recognized as an internal or external command,
operable program or batch file.
'Licensed' is not recognized as an internal or external command,
operable program or batch file.
'contributor' is not recognized as an internal or external command,
operable program or batch file.
'this' is not recognized as an internal or external command,
operable program or batch file.
'The' is not recognized as an internal or external command,
operable program or batch file.
you was unexpected at this time.
Creating Android project for target level 8
Adding www folder to project...
Generating manifest...
Copying over libraries and assets and creating phonegap.js...
c:/Ruby192/lib/ruby/1.9.1/fileutils.rb:1418:in stat': No such file or directory
- c:/Users/<user>/Desktop/phonegap/framework/phonegap.jar (Errno::ENO
ENT)
from c:/Ruby192/lib/ruby/1.9.1/fileutils.rb:1418:inblock in fu_each_sr
c_dest'
from c:/Ruby192/lib/ruby/1.9.1/fileutils.rb:1432:in fu_each_src_dest0'
from c:/Ruby192/lib/ruby/1.9.1/fileutils.rb:1416:infu_each_src_dest'
from c:/Ruby192/lib/ruby/1.9.1/fileutils.rb:391:in cp'
from ./droidgap:82:incopy_libs'
from ./droidgap:20:in run'
from ./droidgap:157:in'
I've looked through the phonegap forums, and I've found some hits on part of the error (the part where phonegap.jar could not be found), but nothing on the first part ("_ is not recognized", etc.). What am I doing wrong? Thanks.
Additional info:
-Windows 7 (32 bit)
-ruby 1.9.1
-java jdk1.6.0_21
-ant 1.8.1
Got it working. I remembered reading that windows users sometimes needed to add ".bat" to the end of certain commands, so I changed ant to ant.bat in the droidgap script and it worked.
Also, this guy had the same issue as me and I somehow missed it.
I've had various problems with building the Example PhoneGap App (http://wiki.phonegap.com/w/page/16494774/Getting-started-with-Android-PhoneGap-in-Eclipse)
Some of the error messagesI had are:
- in `': No such file or directory - android-sdk-path.bat android.bat (Errno::ENOENT)
- instat': No such file or directory - ~/projects/phonegap-android/framework/phonegap.jar
BUT IT'S NOW FIXED!!!
To fix the issues I had to tweak a lot of things , so I'm not too sure which one fixed what, but here's my system in the end (note: I'm on Windows Vista)
COMPATIBLE versions
- apache ant 1.8.2
- Ruby 1.8.7
- Java SDK 1.6
- Git Bash 1.7.3.1
Environment Variables:
- ANDROID_HOME = \android-sdk-windows
- ANT_HOME = \apache-ant-1.8.2
- JAVA_HOME = \jdk1.6.0_13
- RUBY_HOME = \Ruby187
- PHONEGAP_ANDROID = \phonegap-android
- Path - add these %JAVA_HOME%\bin;%ANT_HOME%\bin;%ANDROID_HOME%\tools;%ANDROID_HOME%\platform-tools;%RUBY_HOME%
\bin;%PHONEGAP_ANDROID%\bin
Using Git Bash - use NEW METHOD - ruby bin/droidgap create example
RESULT: successfully created two outputs; a file called 'PhoneGap.jar' and an Android Eclipse project to be imported into Eclipse
Hope this helps

Categories

Resources