I am trying to install Ionic in my Linux and trying to check how to run the app. I have successfully installed it and run it on browser.
However, I want to run the app on my Android device.
I have tried to run the command ionic cordova run android --device
but it gives following error:
(node:11992) UnhandledPromiseRejectionWarning: CordovaError: Failed to find 'ANDROID_HOME' environment variable. Try setting it manually. Detected 'adb' command at /usr/bin but no 'platform-tools' directory found near. Try reinstall Android SDK or update your PATH to include valid path to SDK/platform-tools directory. at /home/seven-bits-pc11/myApp/platforms/android/cordova/lib/check_reqs.js:287:27 at _fulfilled (/home/seven-bits-pc11/myApp/platforms/android/cordova/node_modules/q/q.js:854:54) at self.promiseDispatch.done (/home/seven-bits-pc11/myApp/platforms/android/cordova/node_modules/q/q.js:883:30) at Promise.promise.promiseDispatch (/home/seven-bits-pc11/myApp/platforms/android/cordova/node_modules/q/q.js:816:13) at /home/seven-bits-pc11/myApp/platforms/android/cordova/node_modules/q/q.js:877:14 at runSingle (/home/seven-bits-pc11/myApp/platforms/android/cordova/node_modules/q/q.js:137:13) at flush (/home/seven-bits-pc11/myApp/platforms/android/cordova/node_modules/q/q.js:125:13) at process._tickCallback (internal/process/next_tick.js:150:11) at Function.Module.runMain (module.js:705:11) at startup (bootstrap_node.js:193:16) (node:11992) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 1) (node:11992) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
I have also tried this solution, but same error is displayed.
Edit:
I have also tried this other solution.