I'm starting with nativescript. I'm trying to build a hello world application to test it. However, when I run it, I get an exit status 127 for command not found.
Here is how I try to build:
[ahmed#localhost hello]$ tns build android
Executing before-shouldPrepare hook from /home/ahmed/PycharmProjects/hello/hooks/before-shouldPrepare/nativescript-dev-webpack.js
Skipping prepare.
Building project...
Gradle build...
spawn ./gradlew ENOENT
[ahmed#localhost hello]$ echo $?
127
[ahmed#localhost hello]$
If I run tns doctor, everything seems to be ok
[ahmed#localhost hello]$ tns doctor
✔ Getting environment information
No issues were detected.
✔ Your ANDROID_HOME environment variable is set and points to correct directory.
✔ Your adb from the Android SDK is correctly installed.
✔ The Android SDK is installed.
✔ A compatible Android SDK for compilation is found.
✔ Javac is installed and is configured properly.
✔ The Java Development Kit (JDK) is installed and is configured properly.
✔ Local builds for iOS can be executed only on a macOS system. To build for iOS on a different operating system, you can use the NativeScript cloud infrastructure.
✔ Getting NativeScript components versions information...
✔ Component nativescript has 5.1.0 version and is up to date.
✔ Component tns-core-modules has 5.1.1 version and is up to date.
✔ Component tns-android has 5.1.0 version and is up to date.
✔ Component tns-ios has 5.1.0 version and is up to date.
[ahmed#localhost hello]$
What did I miss?
I ran tns install to install dependencies. That solved my issue.
I was trying several things, the one that worked fort me, was:
ns clean
ns install
Related
I have successfully deployed my nativescript app to my ios and android devices and emulators many, many times. But now, when I try to deploy the app to ios, the builder stops at Project successfully prepared (ios) and won't load it to the emulator or device.
I deleted the hooks, node_modules, and platforms folders, then rebuilt with the same result. I can successfully run the app if I run it directly through XCode, just not from the nativescript cli.
Here's the output from tns doctor
✔ Getting environment information
No issues were detected.
✔ Your ANDROID_HOME environment variable is set and points to correct directory.
✔ Your adb from the Android SDK is correctly installed.
✔ The Android SDK is installed.
✔ A compatible Android SDK for compilation is found.
✔ Javac is installed and is configured properly.
✔ The Java Development Kit (JDK) is installed and is configured properly.
✔ Xcode is installed and is configured properly.
✔ xcodeproj is installed and is configured properly.
✔ CocoaPods are installed.
✔ CocoaPods update is not required.
✔ CocoaPods are configured properly.
✔ Your current CocoaPods version is newer than 1.0.0.
✔ Python installed and configured correctly.
✔ The Python 'six' package is found.
✔ Xcode version 11.6.0 satisfies minimum required version 10.
✔ Getting NativeScript components versions information...
✔ Component nativescript has 6.7.8 version and is up to date.
✔ Component tns-core-modules has 6.5.12 version and is up to date.
✔ Component tns-android has 6.5.3 version and is up to date.
✔ Component tns-ios has 6.5.2 version and is up to date.
Any idea as to why I can deploy from XCode but not the command line?
I have had similar problems in the past, and it has always meant doing an update of Nativescript and then restarting my system. However, your tns doctor output looks basically the same as mine and I'm not having any issues with this. Not sure what to say -- maybe try a new npm install -g nativescript -- but it looks like you are already up to date. I've found in my experiences that this seems to happen if Xcode has updated and the version of Nativescript I have is one behind. Your situation may be for a different reason. Also, for whatever reason, I also found I need to completely reboot (paradoxical as that sounds) after doing an update to get things working again. That led me to speculate at one point that something in the connectivity layer might get jiggered up and causing things to wait for a ready state that never appears (?) but that doesn't really make much sense either on deeper thought. Wish I had a more definitive suggestion!
I finally found the problem. In my situation, the nativescript-videorecorder plugin has a hook that runs during the after-prepare phase of the build process. The after-prepare script creates a promise that only resolves if it finds the AndroidManifest.xml in the platforms folder. When I delete the platforms folder to do a clean rebuild of ios, the AndroidManifest.xml doesn't exist causing the promise to hang.
If I build for android first, the ios build runs fine and deploys to my simulator and real device.
I notified the owner of nativescript-videorecorder. Hopefully this helps someone else who may have a similar problem with this or another plugin.
I've been using my application on the Nativescript Playground for android, it seems to be working fine, but when i try to run this on my android emulator it just doesn't bundle.
Execution failed for task ':app:processDebugManifest'.
null
Command gradlew.bat failed with exit code 1
TNS Doctor
√ Getting environment information
No issues were detected.
√ Your ANDROID_HOME environment variable is set and points to correct directory.
√ Your adb from the Android SDK is correctly installed.
√ The Android SDK is installed.
√ A compatible Android SDK for compilation is found.
√ Javac is installed and is configured properly.
√ The Java Development Kit (JDK) is installed and is configured properly.
√ Local builds for iOS can be executed only on a macOS system. To build for iOS on a different operating system, you can use the NativeScript cloud infrastructure.
√ Getting NativeScript components versions information...
√ Component nativescript has 6.7.8 version and is up to date.
‼ Update available for component tns-core-modules. Your current version is 6.5.5 and the latest available version is 6.5.8.
‼ Update available for component tns-android. Your current version is 6.5.0 and the latest available version is 6.5.1.
‼ Update available for component tns-ios. Your current version is 6.5.0 and the latest available version is 6.5.1.
I've tried using different SDK versions, removing my Gradle folders and changing the properties in AndroidManifest.xml but it doesn't works at all.
I have a problem completing NativeScript installation requirement. I got stuck at number 5 in the installation guide available here.
When i run the command "tns doctor" in the command prompt, i get the error message below:
Cannot find a compatible Android SDK for compilation. To be able to
build for An droid, install Android SDK 22 or later. Run $
%ANDROID_HOME%\tools\android to manage your Android SDK versions.
You need to have the Android SDK Build-tools installed on your system.
You can i nstall any version in the following range: '>=23 <=27'. Run
$ %ANDROID_HOME%\tools\android from your command-line to install
required An droid Build Tools.
You need to have Android SDK 22 or later and the latest Android
Support Reposito ry installed on your system. Run $
%ANDROID_HOME%\tools\android to manage the Android Support Repository.
I have installed the required sdk and i am still getting the same error message and every time i execute this script in the console, it takes like forever to complete:
"%ANDROID_HOME%\tools\bin\sdkmanager" "tools" "platform-tools"
"platforms;android-25" "build-tools;25.0.2"
"extras;android;m2repository" "extras;google;m2repository"
I work on an older App of mine which is Ionic-v1. I install the OneSignal plugin which is working now only with CocoaPods. At first all went fine, Android works flawless but I am not able anymore to build my IOS app because of CocoaPods. I can do what I want I keep getting the following error:
ld: 72 duplicate symbols for architecture arm64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
I lost the entire day trying to figure this out, I tried uncountable times any combination of “pod install, pod clean, pod disintegrate” etc. etc. but without any success.
I also found a post inside the ionic forum from #blakgeek and install his plugin “cordova-plugin-cocoapod-support” but keep getting the same errors. But with or without this plugin I keep getting the same error.
I would be happy if anybody can help me here because at this point I am pretty lost.
Thank you in advance
Xcode 9
Ionic 3.18 (But app is Ionic v1)cli packages: (/usr/local/lib/node_modules)
#ionic/cli-utils : 1.18.0
ionic (Ionic CLI) : 3.18.0
global packages:
cordova (Cordova CLI) : 7.1.0
Gulp CLI : CLI version 3.9.1 Local version 3.9.1
local packages:
Cordova Platforms : android 6.3.0 ios 4.5.3
Ionic Framework : ionic1 1.2.4
System:
Android SDK Tools : 26.1.1
ios-deploy : 1.9.2
ios-sim : 5.0.6
Node : v8.9.1
npm : 2.15.12
OS : macOS Sierra
Xcode : Xcode 9.0.1 Build version 9A1004
Environment Variables:
ANDROID_HOME : /Volumes/Mac External HD/Android/sdk
Misc:
backend : pro
I just ended up deleting once again my entire ios platform for the xxx time and somehow solved it with the following steps.
a. deleted my complete ios platform
b. deleted the onesignal cordova plugin
c. reinstalled the onesignal plugin
d. recreated my ios platform BUT forced version ios4.4.0 with the following command "ionic cordova platform add ios#4.4.0"
e. changed into my /platform/ios directory and made one "pod install"
f. opened xcode and build and run without any further issue.
Short explanation. I ended up with tone of duplicate symbol erros because I tried just to many things and manually added to many things. (cant recall what I did all) how ever I never paid attention in the number of duplicate symbols. I started out with just 2 which seems to be a known issue (thankx to this issue report https://github.com/ionic-team/ionic/issues/12849#issuecomment-328472880) but with my tests and trials I ended up with much more and got completely of track.
After clean install with ios#4.4.0 all worked fine for me.
thank all for your attention...
I'm running on macosx with nativscript 2.0 (typescript+angular2 tutorial).
I just ran the tns run ios --emulator command and then ctrl-c.
Then running this command: tns livesync ios --emulator --watch
results in:
.
.
.
Transferring project files...
Successfully transferred all project files.
Applying changes...
**Error Command failed: killall sampleGroceries2.app
No matching processes belonging to you were found
while executing killall sampleGroceries2.app.**
I have tested the {N} + Angular2 tutorial and afer following the instruction I had no problems with the livesync option.
Have you updated to NativeScript 2.0.0 - I have noticed that this error was logged in the previous version 1.7.1.
If you need to update your NativeScript version globally you can run
npm install -g nativescript
After that step you can remove/add the platform folder from your project with the following commands
tns platform remove ios
tns platform add ios
Also delete the node_modules folder and the re-run
tns run ios --emulator
To check your current NativeScript version you can execute
tns --version
The latest official release of {N} has some livesync fixes so now your command should run as espected - let us know if that solution was appliable for your case.