I try to generate apk or ipa it always get error when i use this command for android
sudo npm run build-dev-cordova
the error appear
Checking Java JDK and Android SDK versions
ANDROID_SDK_ROOT=undefined (recommended setting)
Failed to find ‘ANDROID_SDK_ROOT’ environment variable. Try setting it manually.
Failed to find ‘android’ command in your ‘PATH’. Try update your ‘PATH’ to include path to valid SDK directory.
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] build-dev-cordova:
cross-env TARGET=cordova cross-env NODE_ENV=development node ./build/build.js && cd cordova && cordova build
npm ERR! Exit status 1
although i installed the android-studio and added variables. i added them with multiple ways by termenal and by this command sudo gedit ~/.bashrc but it not change any thing
and when try build ios the error is xcodebuild not found
my os is linux minit 18
please i need help because i am new in using framework7
Its gonna be a silly question but have you sourced confi file after adding the variables bu running
Then verify that the shell has the environment variables by running
env. If you see
ANDROID_SDK_ROOT listed there then run
sudo npm run build-dev-cordova from the same shell.
thank you for your reply but i think it is not silly questions if you read my question well because i said i did it and the error still appear although variables added to env and
~/.bashrc if you have any suggestion i will be happy if it will solve my problem
What I’ve meant is that my question might sound silly, not yours. Because I’ve asked a basic question about if you’ve sourced the config file after you added the variables. By running:
. ~/.bashrc (aka
This is so that changes in the file can be read by the shell. Of course the same can be achieved by closing the shell used to run cordova commands and opening it again. If you still having the issue I guess that the issue was not as simple as that. A good start would be running
env to see if the variables you’ve set are even set on the shell. Based on the error its they are most likely not. I would start by making sure I can set any variables in a correct way to begin with as its not F7 or Cordova’s issue. As for building ios on linux, i’m not sure its possible. At least not in a simple/normal way. You need a macOS for that.
ok thank you i already run this command
source ~/.bashrc and env and i found the variables i try to find another way to generate apk and ipa