Problem released apk


#1

Hello everyone…

i have a problem, i try to follow this publishing instructions, but the problem is when i type “cordova build --release android” on my terminal, i just got error message like this:

/home/tricko/cordova_projects/myApp/hooks/after_prepare/010_add_platform_class.js /home/tricko/cordova_projects/myApp
add to body class: platform-android
Running command: /home/tricko/cordova_projects/myApp/platforms/android/cordova/build --release
[Error: ANDROID_HOME is not set and “android” command not in your PATH. You must fulfill at least one of these conditions.]
Error: /home/tricko/cordova_projects/myApp/platforms/android/cordova/build: Command failed with exit code 2
at ChildProcess.whenDone (/usr/local/lib/node_modules/cordova/node_modules/cordova-lib/src/cordova/superspawn.js:135:23)
at ChildProcess.EventEmitter.emit (events.js:98:17)
at maybeClose (child_process.js:743:16)
at Process.ChildProcess._handle.onexit (child_process.js:810:5)
tricko@tricko-ramstein:~/cordova_projects/myApp$ cordova build --release
Running command: /home/tricko/cordova_projects/myApp/hooks/after_prepare/010_add_platform_class.js /home/tricko/cordova_projects/myApp
add to body class: platform-android
Running command: /home/tricko/cordova_projects/myApp/platforms/android/cordova/build --release
[Error: ANDROID_HOME is not set and “android” command not in your PATH. You must fulfill at least one of these conditions.]
Error: /home/tricko/cordova_projects/myApp/platforms/android/cordova/build: Command failed with exit code 2
at ChildProcess.whenDone (/usr/local/lib/node_modules/cordova/node_modules/cordova-lib/src/cordova/superspawn.js:135:23)
at ChildProcess.EventEmitter.emit (events.js:98:17)
at maybeClose (child_process.js:743:16)
at Process.ChildProcess._handle.onexit (child_process.js:810:5)

how to fix it?
sorry if my english is so bad


#2

Open your terminal and type

export PATH=${PATH}:/path_to_adt/adt-bundle-linux/sdk/platform-tools
export PATH=${PATH}:/path_to_adt/adt-bundle-linux/sdk/tools

PS : path_to_adt is the file system path of your computer where your android sdk tools reside
Now without closing the terminal run cordova build android

The above adds Android sdk to your path. If this works add it to your .profile or bashrc file (Linux).


#3

Thank you, it’s work :smile: