Trying to android ndk and cygwin - android

i am trying to build andriod - cocos2d-x-2.2.5 project which just a simple hello world project but when i try to run by entering ./build-native.sh in cygwin i got following warning and i am not able to proceed further.
$ ./build_native.sh
NDK_ROOT = C:\android-ndk-r10d
COCOS2DX_ROOT = /cygdrive/c/cocos2d-x-2.2.5/cocos2d-x-2.2.5/projects/helloWorld/proj.android/../../..
APP_ROOT = /cygdrive/c/cocos2d-x-2.2.5/cocos2d-x-2.2.5/projects/helloWorld/proj.android/..
APP_ANDROID_ROOT = /cygdrive/c/cocos2d-x-2.2.5/cocos2d-x-2.2.5/projects/helloWorld/proj.android
Using prebuilt externals
make: Entering directory '/cygdrive/c/cocos2d-x-2.2.5/cocos2d-x-2.2.5/projects/helloWorld/proj.android'
/cygdrive/c/android-ndk-r10d/build/core/build-all.mk:89: Android NDK: ***WARNING: There are no modules to build in this project!***
make: Leaving directory '/cygdrive/c/cocos2d-x-2.2.5/cocos2d-x-2.2.5/projects/helloWorld/proj.android'

This error:
WARNING: There are no modules to build in this project!
can happen if you haven't created the symbolic link in the release NDK directory.
You can read more about the issue here.
How to create symbolic links when using cygwin is addressed in this SO post:
How to make symbolic link with cygwin

Related

Compiling React Native project with local fork - NDK_PROJECT_PATH

I'm trying to compile my React Native Android project using a local fork of react-native. I've followed the building from source guide and completed all steps (not using Android Studio).
When I try to run react-native run-android (from project root as normal), I get:
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':ReactAndroid:buildReactNdkLib'.
> Process 'command '/usr/local/opt/android-ndk/ndk-build'' finished with non-zero exit value 2
When I run ndk-build (from project root), I get:
Android NDK: Could not find application project directory !
Android NDK: Please define the NDK_PROJECT_PATH variable to point to it.
/usr/local/Cellar/android-ndk/r12b/build/core/build-local.mk:151: *** Android NDK: Aborting . Stop.
Another SO thread pointed me in the direction of running ndk-build from ./android/app/src and create a jni directory there (I didn't have one), but I'm unsure how to obtain or create jni/Android.mk correctly or if this will even help me. I've tried creating jni/Application.mk with contents APP_BUILD_SCRIPT := Android.mk and jni/Android.mk with the setup described in that SO question. Running ndk-build from android/app/src exits with the following error:
Android NDK: Your APP_BUILD_SCRIPT points to an unknown file: Android.mk
/usr/local/Cellar/android-ndk/r12b/build/core/add-application.mk:198: *** Android NDK: Aborting... . Stop.
I have the Android SDK and NDK installed with Homebrew and I have the following exports:
ANDROID_HOME=/usr/local/opt/android-sdk
ANDROID_SDK=/usr/local/opt/android-sdk
ANDROID_NDK=/usr/local/opt/android-ndk
ANDROID_NDK_HOME=/usr/local/opt/android-ndk
I feel like I'm close, but have no idea how to continue.
I think the issue is with android-ndk version. We need to use ndk version specified by react-native documentation. I tried with the latest version of andrid-ndk. I was not able to build the project, got similar error while running react-native run-android.
Then I tried with android-ndk-r10e version. It worked fine, I was able to build the project successfully.
Also you may find this react-native github issue discussion useful.
I'm trying to compile React Native UIExplorer for Android.And I have same issue.
Then I run ndk-build ,I get:
Android NDK: Could not find application project directory !
Android NDK: Please define the NDK_PROJECT_PATH variable to point to it.
/usr/local/Cellar/android-ndk/r13b/build/core/build-local.mk:151: *** Android NDK: Aborting . Stop.
My android-ndk version is /android-ndk/r13b/,So I download android-ndk-r10e .
I use the most direct way:
$ cd /usr/local/Cellar/android-ndk/r13b
$ rm -rf ./*
$ mv YourUnZipPath/android-ndk-r10e/* ./
Then It worked fine, I was able to build the project successfully.

Android NDK - Building Limbo Android returns fatal error: config.h: No such file or directory

I'm trying to rebuild Limbo Android. I'm on Linux Mint.
All I changed was android-config.mak NDK_ROOT, exported variables NDK_ROOT. I've also exported NDK_MODULE_PATH to /home/pathtoandroidndk/sources, as per README instructions.
From terminal I do cd limbo-android/jni and then make.
Building returns this error:
jni/glib/glib/./libcharset/localcharset.c:22:20: fatal error: config.h: No such file or directory
compilation terminated.
make: *** [obj/local/armeabi-v7a/objs-debug/glib-2.0/./libcharset/localcharset.o] Error 1
make: Leaving directory `/home/me/limbo-android'
I've tried modifing Android.mk following instructions from Android NDK - Additional Include Directories and Unable to find header files - Android NDK, without success.
I came to conclusion that each module inside limbo-android needs it's own config.h file, while libcharset does not have one.
How do I solve this error? Is there a generic config.h (the one from NDK maybe?)
NOTE: I can build it without any problems on Windows 8.1 using mingw.

cocos2d-x 3.0 rc0 : develop for android in eclipse

I'm on windows xp & Eclipse Kepler. I want to develop with cocos2d-x, but I have some problem.
First, I created project.
cocos new MyGame -p com.myprog.MyGame -l cpp -d MyGame
and I tried run:
cd MyGame
cocos run -s MyGame -p android
and it succeeded.
The problem happens when I open it by eclipse. I create eclipse project, Android Project From Existing Code.
But I can't know what to do next.. even I don't know how to build! (Project - Build doesn't work..)
Moreover, Classes, cocos2dx, extensions and scripting folder are broken..
I tried to find solution, but people are saying about only cocos2d-x 2.x ...
Even if README.md seems to say about 2.x!
Could anyone tell me how do I do?
Installation Process:
Cocos2d require NDK and Cygwin
First install NDK ->
This links may help you :
http://nikhilvithlani.blogspot.in/2013/07/install-android-ndk-for-windows_6.html
Cocos 2d installation link:
http://www.cocos2d-x.org/wiki/How_to_set_up_the_android_cocos2d-x_development_environment_on_Windows_7
Download cocos 2d version and follow the instruction in above link
This packages you required in cygwin: search and install:
autoconf, automake, binutils, gcc-core, gcc-g**, gcc4-core, gcc4-g**, gdb, pcre, pcre-devel, gawk, make
After installation cygwin,ndk and you need to config in C/C++ preference in eclipse(Don't forget to install c/c++ plugin in eclipse)
My NDK and PATH is :
NDK_ROOT->C:/android-ndk-r9c
PATH->C:\android-ndk-r9c;C:\Cygwin\bin;
Then import the sample project :
cocos2d-x-2.2.2\samples\Cpp\HelloCpp\proj.android
Import the library :
cocos2d-x-2.2.2\cocos2dx\platform\android\java
Add the library to hello world project
when you import hello world project eclipse automatically include the header files:
bash F:/cocos2d-x-2.2.2/samples/Cpp/HelloCpp/proj.android/build_native.sh
cygwin warning:
MS-DOS style path detected: F:\cocos2d-x-2.2.2\samples\Cpp\HelloCpp\proj.android
Preferred POSIX equivalent is: /cygdrive/f/cocos2d-x-2.2.2/samples/Cpp/HelloCpp/proj.android
CYGWIN environment variable option "nodosfilewarning" turns off this warning.
Consult the user's guide for more details about POSIX paths:
http://cygwin.com/cygwin-ug-net/using.html#using-pathnames
NDK_ROOT = C:/android-ndk-r9c
COCOS2DX_ROOT = /cygdrive/f/cocos2d-x-2.2.2/samples/Cpp/HelloCpp/proj.android/../../../..
APP_ROOT = /cygdrive/f/cocos2d-x-2.2.2/samples/Cpp/HelloCpp/proj.android/..
APP_ANDROID_ROOT = /cygdrive/f/cocos2d-x-2.2.2/samples/Cpp/HelloCpp/proj.android
Using prebuilt externals
+ C:/android-ndk-r9c/ndk-build -C /cygdrive/f/cocos2d-x-2.2.2/samples/Cpp/HelloCpp/proj.android NDK_MODULE_PATH=/cygdrive/f/cocos2d-x-2.2.2/samples/Cpp/HelloCpp/proj.android/../../../..:/cygdrive/f/cocos2d-x-2.2.2/samples/Cpp/HelloCpp/proj.android/../../../../cocos2dx/platform/third_party/android/prebuilt
make: Entering directory '/cygdrive/f/cocos2d-x-2.2.2/samples/Cpp/HelloCpp/proj.android'
Android NDK: WARNING: APP_PLATFORM android-9 is larger than android:minSdkVersion 8 in ./AndroidManifest.xml
Android NDK: WARNING:/cygdrive/f/cocos2d-x-2.2.2/samples/Cpp/HelloCpp/proj.android/../../../../cocos2dx/Android.mk:cocos2dx_static: LOCAL_LDLIBS is always ignored for static libraries
[armeabi] Install : libhellocpp.so => libs/armeabi/libhellocpp.so
make: Leaving directory '/cygdrive/f/cocos2d-x-2.2.2/samples/Cpp/HelloCpp/proj.android'
After get output in console right click project and goto properties and choose paths and symbols under c/c++ general
Run the project and you can see the output :
Useful links:
http://www.youtube.com/watch?v=2itbQceTQGI
You can handle it in different way though you are on windows you have to use Microsoft Visual Studio Express 2012 for Windows Desktop its free and also it will give you good IntelliSense support.
Every time you edit using MS VS2012 run proj.android/build_native.py and then you can run your app from eclipse as usual.

cocos2d-x android develoement - ./build_native.sh giving error in windows 7

I am not able to get rid of this error when I start compiling helloCpp with ndk. I am given proper permission to all users. Please can any one give clue? I included NDK_ROOT also in system variables.
dell#dell-PC /cygdrive/C/cocos2d-x/samples/Cpp/HelloCpp/proj.android
$ ./build_native.sh
NDK_ROOT = /cygdrive/C/android-ndk-r8e
COCOS2DX_ROOT = /cygdrive/C/cocos2d-x/samples/Cpp/HelloCpp/proj.android/../../../..
APP_ROOT = /cygdrive/C/cocos2d-x/samples/Cpp/HelloCpp/proj.android/..
APP_ANDROID_ROOT = /cygdrive/C/cocos2d-x/samples/Cpp/HelloCpp/proj.android Using prebuilt externals
++ /cygdrive/C/android-ndk-r8e/ndk-build -C /cygdrive/C/cocos2d-x/samples/Cpp/HelloCpp/proj.android NDK_MODULE_PATH=/cygdrive/C/cocos2d-x/samples/Cpp/HelloCpp/proj.android/../../../..:/cygdrive/C/cocos2d-x/samples/Cpp/HelloCpp/proj.android/../../../../cocos2dx/platform/third_party/android/prebuilt
make.exe: *** /cygdrive/C/cocos2d-x/samples/Cpp/HelloCpp/proj.android: No such file or directory. Stop.
Follow this tutorial here.
Include these in path and symbols <- C/C++ General<- Properties <- Right Click on Project
Browse and set where you have your NDK Installed.
/Library/Android/android-ndk-r8/sources/cxx-stl/gnu-libstdc++/include
/Library/Android/android-ndk-r8/platforms/android-8/arch-arm/usr/include
/Library/Android/android-ndk-r8/sources/cxx-stl/system/include
/Library/Android/android-ndk-r8/sources/cxx-stl/gabi++/include
Under Build->Toolchain Select Android Gcc -> make then reset the
variable under C/C++ build -> build command
reset it to
bash ${workspace_loc:/YOURPROJECTNAME}/build_native.sh NDK_DEBUG=1 V=1
Don't forget to change the project name in the build command.

How to build libav using ndk-build in cygwin for windowds?

I want to know how to build libav on windows7 using cygwin. I've tried the following steps :
1-change the directory using cd command to libav_file_directory/android(android folder is empty where the .so file will be saved as far as my knowledge is concern).
2-execute the ./ndk-buil command.
I got the following as result:
*Android NDK: Could not find application project directory !
Android NDK: Please define the NDK_PROJECT_PATH variable to point to it.
/cygdrive/c/Users/balwant.singh.TA/Desktop/Android/android-ndk-r8/build/core/build-local.mk:130: * Android NDK: Aborting . Stop.*
plese reply with solution, and also I want to know which all android media player uses the libav as their native code.
1.)Set all your paths(Java_Home
2.)Set NDK_HOME to Ndk-Build Path
3.)Run Cygwin
4.)GO to project Library path
5.)Run make command
6.)then Run ndk-build

Categories

Resources