I'm trying to set up cocos 2dx on my mac. When I type in python setup.py it prompts for NDK_ROOT and there is no issue (the root is "/Applications/android-ndk-r20/"). But when I put in the SDK_ROOT ("/Applications/") I get the following error:
Error: "/Applications/" is not a valid path of ANDROID_SDK_ROOT. Ignoring it.
I tried moving SDK into its own directory (so the path is /Applications/SDK) but that didn't work either.
Any ideas?
Related
I get this error. (I know this might not be React native specific and i also tried other solutions i still don't come right.)
ERROR: JAVA_HOME is set to an invalid directory: ”/Library/Java/JavaVirtualMachines/jdk1.8.0_144.jdk/Contents/Home”
I just installed jdk 8, This is how i did the export.
export JAVA_HOME=”$(/usr/libexec/java_home -v 1.8)”
And added to ~/.profile
vi ~/.profile, //then added : export JAVA_HOME=”$(/usr/libexec/java_home -v 1.8)”
Below is the error i get whe i run react-native run-android
What do you get when you execute which java from your command line?
On my machine I get /Library/Java/JavaVirtualMachines/jdk1.8.0_141.jdk/Contents/Home/bin/java
and it is because I have exported my JAVA HOME as follows:
export JAVA_HOME=/Library/Java/JavaVirtualMachines/jdk1.8.0_141.jdk/Contents/Home
and then I have :
export PATH=$JAVA_HOME/bin:${PATH} to make sure that this JAVA_HOME is set before the system's.
I just started Android development with ionic framework on Linux (Ubuntu).
I successfully created my ionic project using the command:
sudo ionic start demo blank
Now to add the android platform to the project, I ran the command:
sudo ionic platform add android
And this is the result it gave me:
function bold() { [native code] } https://github.com/driftyco/ionic-default-resources/archive/master.zip
[=============================] 100% 0.0s
Adding android project...
Creating Cordova project for the Android platform:
Path: platforms/android
Package: com.ionicframework.demo504884
Name: demo
Activity: MainActivity
Android target: android-24
Subproject Path: CordovaLib
Android project created with cordova-android#6.0.0
ls: no such file or directory: /home/awa/Desktop/mobile/demo/res/mipmap-*
Installing "cordova-plugin-console" for android
Failed to install 'cordova-plugin-console':CordovaError: Failed to find 'ANDROID_HOME' environment variable. Try setting setting it manually.
Failed to find 'android' command in your 'PATH'. Try update your 'PATH' to include path to valid SDK directory.
at /home/awa/Desktop/mobile/demo/platforms/android/cordova/lib/check_reqs.js:222:19
at _fulfilled (/home/awa/Desktop/mobile/demo/platforms/android/cordova/node_modules/q/q.js:834:54)
at self.promiseDispatch.done (/home/awa/Desktop/mobile/demo/platforms/android/cordova/node_modules/q/q.js:863:30)
at Promise.promise.promiseDispatch (/home/awa/Desktop/mobile/demo/platforms/android/cordova/node_modules/q/q.js:796:13)
at /home/awa/Desktop/mobile/demo/platforms/android/cordova/node_modules/q/q.js:857:14
at runSingle (/home/awa/Desktop/mobile/demo/platforms/android/cordova/node_modules/q/q.js:137:13)
at flush (/home/awa/Desktop/mobile/demo/platforms/android/cordova/node_modules/q/q.js:125:13)
at _combinedTickCallback (internal/process/next_tick.js:67:7)
at process._tickCallback (internal/process/next_tick.js:98:9)
Error: Failed to find 'ANDROID_HOME' environment variable. Try setting setting it manually.
Failed to find 'android' command in your 'PATH'. Try update your 'PATH' to include path to valid SDK directory.
At first I doubted if it had successfully added the android platform so I ran the same command again (sudo platform add android) and it said platform already existed.
Now seeing the last section of the error, I set the ANDROID_HOME environment variable by putting this code at the end of my .bashrc file located my home directory.
export ANDROID_HOME=/home/awa/Android/Sdk
export PATH=$PATH:/home/awa/Android/Sdk/tools
export PATH=$PATH:/home/awa/Android/Sdk/platform-tools
I saved the file. In order to build my project, I ran the command:
sudo ionic build android
and it gave the error:
add to body class: platform-android
Error: Failed to find 'ANDROID_HOME' environment variable. Try setting setting it manually.
Failed to find 'android' command in your 'PATH'. Try update your 'PATH' to include path to valid SDK directory.
I verified again to make sure I had succeeded in setting the ANDROID_HOME environment variable correctly. So in the Command line I ran the command echo $ANDROID_HOME and it gave as output:
/home/awa/Android/Sdk
...which is the right directory for my SDK.
I have tried other solutions like setting the environment variables in the .profile file but nothing changed.
Now I am suspecting the problem may have something to do with my sdk version though I'm not entirely sure.
What am I doing wrong, or what I'm I missing?
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
Basically i am working in Ubuntu.I created my application and set the platform android but i am getting
** ERROR**
Command failed with exit code 2 Error output: { [CordovaError: Failed
to find 'ANDROID_HOME' environment variable. Try setting setting it
manually. Failed to find 'android' command in your 'PATH'. Try update
your 'PATH' to include path to valid SDK directory.] name:
'CordovaError', message: 'Failed to find \'ANDROID_HOME\' environment
variable. Try setting setting it manually.\nFailed to find \'android\'
command in your \'PATH\'. Try update your \'PATH\' to include path to
valid SDK directory.', code: 0, context: undefined
As error suggests path is not defined properly for ANDROID_HOME.
In the console(use your current location)
export ANDROID_HOME=/home/abc/Android/Sdk
export PATH=$PATH:/home/abc/Android/Sdk/tools
If want it to make it permanent add those lines in the ~/.bashrc file using nano or any editor.
I'm getting error while executing the android-project created on Cocos2d-x, The error is:
$ ./build_native.sh
NDK_ROOT = D:\Updated Eclipse\android-ndk-r10
COCOS2DX_ROOT = /cygdrive/d/Cocos2d-x/cocos2d-x-2.2.5/projects/MyApp/proj.android/../../..
APP_ROOT = /cygdrive/d/Cocos2d-x/cocos2d-x-2.2.5/projects/MyApp/proj.android/..
APP_ANDROID_ROOT = /cygdrive/d/Cocos2d-x/cocos2d-x-2.2.5/projects/MyApp/proj.android
Using prebuilt externals
ERROR: You are using a non-Cygwin compatible Make program.
Currently using: D:/Cocos2d-X/Cygwin/bin/make
To solve the issue, follow these steps:
1. Ensure that the Cygwin 'make' package is installed.
NOTE: You will need GNU Make 3.81 or later!
2. Define the GNUMAKE environment variable to point to it, as in:
export GNUMAKE=/usr/bin/make
3. Call 'ndk-build' again.
I have installed all the required SW and set the path, environment etc properly,
Cocos2d-x version: Cocos2d-x-2.2.5
Android ADT: Latest Android SDK
Android NDK: android-ndk-r10
Cygwin: 32-bit
Cygwin package installed autoconf, automake, binutils, gcc-core, gcc-g**, gcc4-core, gcc4-g**, gdb, pcre, pcre-devel, gawk, make
Python: python-2.7.8.msi
The Path and environment are:
ANDROID_NDK_PATH C:\Users\d\Documents\Android\ndk\android-ndk-r8d
COCOS2DX_ROOT D:\Cocos2d-X\cocos2d-x-2.2.5
GNUMAKE /usr/bin/make
NDK_PROJECT_PATH D:\Cocos2d-X\cocos2d-x-2.2.5\projects
NDK_ROOT D:\Updated Eclipse\android-ndk-r10
Path D:\Cocos2d-X\Cygwin\bin
Please help me to fix this issue.
Thanks
Your NDK is in a folder "Updated Eclipse". You need to rename your folder such that it does not have any space. After renaming, update your NDK path in "build_native.sh" and then try rebuilding.