Bonjour,
J’ai le projet de développer une application mobile à l’aide de jQuery Mobile (étant plutôt fana de javascript :). Pour ce faire j’ai choisi comme environnement apache CORDOVA. Certains d’entre vous me diront que d’autres choix s’offraient a moi mais cordova est celui qui répond le plus a mes besoins (je ne suis pas développeur Java), donc j’insiste sur le fait que je ne souhaite pas passer par une autre solution.
J’en appelle à l’aide de la communauté pour le problème suivant:
Étapes de base d’installation d’un projet cordova après installation par npm:
1-
pierre@robota:~/web-dev/sessions-web$ cordova create project-App
Creating a new cordova project.
2-
pierre@robota:~/web-dev/sessions-web/project-App$ sudo cordova platform add android
Using cordova-fetch for cordova-android@~6.2.2
Adding android project…
Creating Cordova project for the Android platform:
Path: platforms/android
Package: io.cordova.hellocordova
Name: HelloCordova
Activity: MainActivity
Android target: android-25
Subproject Path: CordovaLib
Android project created with cordova-android@6.2.3
Discovered plugin “cordova-plugin-whitelist” in config.xml. Adding it to the project
Installing “cordova-plugin-whitelist” for android
This plugin is only applicable for versions of cordova-android greater than 4.0. If you have a previous platform version, you do *not* need this plugin since the whitelist will be built in.
Adding cordova-plugin-whitelist to package.json
Saved plugin info for “cordova-plugin-whitelist” to config.xml
–save flag or autosave detected
Saving android@~6.2.3 into config.xml file …
Jusqu’ici tout va bien. Mais au moment de construire le projet sur la plateforme android:
Une erreur survient:
3-
pierre@robota:~/web-dev/sessions-web/project-App$ sudo cordova build
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
Elle se produit aussi quand je tente de run directement la plateforme android:
4-
pierre@robota:~/web-dev/sessions-web/project-App$ sudo cordova run 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.
$ android update sdk fonctionne avec succès:
pierre@robota:~/web-dev/sessions-web/project-App$ android update sdk
The “android” command is deprecated.
For manual SDK, AVD, and project management, please use Android Studio.
For command-line tools, use tools/bin/sdkmanager and tools/bin/avdmanager
“android” SDK commands can be translated to sdkmanager commands on a best-effort basis.
Continue? (This prompt can be suppressed with the --use-sdk-wrapper command-line argument
or by setting the USE_SDK_WRAPPER environment variable) [y/N]: y
Running /home/pierre/Android/Sdk/tools/bin/sdkmanager --update
done
Mes variables d’environnement:
5-
pierre@robota:~/web-dev/sessions-web/project-App$ echo $PATH
/usr/local/bin:/usr/bin:/bin:/usr/bin/X11:/usr/games:/home/pierre/bin:/usr/java/jdk1.8.0_144/bin:/home/pierre/ant/apache-ant-1.10.1/bin:/home/pierre/Android/Sdk/platform-tools:/home/pierre/Android/Sdk/tools
pierre@robota:~/web-dev/sessions-web/project-App$ echo $JAVA_HOME
/usr/java/jdk1.8.0_144
pierre@robota:~/web-dev/sessions-web/project-App$ echo $ANDROID_HOME
/home/pierre/Android/Sdk/tools
Les commandes android et javac sont accessibles et installées car le $PATH est correct et pour l’installation du SDK android je suis passé par Android Studio, installé avec succès ainsi que divers composants.
J’ai essayé de modifier sans succès le PATH un nombre incalculable de fois depuis hier, je ne comprends pas où est l’erreur.
Si, et je n’en doute pas des connaisseurs de cordova sous debian se trouvent parmi vous, quelle solution pouvez-vous m’apporter ?
Par avance merci d’avoir pris la peine de me lire.
Mon système:
pierre@robota:~/web-dev/sessions-web/project-App$ uname -a
Linux robota 4.9.0-3-amd64 #1 SMP Debian 4.9.30-2+deb9u2 (2017-06-26) x86_64 GNU/Linux
pierre@robota:~/web-dev/sessions-web/project-App$ cat /etc/os-release
PRETTY_NAME="Debian GNU/Linux 9 (stretch)"
NAME="Debian GNU/Linux"
VERSION_ID="9"
VERSION="9 (stretch)"
ID=debian
HOME_URL="https://www.debian.org/"
SUPPORT_URL="https://www.debian.org/support"
BUG_REPORT_URL=“https://bugs.debian.org/”
Merci à tous,
Cordialement,
Please, ne me dites pas que je suis en fait un code 40 qui a mal lu la doc… ^^