Уголок новичка
   5114

Нет гайда установки для NativeScript на Manjaro и даже на Arch Linux

Друзья, у меня проблема, есть инструкция по установке NativeScript в Ubuntu. Использовать, которую обычным подходом смены sudo apt-get install на sudo pacman -S, не получится. Все это невозможно из-за ризницы в названиях некоторых команд, а так же пакетов, может даже что-то устанавливать и не нужно.

А сам я не знаю как точно можно эту инструкцию переконвертировать под Manjaro? Поэтому прошу того кто сможет это сделать, для того чтобы я потом не наделал ошибок.

18 комментариев

avatar
да, готового решения видимо пока нет, видимо при инсталяции все-таки придется поэкспериментировать.
Как вариант, можно попробовать по порядку ставить то что написано в инструкции по пунктам с использованием пакетов, имеющихся в репах и ауре или писать для некоторых PKGBUILD`ы.
итак:
1. Node.js ставим так
sudo pacman -S nodejs

2. Пакеты lib32z1 lib32ncurses5 lib32bz2-1.0 libstdc++6:i386 скорее всего надо будет пересобирать с помощью PKGBUILD`a или с помощью утилитки debtap. хотя некоторые пакеты вроде бы просто называются немного иначе, например, осмелюсь предположить, что
lib32ncurses5 — это lib32-ncurses5-compat-libs, или по крайней мере содержит в себе необходимые библиотеки…
3. С g++ не уверен, но по-моему пакет base-devel содержит все необходимое(если кто разбирается, поправьте меня).
4. wiki.archlinux.org/index.php/java
5. yaourt android-studio
6. вроде нужно выполнить команду после установки android-studio
7. yaourt genymotion
8.
sudo npm install nativescript -g --unsafe-perm

9. tns doctor

я могу в некоторых моментах ошибаться, но без метода проб и ошибок не выйдет, но по крайней мере вы можете попытаться и поделиться результатами.
При возникновении проблем пишите, возможно коллктивно получится создать мануал для Manjaro))
Удачи!
Последний раз редактировалось
?
Отправка специалистом технической поддержки ссылки на руководство по эксплуатации и другую документацию, не является отказом в предоставлении поддержки.
bash.org
+2
avatar
Хорошо), на всякий случай сделал backup системы.
1. Nodejs стоит 7x версия
2. Пакеты пока не устанавливал. Есть предположения, что они нужны для g++, поэтому пока не стал ставить.
3. g++ стоит.
4. По Java 8 даже пока не совсем понятно, какой пакет здесь нужно устанавливать, java-runtime-common или если искать в yaourt по jdk8, есть один пакет от Oracle denix-jdk8, или ещё что-то другое? Ведь как я понял нужна среда именно от Oracle для запуска приложений написанных на java. В Убунту за отвечал пакет oracle-java8-installer.

Дальше пока не иду, нужно сначала здесь разобраться.
0
avatar
Разрабатываю на NS два года, ставится все в манджаро легче чем в убунте.
1. ставите nodejs последней версии
2. extra/jdk8-openjdk и extra/jre8-openjdk
3. aur/android-sdk и aur/android-sdk-build-tools и aur/android-sdk-platform-tools
4. прописываем переменные среды в .bashrc (пути проверьте свои):
export ANDROID_HOME=/opt/android-sdk
export JAVA_HOME=/usr/lib/jvm/java-8-openjdk

5. перелогиниваемся и sudo npm install nativescript -g
ну и vs code, куда без него :)
Последний раз редактировалось
+3
avatar
Установить удалось, уже даже обрадовался, но не тут было, есть серьёзные проблемы при работе с NativeScript. В общем жду от Вас советов, я решил записать все свои действия по установке, возможно я где-то ошибся. И это и вызвало ошибку, о которая я написал ближе к концу.

1. node — уже установлен.

2.
sudo pacman -S jdk8-openjdk jre8-openjdk


3.
yaourt -S android-sdk android-sdk-build-tools android-sdk-platform-tools


4. Открыл файл .bashrc для редактирования находящейся по адресу "~/" и добавил туда в клнец эти строки.
export ANDROID_HOME=/opt/android-sdk
# в "/opt/" - есть такая папка "android-sdk"
export JAVA_HOME=/usr/lib/jvm/java-8-openjdk
# в "/usr/lib/jvm/" - есть такая папка "java-8-openjdk"


5. Перезагрузил систему, и установил NativeScript.
sudo npm install nativescript -g


6. Установил Genymotion
yaourt genymotion

С начало yaourt мне предложил выбрать из списка один из пакетов я выбрал linux44-virtualbox-host-modules. Далее yaourt предложил мне продолжить установку genymotion.

7. После этого проел проверку tns doctor, он вроде ошибок не выявил.

Единственное меня немного напрягло вот это сообщение: "You need to have Android SDK 22 or later and the latest Android Support Repository installed on your system.". Но я его счел предупреждением, так там не было написано, что это ошибка.

Здесь пошили ошибки, но мне удалось их исправить

8. Попытался запустить genymotion. Он начал ругаться, что Virtualbox не установлен, перезагрузил систему. После чего он запустился.

9. Я залогинился, выбрал устройство и дал ему название «em», для того чтобы в консоли было потом легче набирать. После чего, для проверки запустил его и новая ошибка о том что виртуализация, отключена в биосе. Хотя я в биосе не чего не отключал. А на другой ос было все нормально.

Решил её путём настройки этого вертельного устройства, уменьшил потребление оперативной помети до 1000. Посмотрел чтобы использовалось только одно ядро процессора. Так как у меня всего только 2 ядра.

10. Все устройство Genymotion запостилось.

Здесь появилась ошибка, которую мне пока не удалось исправить

11. Теперь начал установить стартовое приложение на Genymotion. Для этого я создал основное приложение NativeScript.
tns create MyApp


Перешёл в папку MyApp и добавил платформу android.
tns platform add android


Попробовал установить на виртуальное устройства Genymotion.
tns run android --geny em

Установка прошла и под конец выдала ошибку, а на этот эмулятор не чего не установилось. После чего решил проверить установку другими способами.

Пробовал установить на телефон.
tns run android


Пробовал установить на обычный эмулятор.
tns run android --emulator


Везде поведение такое же. Вот главная строка из ошибки "Exception: The plugin tns-android@2.5.0 is already installed".

Теперь, те способы, которыми мне её исправить не удалось:

1) Обновить пакеты по требования Android sdk

Обновление

2) Установить платформы. У меня эмулятор и телефон имеет на борту Android 4.4.4.

платформы
3) Перезагрузку ОС.

4) Удалить папку MyApp. И проделать все операции создания приложения, заново.
Последний раз редактировалось
0
avatar
Очень странно, у меня приложение запускается и работает на телефоне нормально. Genymotion не использую, у меня стоит эмулятор от Android Studio. Пока не знаю в чем может быть ошибка, надо подумать. Возможно, уже вышла версия NS 2.5.1 и поэтому такое поведение…
Попробуйте выполнить команду tns update в каталоге проекта и там посмотреть все ли хорошо, а потом выложить полный лог ошибок при запуске, будем искать ошибку.
0
avatar
Да версия обновилось 2.5.1 (2017, February 17)
Вот логи из консоли (нужно кликнуть для раскрытия):
1)
tns update
sh-4.4$ tns update
Succsessfully removed plugin tns-core-modules
Succsessfully removed plugin tns-core-modules-widgets

> nativescript-dev-android-snapshot@0.0.6 postinstall /srv/http/portfolio/NativeScript/MyApp/node_modules/nativescript-dev-android-snapshot
> node postinstall.js

/srv/http/portfolio/NativeScript/MyApp
├─┬ nativescript-dev-android-snapshot@0.0.6 
│ ├── adm-zip@0.4.7 
│ ├─┬ nativescript-hook@0.2.1 
│ │ ├─┬ glob@6.0.4 
│ │ │ ├─┬ inflight@1.0.6 
│ │ │ │ └── wrappy@1.0.2 
│ │ │ ├── inherits@2.0.3 
│ │ │ ├─┬ minimatch@3.0.3 
│ │ │ │ └─┬ brace-expansion@1.1.6 
│ │ │ │   ├── balanced-match@0.4.2 
│ │ │ │   └── concat-map@0.0.1 
│ │ │ ├── once@1.4.0 
│ │ │ └── path-is-absolute@1.0.1 
│ │ └─┬ mkdirp@0.5.1 
│ │   └── minimist@0.0.8 
│ ├── semver@5.3.0 
│ └── shelljs@0.6.1 
├── nativescript-theme-core@1.0.2 
└── tns-android@2.5.0 


/srv/http/portfolio/NativeScript/MyApp                     
└─┬ tns-core-modules@2.5.1 
  └── tns-core-modules-widgets@2.5.0 


Successfully installed plugin tns-core-modules.

2)
tns run android --geny em
sh-4.4$ tns run android --geny em
Copying template files...
  ◞ Installing tns-androidInstalling  tns-android
  ◝ Installing tns-android[..................] / normalizeT  ◞ Installing tns-android[..................] / normalizeT  ◡ Installing tns-android[..................] / normalizeT  ◟ Installing tns-android[..................] \ normalizeT  ◜ Installing tns-android[    ..............] \ loadReques  ◠ Installing tns-android[    ..............] \ loadReques  ◝ Installing tns-android[    ..............] \ loadReques  ◞ Installing tns-android[    ..............] \ loadReques  ◡ Installing tns-android[    ..............] \ loadReques  ◟ Installing tns-android[    ..............] \ loadReques  ◜ Installing tns-android[    ..............] \ loadReques  ◠ Installing tns-android[    ..............] \ loadReques  ◝ Installing tns-android[    ..............] \ loadReques  ◞ Installing tns-android[    ..............] \ loadReques  ◡ Installing tns-android[          ........] / diffTrees:  ◟ Installing tns-android[             .....] - extract:tn  ◜ Installing tns-android[             .....] | extract:tn  ◠ Installing tns-android[             .....] / extract:tn  ◝ Installing tns-android[             .....] / extract:tn  ◞ Installing tns-android[             .....] / extract:tn  ◡ Installing tns-android[             .....] / extract:tn  ◟ Installing tns-android[             .....] / extract:tn  ◜ Installing tns-android[             .....] / extract:tn  ◠ Installing tns-android[             .....] - extract:tn  ◝ Installing tns-android[             .....] - extract:tn  ◞ Installing tns-android[             .....] - extract:tn  ◡ Installing tns-android[             .....] - extract:tn  ◟ Installing tns-android[             .....] | extract:tn  ◜ Installing tns-android[             .....] | extract:tn  ◠ Installing tns-android[             .....] | extract:tn  ◝ Installing tns-android[             .....] | extract:tn  ◞ Installing tns-android[             .....] | extract:tn  ◡ Installing tns-android[             .....] | extract:tn  ◟ Installing tns-android[             .....] | extract:tn  ◜ Installing tns-android[             .....] | extract:tn  ◠ Installing tns-android[             .....] | extract:tn  ◝ Installing tns-android[             .....] | extract:tn  ◞ Installing tns-android[             .....] | extract:tn  ◡ Installing tns-android[               ...] \ postinstal/srv/http/portfolio/NativeScript/MyApp
└── tns-android@2.5.0 


Exception: The plugin tns-android@2.5.0 is already installed
# run android

┌───────────────┬───────────────────────────────────────┐
│ Usage         │ Synopsis                              │
│ Run on all    │ $ tns run android [--key-store-path   │
│ connected     │ <File Path> --key-store-password      │
│ devices and   │ <Password> --key-store-alias <Name> - │
│ running       │ -key-store-alias-password <Password>] │
│ emulators     │ [--release] [--justlaunch]            │
│ Run on a      │ $ tns run android --device <Device ID │
│ selected      │ > [--key-store-path <File Path> --key │
│ connected     │ -store-password <Password> --key      │
│ device or     │ -store-alias <Name> --key-store-alias │
│ running       │ -password <Password>] [--release] [-  │
│ emulator      │ -justlaunch]                          │
│ Start an      │ $ tns run android --emulator [        │
│ emulator and  │ <Emulator Options>] [--key-store-path │
│ run the app   │ <File Path> --key-store-password      │
│ inside it     │ <Password> --key-store-alias <Name> - │
│               │ -key-store-alias-password <Password>] │
│               │ [--release] [--justlaunch]            │
└───────────────┴───────────────────────────────────────┘

Runs your project on a connected Android device or in a native Android emulator, if configured. This is shorthand for prepare, build and deploy. While your app is running, prints the output from the application in the console and watches for changes in your code. Once a change is detected, it synchronizes the change with all selected devices and restarts/refreshes the application.

### Options

    * --no-watch - If set, changes in your code will not be reflected during the execution of this command.
    * --device - Specifies a connected device/emulator on which to run the app.
    * --emulator - If set, runs the app in a native emulator for the target platform, if configured. When set, you can also set any other valid combination of emulator options as listed by $ tns help emulate android.
    * --release - If set, produces a release build. Otherwise, produces a debug build. When set, you must also specify the --key-store-* options.
    * --key-store-path - Specifies the file path to the keystore file (P12) which you want to use to code sign your APK. You can use the --key-store-* options along with --release to produce a signed release build. You need to specify all --key-store-* options.
    * --key-store-password - Provides the password for the keystore file specified with --key-store-path. You can use the --key-store-* options along with --release to produce a signed release build. You need to specify all --key-store-* options.
    * --key-store-alias - Provides the alias for the keystore file specified with --key-store-path. You can use the --key-store-* options along with --release to produce a signed release build. You need to specify all --key-store-* options.
    * --key-store-alias-password - Provides the password for the alias specified with --key-store-alias-password. You can use the --key-store-* options along with --release to produce a signed release build. You need to specify all --key-store-* options.
    * --justlaunch - If set, does not print the application output in the console.
    * --clean - If set, forces rebuilding the native application.

### Attributes

    * <Device ID> is the index or name of the target device as listed by $ tns device android
    * <Emulator Options> is any valid combination of options as listed by $ tns help emulate android

Sending exception report (press Ctrl+C to stop).....
Последний раз редактировалось
0
avatar
А вот тоже самое, но со стандартным эмулятором:
1)
tns update
<code>sh-4.4$ tns update
Succsessfully removed plugin tns-core-modules
Succsessfully removed plugin tns-core-modules-widgets

> nativescript-dev-android-snapshot@0.0.6 postinstall /srv/http/portfolio/NativeScript/MyApp/node_modules/nativescript-dev-android-snapshot
> node postinstall.js

/srv/http/portfolio/NativeScript/MyApp
├─┬ nativescript-dev-android-snapshot@0.0.6 
│ ├── adm-zip@0.4.7 
│ ├─┬ nativescript-hook@0.2.1 
│ │ ├─┬ glob@6.0.4 
│ │ │ ├─┬ inflight@1.0.6 
│ │ │ │ └── wrappy@1.0.2 
│ │ │ ├── inherits@2.0.3 
│ │ │ ├─┬ minimatch@3.0.3 
│ │ │ │ └─┬ brace-expansion@1.1.6 
│ │ │ │   ├── balanced-match@0.4.2 
│ │ │ │   └── concat-map@0.0.1 
│ │ │ ├── once@1.4.0 
│ │ │ └── path-is-absolute@1.0.1 
│ │ └─┬ mkdirp@0.5.1 
│ │   └── minimist@0.0.8 
│ ├── semver@5.3.0 
│ └── shelljs@0.6.1 
├── nativescript-theme-core@1.0.2 
└── tns-android@2.5.0 


/srv/http/portfolio/NativeScript/MyApp                     
└─┬ tns-core-modules@2.5.1 
  └── tns-core-modules-widgets@2.5.0 


Successfully installed plugin tns-core-modules.
sh-4.4$ tns run android --geny em
Copying template files...
  ◞ Installing tns-androidInstalling  tns-android
  ◝ Installing tns-android[..................] / normalizeT  ◞ Installing tns-android[..................] / normalizeT  ◡ Installing tns-android[..................] / normalizeT  ◟ Installing tns-android[..................] \ normalizeT  ◜ Installing tns-android[    ..............] \ loadReques  ◠ Installing tns-android[    ..............] \ loadReques  ◝ Installing tns-android[    ..............] \ loadReques  ◞ Installing tns-android[    ..............] \ loadReques  ◡ Installing tns-android[    ..............] \ loadReques  ◟ Installing tns-android[    ..............] \ loadReques  ◜ Installing tns-android[    ..............] \ loadReques  ◠ Installing tns-android[    ..............] \ loadReques  ◝ Installing tns-android[    ..............] \ loadReques  ◞ Installing tns-android[    ..............] \ loadReques  ◡ Installing tns-android[          ........] / diffTrees:  ◟ Installing tns-android[             .....] - extract:tn  ◜ Installing tns-android[             .....] | extract:tn  ◠ Installing tns-android[             .....] / extract:tn  ◝ Installing tns-android[             .....] / extract:tn  ◞ Installing tns-android[             .....] / extract:tn  ◡ Installing tns-android[             .....] / extract:tn  ◟ Installing tns-android[             .....] / extract:tn  ◜ Installing tns-android[             .....] / extract:tn  ◠ Installing tns-android[             .....] - extract:tn  ◝ Installing tns-android[             .....] - extract:tn  ◞ Installing tns-android[             .....] - extract:tn  ◡ Installing tns-android[             .....] - extract:tn  ◟ Installing tns-android[             .....] | extract:tn  ◜ Installing tns-android[             .....] | extract:tn  ◠ Installing tns-android[             .....] | extract:tn  ◝ Installing tns-android[             .....] | extract:tn  ◞ Installing tns-android[             .....] | extract:tn  ◡ Installing tns-android[             .....] | extract:tn  ◟ Installing tns-android[             .....] | extract:tn  ◜ Installing tns-android[             .....] | extract:tn  ◠ Installing tns-android[             .....] | extract:tn  ◝ Installing tns-android[             .....] | extract:tn  ◞ Installing tns-android[             .....] | extract:tn  ◡ Installing tns-android[               ...] \ postinstal/srv/http/portfolio/NativeScript/MyApp
└── tns-android@2.5.0 


Exception: The plugin tns-android@2.5.0 is already installed
# run android

┌───────────────┬───────────────────────────────────────┐
│ Usage         │ Synopsis                              │
│ Run on all    │ $ tns run android [--key-store-path   │
│ connected     │ <File Path> --key-store-password      │
│ devices and   │ <Password> --key-store-alias <Name> - │
│ running       │ -key-store-alias-password <Password>] │
│ emulators     │ [--release] [--justlaunch]            │
│ Run on a      │ $ tns run android --device <Device ID │
│ selected      │ > [--key-store-path <File Path> --key │
│ connected     │ -store-password <Password> --key      │
│ device or     │ -store-alias <Name> --key-store-alias │
│ running       │ -password <Password>] [--release] [-  │
│ emulator      │ -justlaunch]                          │
│ Start an      │ $ tns run android --emulator [        │
│ emulator and  │ <Emulator Options>] [--key-store-path │
│ run the app   │ <File Path> --key-store-password      │
│ inside it     │ <Password> --key-store-alias <Name> - │
│               │ -key-store-alias-password <Password>] │
│               │ [--release] [--justlaunch]            │
└───────────────┴───────────────────────────────────────┘

Runs your project on a connected Android device or in a native Android emulator, if configured. This is shorthand for prepare, build and deploy. While your app is running, prints the output from the application in the console and watches for changes in your code. Once a change is detected, it synchronizes the change with all selected devices and restarts/refreshes the application.

### Options

    * --no-watch - If set, changes in your code will not be reflected during the execution of this command.
    * --device - Specifies a connected device/emulator on which to run the app.
    * --emulator - If set, runs the app in a native emulator for the target platform, if configured. When set, you can also set any other valid combination of emulator options as listed by $ tns help emulate android.
    * --release - If set, produces a release build. Otherwise, produces a debug build. When set, you must also specify the --key-store-* options.
    * --key-store-path - Specifies the file path to the keystore file (P12) which you want to use to code sign your APK. You can use the --key-store-* options along with --release to produce a signed release build. You need to specify all --key-store-* options.
    * --key-store-password - Provides the password for the keystore file specified with --key-store-path. You can use the --key-store-* options along with --release to produce a signed release build. You need to specify all --key-store-* options.
    * --key-store-alias - Provides the alias for the keystore file specified with --key-store-path. You can use the --key-store-* options along with --release to produce a signed release build. You need to specify all --key-store-* options.
    * --key-store-alias-password - Provides the password for the alias specified with --key-store-alias-password. You can use the --key-store-* options along with --release to produce a signed release build. You need to specify all --key-store-* options.
    * --justlaunch - If set, does not print the application output in the console.
    * --clean - If set, forces rebuilding the native application.

### Attributes

    * <Device ID> is the index or name of the target device as listed by $ tns device android
    * <Emulator Options> is any valid combination of options as listed by $ tns help emulate android

Sending exception report (press Ctrl+C to stop).....</code>
0
avatar
2)
tns run android --emulator
<code>sh-4.4$ tns run android --emulator
Copying template files...
  ◝ Installing tns-androidInstalling  tns-android
  ◜ Installing tns-android[..................] / normalizeTr  ◠ Installing tns-android[..................] / normalizeTr  ◝ Installing tns-android[..................] / normalizeTr  ◞ Installing tns-android[..................] \ normalizeTr  ◡ Installing tns-android[    ..............] \ loadRequest  ◟ Installing tns-android[    ..............] \ loadRequest  ◜ Installing tns-android[    ..............] \ loadRequest  ◠ Installing tns-android[    ..............] \ loadRequest  ◝ Installing tns-android[    ..............] \ loadRequest  ◞ Installing tns-android[    ..............] \ loadRequest  ◡ Installing tns-android[       ...........] \ loadRequest  ◟ Installing tns-android[             .....] - extract:tns  ◜ Installing tns-android[             .....] \ extract:tns  ◠ Installing tns-android[             .....] / extract:tns  ◝ Installing tns-android[             .....] / extract:tns  ◞ Installing tns-android[             .....] / extract:tns  ◡ Installing tns-android[             .....] - extract:tns  ◟ Installing tns-android[             .....] - extract:tns  ◜ Installing tns-android[             .....] - extract:tns  ◠ Installing tns-android[             .....] | extract:tns  ◝ Installing tns-android[             .....] | extract:tns  ◞ Installing tns-android[               ...] \ remove:tns-/srv/http/portfolio/NativeScript/MyApp                      
└── tns-android@2.5.0 

  ◡ Installing tns-android
Exception: The plugin tns-android@2.5.0 is already installed
# run android

┌───────────────┬────────────────────────────────────────┐
│ Usage         │ Synopsis                               │
│ Run on all    │ $ tns run android [--key-store-path    │
│ connected     │ <File Path> --key-store-password       │
│ devices and   │ <Password> --key-store-alias <Name> -  │
│ running       │ -key-store-alias-password <Password>]  │
│ emulators     │ [--release] [--justlaunch]             │
│ Run on a      │ $ tns run android --device <Device ID> │
│ selected      │ [--key-store-path <File Path> --key    │
│ connected     │ -store-password <Password> --key-store │
│ device or     │ -alias <Name> --key-store-alias        │
│ running       │ -password <Password>] [--release] [-   │
│ emulator      │ -justlaunch]                           │
│ Start an      │ $ tns run android --emulator [         │
│ emulator and  │ <Emulator Options>] [--key-store-path  │
│ run the app   │ <File Path> --key-store-password       │
│ inside it     │ <Password> --key-store-alias <Name> -  │
│               │ -key-store-alias-password <Password>]  │
│               │ [--release] [--justlaunch]             │
└───────────────┴────────────────────────────────────────┘

Runs your project on a connected Android device or in a native Android emulator, if configured. This is shorthand for prepare, build and deploy. While your app is running, prints the output from the application in the console and watches for changes in your code. Once a change is detected, it synchronizes the change with all selected devices and restarts/refreshes the application.

### Options

    * --no-watch - If set, changes in your code will not be reflected during the execution of this command.
    * --device - Specifies a connected device/emulator on which to run the app.
    * --emulator - If set, runs the app in a native emulator for the target platform, if configured. When set, you can also set any other valid combination of emulator options as listed by $ tns help emulate android.
    * --release - If set, produces a release build. Otherwise, produces a debug build. When set, you must also specify the --key-store-* options.
    * --key-store-path - Specifies the file path to the keystore file (P12) which you want to use to code sign your APK. You can use the --key-store-* options along with --release to produce a signed release build. You need to specify all --key-store-* options.
    * --key-store-password - Provides the password for the keystore file specified with --key-store-path. You can use the --key-store-* options along with --release to produce a signed release build. You need to specify all --key-store-* options.
    * --key-store-alias - Provides the alias for the keystore file specified with --key-store-path. You can use the --key-store-* options along with --release to produce a signed release build. You need to specify all --key-store-* options.
    * --key-store-alias-password - Provides the password for the alias specified with --key-store-alias-password. You can use the --key-store-* options along with --release to produce a signed release build. You need to specify all --key-store-* options.
    * --justlaunch - If set, does not print the application output in the console.
    * --clean - If set, forces rebuilding the native application.

### Attributes

    * <Device ID> is the index or name of the target device as listed by $ tns device android
    * <Emulator Options> is any valid combination of options as listed by $ tns help emulate android

Sending exception report (press Ctrl+C to stop).....</code>
0
avatar
1. Проверьте, запускается ли android sdk по команде «android» в консоли.
2. Проверьте, что у вас установлена adb и она работает. Можно выполнить команду «adb devices» с подключенным телефоном или запущенным эмулятором.
Отпишитесь по результатам, если не сложно.
0
avatar
Последний раз редактировалось
0
avatar
1. Да запустился.
2. При запущенном эмуляторе Genymotion.
sh-4.4$ adb devices
List of devices attached
Здесь написан ип адрес:5555     device


При подключено телефоне
sh-4.4$ adb devices
List of devices attached
0000045600000123        device
Последний раз редактировалось
0
avatar
А если запустить «tns run android» (без ключа --emulator) с запущенной машиной Genymotion?
Похоже что скрипт запуска не может найти что-то, вот пока не пойму что ему нужно.
Как вариант, если эта команда тоже с ошибкой завершится, можно отписаться на официальный форум по NS…
0
avatar
tns run android с запущенной машиной Genymotion.

Спойлер!
Copying template files...
  ◜ Installing tns-androidInstalling  tns-android
/srv/http/portfolio/NativeScript/MyApp
└── tns-android@2.5.0 

  ◜ Installing tns-android
Exception: The plugin tns-android@2.5.0 is already installed
# run android

┌───────────────────────┬──────────────────────────────────────────────────────────────────────────────────────┐
│ Usage                 │ Synopsis                                                                             │
│ Run on all connected  │ $ tns run android [--key-store-path <File Path> --key-store-password <Password> -    │
│ devices and running   │ -key-store-alias <Name> --key-store-alias-password <Password>] [--release] [-        │
│ emulators             │ -justlaunch]                                                                         │
│ Run on a selected     │ $ tns run android --device <Device ID> [--key-store-path <File Path> --key-store     │
│ connected device or   │ -password <Password> --key-store-alias <Name> --key-store-alias-password <Password>] │
│ running emulator      │ [--release] [--justlaunch]                                                           │
│ Start an emulator and │ $ tns run android --emulator [<Emulator Options>] [--key-store-path <File Path> -    │
│ run the app inside it │ -key-store-password <Password> --key-store-alias <Name> --key-store-alias-password   │
│                       │ <Password>] [--release] [--justlaunch]                                               │
└───────────────────────┴──────────────────────────────────────────────────────────────────────────────────────┘

Runs your project on a connected Android device or in a native Android emulator, if configured. This is shorthand for prepare, build and deploy. While your app is running, prints the output from the application in the console and watches for changes in your code. Once a change is detected, it synchronizes the change with all selected devices and restarts/refreshes the application.

### Options

    * --no-watch - If set, changes in your code will not be reflected during the execution of this command.
    * --device - Specifies a connected device/emulator on which to run the app.
    * --emulator - If set, runs the app in a native emulator for the target platform, if configured. When set, you can also set any other valid combination of emulator options as listed by $ tns help emulate android.
    * --release - If set, produces a release build. Otherwise, produces a debug build. When set, you must also specify the --key-store-* options.
    * --key-store-path - Specifies the file path to the keystore file (P12) which you want to use to code sign your APK. You can use the --key-store-* options along with --release to produce a signed release build. You need to specify all --key-store-* options.
    * --key-store-password - Provides the password for the keystore file specified with --key-store-path. You can use the --key-store-* options along with --release to produce a signed release build. You need to specify all --key-store-* options.                                                                                                      
    * --key-store-alias - Provides the alias for the keystore file specified with --key-store-path. You can use the --key-store-* options along with --release to produce a signed release build. You need to specify all --key-store-* options.                                                                                                            
    * --key-store-alias-password - Provides the password for the alias specified with --key-store-alias-password. You can use the --key-store-* options along with --release to produce a signed release build. You need to specify all --key-store-* options.                                                                                              
    * --justlaunch - If set, does not print the application output in the console.                                  
    * --clean - If set, forces rebuilding the native application.                                                   
                                                                                                                    
### Attributes                                                                                                      
                                                                                                                    
    * <Device ID> is the index or name of the target device as listed by $ tns device android                       
    * <Emulator Options> is any valid combination of options as listed by $ tns help emulate android                
                                                                                                                    
Sending exception report (press Ctrl+C to stop).....

Я посмотрел у них там на github, есть такая ошибка.

1-вая моя версия, по приоритету

Если суди по тамошнему материалу, я настроил не правильно эти переменные.
export ANDROID_HOME=/opt/android-sdk
export JAVA_HOME=/usr/lib/jvm/java-8-openjdk

Я смотрел в интернете, есть много вариантов создания и вывода данных из этих переменных. Я даже ими пользовался, выводило пустой результат, для ANDROID_HOME и JAVA_HOME.

Но здесь у меня возник вопрос в том, что я не знаю толком bash и соответственно не могу гарантировать, что я получил правильный результат. Поэтому прошу вас указать на то, как правильно проверить работоспособность этих переменных.

Теперь 2-рая версия от ту даже

Нужно удалить tns-android зависимость из package.json. Для этого надо убрать одно свойства из подобъекта «dependencies: { }», под название ««tns-android»: "^2.5.0",» и ещё одну запись android, уже из другого подобъекта «nativescript: { }».

Но в подобъекте «dependencies: { }» есть только одно свойство ««id»: «org.nativescript.MyApp»». На всякий случай, я попробовал его полностью удалить.

После чего по инструкции очистил кеш NPM
npm cache clear

Повторно установить платформу.
tns platform add android


В результате этот способ у меня не прокатил. Начал жаловаться: "Package name must look like: com.company.Name", после ввоода команды tns platform add android. И из этого я понял, что нужно всё-таки ««id»: «здесь что-то указать»».
Последний раз редактировалось
0
avatar
Проверить переменные среды можно так:
echo $ANDROID_HOME 

По ошибке почитал, действительно есть косяк разработчиков с релизом, обещают выпустить обновление на днях. Попробуйте создать новый проект и посмотреть, не уйдет ли ошибка
Последний раз редактировалось
0
avatar
Вот полный вывод этого сообщения.

Спойлер!
<code>sh-4.4$ tns platform add android
Package name must look like: com.company.Name
# platform add

┌────────────────┬─────────────────────────────────────────────────────────────────────────────────────────────┐
│ Usage          │ Synopsis                                                                                    │
│ Android latest │ $ tns platform add android [--framework-path <File Path>] [--symlink] [--sdk <API Level>] [ │
│ runtime        │ --platform-template <Platform Template>]                                                    │
│ Android        │ $ tns platform add android[@<Version>] [--framework-path <File Path>] [--symlink] [--sdk    │
│ selected       │ <API Level>] [--platform-template <Platform Template>]                                      │
│ runtime        │                                                                                             │
└────────────────┴─────────────────────────────────────────────────────────────────────────────────────────────┘

Configures the current project to target the selected platform. 

### Options

    * --framework-path - Sets the path to a NativeScript runtime for the specified platform that you want to use instead of the default runtime. If --symlink is specified, <File Path> must point to directory in which the runtime is already extracted. If --symlink is not specified, <File Path> must point to a valid npm package.
    * --symlink - Creates a symlink to a NativeScript runtime for the specified platform that you want to use instead of the default runtime. If --frameworkPath is specified, creates a symlink to the specified directory. If --frameworkPath is not specified, creates a symlink to platform runtime installed with your current version of NativeScript.
    * --sdk - Sets the target Android SDK for the project.
    * --platform-template - Sets the platform template that will be used for the native application.

### Attributes

    * <API Level> is a valid Android API level. For example: 17, 19, MNC.
    * <File Path> is the complete path to a valid npm package or a directory that contains a NativeScript runtime for the selected platform.
    * <Platform Template> is a valid npm package, path to directory, .tgz or GitHub URL that contains a native Android or iOS template.
    * <Version> is any available version of the respective platform runtime published in npm. 

Sending exception report (press Ctrl+C to stop).....</code>

А если не убирать это свойство ««id»: «org.nativescript.MyApp»», то остается старая ошибка.

Возможно что-то, я не правильно понял (плохо понимаю английский), или редактировал package.json не в том месте, так я редактировал его именно в своем проекте MyApp. Поэтому есть предположения, что автор этого поста имел ввиду глобальный package.json, но не написал об этом потому-что это ему показалось и так очевидно. Если это так то мне нужно знать где его найти и не приведёт ли это к непредсказуемому поведению, в случаи ошибки?
0
avatar
Проверил переменые, есть страное поведение.
sh-4.4$ echo $ANDROID_HOME
/opt/android-sdk
sh-4.4$ echo $JAVA_HOME

sh-4.4$ почему-то выводится пустой результат, так и должно быть?

Попробовал создать новый проект, ошибка не ушла.
Спойлер!
sh-4.4$ tns create MyNewProject
sh-4.4$#
sh-4.4$#
sh-4.4$#
sh-4.4$#
Installing  tns-template-hello-world
/srv/http/portfolio/NativeScript/MyNewProject
└─┬ tns-template-hello-world@2.5.0 
  └── nativescript-theme-core@1.0.2 


/srv/http/portfolio/NativeScript/MyNewProject
└─┬ tns-core-modules@2.5.1 
  └── tns-core-modules-widgets@2.5.0 



> nativescript-dev-android-snapshot@0.0.6 postinstall /srv/http/portfolio/NativeScript/MyNewProject/node_modules/nativescript-dev-android-snapshot
> node postinstall.js

/srv/http/portfolio/NativeScript/MyNewProject
└─┬ nativescript-dev-android-snapshot@0.0.6 
  ├── adm-zip@0.4.7 
  ├─┬ nativescript-hook@0.2.1 
  │ ├─┬ glob@6.0.4 
  │ │ ├─┬ inflight@1.0.6 
  │ │ │ └── wrappy@1.0.2 
  │ │ ├── inherits@2.0.3 
  │ │ ├─┬ minimatch@3.0.3 
  │ │ │ └─┬ brace-expansion@1.1.6 
  │ │ │   ├── balanced-match@0.4.2 
  │ │ │   └── concat-map@0.0.1 
  │ │ ├── once@1.4.0 
  │ │ └── path-is-absolute@1.0.1 
  │ └─┬ mkdirp@0.5.1 
  │   └── minimist@0.0.8 
  ├── semver@5.3.0 
  └── shelljs@0.6.1 


Project MyNewProject was successfully created.

sh-4.4$ cd MyNewProject/
sh-4.4$#
sh-4.4$#
sh-4.4$#
sh-4.4$#
sh-4.4$ tns platform add android                                                                                    
sh-4.4$#
sh-4.4$#
sh-4.4$#
sh-4.4$#
Copying template files...                                                                                           
  ◠ Installing tns-androidInstalling  tns-android                                                                   
/srv/http/portfolio/NativeScript/MyNewProject
└── tns-android@2.5.0                                                                                               
                                                                                                                    
                                                                                                                    
You need to have Android SDK 22 or later and the latest Android Support Repository installed on your system.
Sending exception report (press Ctrl+C to stop).....                                                                
sh-4.4$ tns run android                                                                             
sh-4.4$#
sh-4.4$#
sh-4.4$#
sh-4.4$#
Copying template files...                                                                                           
  ◟ Installing tns-androidInstalling  tns-android                                                                   
/srv/http/portfolio/NativeScript/MyNewProject
└── tns-android@2.5.0                                                                                               
                                                                                                                    
                                                                                                                    
Exception: The plugin tns-android@2.5.0 is already installed
# run android                                                                                                       
                                                                                                                    
┌───────────────────────┬──────────────────────────────────────────────────────────────────────────────────────┐    
│ Usage                 │ Synopsis                                                                             │    
│ Run on all connected  │ $ tns run android [--key-store-path <File Path> --key-store-password <Password> -    │    
│ devices and running   │ -key-store-alias <Name> --key-store-alias-password <Password>] [--release] [-        │    
│ emulators             │ -justlaunch]                                                                         │
│ Run on a selected     │ $ tns run android --device <Device ID> [--key-store-path <File Path> --key-store     │
│ connected device or   │ -password <Password> --key-store-alias <Name> --key-store-alias-password <Password>] │
│ running emulator      │ [--release] [--justlaunch]                                                           │
│ Start an emulator and │ $ tns run android --emulator [<Emulator Options>] [--key-store-path <File Path> -    │
│ run the app inside it │ -key-store-password <Password> --key-store-alias <Name> --key-store-alias-password   │
│                       │ <Password>] [--release] [--justlaunch]                                               │
└───────────────────────┴──────────────────────────────────────────────────────────────────────────────────────┘

Runs your project on a connected Android device or in a native Android emulator, if configured. This is shorthand for prepare, build and deploy. While your app is running, prints the output from the application in the console and watches for changes in your code. Once a change is detected, it synchronizes the change with all selected devices and restarts/refreshes the application.

### Options

    * --no-watch - If set, changes in your code will not be reflected during the execution of this command.
    * --device - Specifies a connected device/emulator on which to run the app.
    * --emulator - If set, runs the app in a native emulator for the target platform, if configured. When set, you can also set any other valid combination of emulator options as listed by $ tns help emulate android.
    * --release - If set, produces a release build. Otherwise, produces a debug build. When set, you must also specify the --key-store-* options.
    * --key-store-path - Specifies the file path to the keystore file (P12) which you want to use to code sign your APK. You can use the --key-store-* options along with --release to produce a signed release build. You need to specify all --key-store-* options.
    * --key-store-password - Provides the password for the keystore file specified with --key-store-path. You can use the --key-store-* options along with --release to produce a signed release build. You need to specify all --key-store-* options.
    * --key-store-alias - Provides the alias for the keystore file specified with --key-store-path. You can use the --key-store-* options along with --release to produce a signed release build. You need to specify all --key-store-* options.
    * --key-store-alias-password - Provides the password for the alias specified with --key-store-alias-password. You can use the --key-store-* options along with --release to produce a signed release build. You need to specify all --key-store-* options.
    * --justlaunch - If set, does not print the application output in the console.
    * --clean - If set, forces rebuilding the native application.

### Attributes

    * <Device ID> is the index or name of the target device as listed by $ tns device android
    * <Emulator Options> is any valid combination of options as listed by $ tns help emulate android

Sending exception report (press Ctrl+C to stop).....
Последний раз редактировалось
0
avatar
После долгих проб и ошибок, мне все-таки удалялось заставить NativeScript, работать хоть как-нибудь и конкретная версия тут не причем, потому что она у меня обновилась уже до 2.5.2, а та ошибка не куда не делась. В общем оказалось, чтобы исправить её нужно было к гайду от fokusov , до установить через Аndroid sdk эти пакеты.

sudo android update sdk --filter tools,platform-tools,android-23,build-tools-23.0.3,extra-android-m2repository,extra-google-m2repository,extra-android-support --all --no-ui


А мне еще до этого пришлось все по удалять и обратно потом поставить, потому что я устанавливал через Аndroid sdk, вручную полагаясь на ту информацию, которую выводила, одна из первых ошибок. Из-за чего было сложно угадать, какой потек я еще не установил, а какой не нужен вообще.

Но радоваться рано! Потому-что пока, я смог установить пробное приложения, только на телефон. На эмулятор Genymotion, приложения устанавливается и при запуске выдает «ошибку приложения», а в консоли выдает вот это: "The system failed to delete the package for an unspecified reason.". Так устанавливать я побывал на нескольких разных образах Genymotion, на одном даже ошибки в консоли не было, а вот «ошибку приложения» выдавало всегда.

Кроме того, я так же узнал, что стандартный эмулятор у меня не установлен. А для полного гайда, это необходимо. Если не получилось заставит работать Genymotion, то хотя бы нужно, чтобы это работала на стандартном эмуляторе. Может быть найду способ как его установить. Но будет не плохо если вы мне подскажете как это сделать, быстрее чем я найду сам.

Все это я написал потому что не хочу чтобы вы зря не гадали, по моей старой проблеме. Сейчас я её решил, теперь появилась новая проблема, которую нужно решить.
Последний раз редактировалось
0
avatar
Нашел способ, как можно установить стандартный эмулятор, это делается путем установки образа через менеджер android например, "arm eabi v7a system image", а также там нужно не забыть установить sdk platform, для этой же версии Android откуда был взят этот обзор. А дальше через android avd, создать какой-нибудь эмулятор. При этом виртуализация в BIOS должна быть включена.

В общем я так и сделал, но запустить его у меня не получилось! Выдаёт ошибку, которая свидетельствует о том, что у меня якобы системы 32 битная. Это не так, я точно знаю, что она 64 битная. Пробовал сделать смену образов CPU/ABI и платформы через android avd, но на эту ошибку, это не как ни влияет.

Starting emulator for AVD 'Nexus'
ERROR: 32-bit Linux Android emulator binaries are DEPRECATED, to use them
       you will have to do at least one of the following:
       - Use the '-force-32bit' option when invoking 'emulator'.
       - Set ANDROID_EMULATOR_FORCE_32BIT to 'true' in your environment.
       Either one will allow you to use the 32-bit binaries, but please be
       aware that these will disappear in a future Android SDK release.
       Consider moving to a 64-bit Linux system before that happens.

В интернете есть решения этой проблемы, но похоже оно подходит для тех кто все ещё использует 32 битную систему.

Но я все же решил его проверить у себя. В этом случаи смена обзоров CPU/ABI, а также платформы через android avd, стала влияет на описание ошибки, но эмулятор все равно не запускается.

Вот варианты таких ошибок с разными настройками эмулятора при помощи android avd (остальные настройки по умалчиванию).

1) Настройка эмулятора с помощью android avd:
Target: Android 5.0.1 - API Level 21
CPU/ABI: Google APIs ARM (amrmebi-v7a)

Ошибка:
Starting emulator for AVD 'Nexus'
PANIC: Missing emulator engine program for 'arm' CPU.

2) Настройка эмулятора с помощью android avd:
Target: Android 5.0.1 - API Level 21
CPU/ABI: ARM (amrmebi-v7a)

Ошибка:
Starting emulator for AVD 'Nexus'
PANIC: Missing emulator engine program for 'arm' CPU.


3) Настройка эмулятора с помощью android avd:
Target: Android 5.0.1 - API Level 21
CPU/ABI: Intel Atom (x86)

Ошибка:
Starting emulator for AVD 'Nexus'
[139642485777536]:ERROR:./android/qt/qt_setup.cpp:28:Qt library not found at /opt/android-sdk/tools/lib/qt/lib
Could not launch '/opt/android-sdk/tools/qemu/linux-x86/qemu-system-i386': No such file or directory

4) Настройка эмулятора с помощью android avd:
Target: Android 5.0.1 - API Level 21
CPU/ABI: Intel Atom (x86_64)

Ошибка:
Starting emulator for AVD 'Nexus'
[140156165125248]:ERROR:./android/qt/qt_setup.cpp:28:Qt library not found at /opt/android-sdk/tools/lib/qt/lib
Could not launch '/opt/android-sdk/tools/qemu/linux-x86/qemu-system-x86_64': No such file or directory

5) Настройка эмулятора с помощью android avd:
Target: Android 6.0 - API Level 23
CPU/ABI: Intel Atom (x86_64)

Ошибка:
Starting emulator for AVD 'Nexus'
[140043994580096]:ERROR:./android/qt/qt_setup.cpp:28:Qt library not found at /opt/android-sdk/tools/lib/qt/lib
Could not launch '/opt/android-sdk/tools/qemu/linux-x86/qemu-system-x86_64': No such file or directory

6) Настройка эмулятора с помощью android avd:
Target: Android 6.0 - API Level 23
CPU/ABI: Google APIs ARM (amrmebi-v7a)

Ошибка:
Starting emulator for AVD 'Nexus'
[140696566764672]:ERROR:./android/qt/qt_setup.cpp:28:Qt library not found at /opt/android-sdk/tools/lib/qt/lib
Could not launch '/opt/android-sdk/tools/qemu/linux-x86/qemu-system-armel': No such file or directory

Так же при запуске (не сразу заметил), есть одно предупреждение и одна ошибка.

Сразу не очевидные ошибки.jpg

Предупреждение: A repairable Android Virtual Device.
Ошибка: An Android Virtual Device that failed to load. Click 'Details' to see the error.

Попробовал найти эти ошибки. Нашел, что возможно это из-за того, что не установлен HAXM для процессора intel. Но проблема в том, что у мне процессор AMD.

В общем решил поискать что-то подобное для AMD. В итоге оказалось, нужен KVM, судя по одному из этих постов. С начало надо проверить установлен ли. К сожалению пока я не нашел как это проверить. И даже не знаю, как его установить, если он не установлен, надеюсь что вы подскажете, как это сделать?

Есть так же вероятность, что KVM не нужен, собственно для этого предоставил информацию о других моих попытках исправить эту проблему, ведь раньше баловался, устанавливал Android Studio на этом же компьютере, но на Кубунту и все работало. А чтобы что-то дополнительное для запуска стандартного Android эмулятора я не помню, чтобы ставил. Возможно какой-то установленный пакет был там по умалчиванию, а здесь его нужно до уставить и все заработает.
Последний раз редактировалось
0
Только зарегистрированные и авторизованные пользователи могут оставлять комментарии.