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
Related
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.
How to solve artoolkit nftBook issues in android studio
When I run the command ndk-build in android studio terminal for nft book it shows the error like:
clang++.exe: error: linker command failed with exit code 1 (use -v to
see invocation) make: *** [obj/local/armeabi/libnftBookNative.so]
Error 1
How can I solve this?
You should not run it in the android studio terminal but in the Git-Bash.
Read the documentation more closely :).
You look like you are working from Windows so you need to use Git-Bash for compilation.
See: http://artoolkit.org/community/forums/viewtopic.php?f=26&t=17092
===========
EDIT:
Make sure you have these environment variables set:
- Set ANDROID_HOME to indicate the path to root folder of the downloaded Android SDK.
Set ANDROID_NDK_ROOT to indicate the path to root folder (most likely, “ndk-bundle”) of the downloaded NDK. The ANDROID_HOME environment variable can be used to help define NDK.
ANDROID_NDK_ROOT=$ANDROID_HOME/ndk-bundle
Set NDK to the same path as ANDROID_NDK_ROOT. NDK=$ANDROID_NDK_ROOT
Set PATH to include a path to the ndk-build[.cmd] script file, that is, the path to the root folder of the NDK. The NDK environment variable can be used to help define the added path.
Now start gitBash and navigate to your ARToolKit5_ROOT directory.
cd android
./build.sh
if successful
./build_native_examples.sh
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
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.
I would like to be able to build a shared library in using the android ndk-build script, but for some reason I get a bunch of errors:
# I have Application.mk and Android.mk in the current folder
ndk-build -C .
Android NDK: Could not find application project directory !
Android NDK: Please define the NDK_PROJECT_PATH variable to point to it.
Is there a way to build the Android shared library with only the source and header files?$$\int$$
Yes, you can write
ndk-build NDK_PROJECT_PATH=. APP_BUILD_SCRIPT=./Android.mk
But it's much easier to create ./jni directory and put both Application.mk and Android.mk there.