Yes, but no luck
Please, ensure your title is less than 63 characters long and starts with a capital
letter.
iOS
CLI: (run tns --version to fetch it) => 3.0.1
Cross-platform modules: (check the 'version' attribute in the
node_modules/tns-core-modules/package.json file in your project)
=> "version": "3.0.1"
Runtime(s): (look for the "tns-android" and "tns-ios" properties in the
package.json file of your project)
=> "tns-ios": {
"version": "3.1.0-2017-5-16-2"
}
Plugin(s): (look for the version number in the package.json file of your
project)
"dependencies": {
"@angular/animations": "~4.1.2",
"@angular/common": "~4.1.2",
"@angular/compiler": "~4.1.2",
"@angular/core": "~4.1.2",
"@angular/forms": "~4.1.2",
"@angular/http": "~4.1.2",
"@angular/platform-browser": "~4.1.2",
"@angular/platform-browser-dynamic": "~4.1.2",
"@angular/router": "~4.1.2",
"nativescript-advanced-webview": "^1.1.3",
"nativescript-angular": "~3.0.0",
"nativescript-audio": "^3.4.2",
"nativescript-cardview": "^2.0.0-rc.0",
"nativescript-dom": "^2.0.0",
"nativescript-drop-down": "^3.0.1",
"nativescript-effects": "^0.5.0",
"nativescript-exoplayer": "^3.0.7",
"nativescript-fancyalert": "^1.1.2",
"nativescript-gif": "^2.0.0",
"nativescript-image-cache": "^1.0.5",
"nativescript-loading-indicator": "^2.3.2",
"nativescript-localstorage": "^1.1.2",
"nativescript-ngx-slides": "git+https://github.com/TheOriginalJosh/nativescript-ngx-slides.git",
"nativescript-orientation": "git+https://github.com/DimitarTachev/nativescript-orientation.git",
"nativescript-permissions": "^1.2.3",
"nativescript-pulltorefresh": "^2.0.0-rc.1",
"nativescript-sqlite": "^1.1.7",
"nativescript-telerik-ui": "^2.0.1",
"nativescript-theme-core": "^1.0.4",
"nativescript-videoplayer": "^3.0.5",
"nativescript-web-image-cache": "^4.1.0",
"reflect-metadata": "~0.1.8",
"rxjs": "^5.4.0",
"tns-core-modules": "~3.0.0",
"zone.js": "^0.8.10"
},
"devDependencies": {
"babel-traverse": "6.4.5",
"babel-types": "6.4.5",
"babylon": "6.4.5",
"lazy": "1.0.11",
"nativescript-dev-android-snapshot": "^0.*.*",
"nativescript-dev-typescript": "^0.4.0",
"tns-platform-declarations": "^3.0.1",
"typescript": "~2.2.1"
}`
MacOS 10.12.4
xCode Version 8.3.2
When I am trying to run this line:
tns run ios --emulator or tns run ios --emulator --watch
Error:
`CompileStoryboard NativeScript/Resources/LaunchScreen.storyboard
cd "/Users/jibon/Documents/My Work/NativeScript/platforms/ios"
export PATH="/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin:/Applications/Xcode.app/Contents/Developer/usr/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin"
export XCODE_DEVELOPER_USR_PATH=/Applications/Xcode.app/Contents/Developer/usr/bin/..
/Applications/Xcode.app/Contents/Developer/usr/bin/ibtool --errors --warnings --notices --module NativeScript --output-partial-info-plist /Users/jibon/Library/Developer/Xcode/DerivedData/NativeScript-adfgotrkdkddichbuvtsttyxvsek/Build/Intermediates/NativeScript.build/Debug-iphonesimulator/NativeScript.build/LaunchScreen-SBPartialInfo.plist --auto-activate-custom-fonts --target-device iphone --target-device ipad --minimum-deployment-target 8.0 --output-format human-readable-text --compilation-directory /Users/jibon/Library/Developer/Xcode/DerivedData/NativeScript-adfgotrkdkddichbuvtsttyxvsek/Build/Intermediates/NativeScript.build/Debug-iphonesimulator/NativeScript.build /Users/jibon/Documents/My\ Work/NativeScript/platforms/ios/NativeScript/Resources/LaunchScreen.storyboard
** BUILD FAILED **
The following build commands failed:
CompileAssetCatalog build/emulator/NativeScript.app NativeScript/Resources/Assets.xcassets
(1 failure)
Multiple errors were thrown:
Command xcodebuild failed with exit code 65
# run ios
Any suggestion in where I am doing wrong? Thanks in advance.
@jibon57 using your exact package.json configuration I was able to build successfully this project. Try to reset the project with deleting platforms and hooks folder and rebuilding. Also make sure that all of the used plugins are migrated for compatibility with NativeScript 3.x.x. You can also log more datails with executing
tns run ios --log trace
You might alos wnat to check this issue
@NickIliev Thanks for reply. I just tried as you have described but still no luck. I had deleted platforms & hooks folder.
CompileStoryboard NativeScript/Resources/LaunchScreen.storyboard
cd "/Users/jibon/Documents/My Work/NativeScript/platforms/ios"
export PATH="/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin:/Applications/Xcode.app/Contents/Developer/usr/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin"
export XCODE_DEVELOPER_USR_PATH=/Applications/Xcode.app/Contents/Developer/usr/bin/..
/Applications/Xcode.app/Contents/Developer/usr/bin/ibtool --errors --warnings --notices --module NativeScript --output-partial-info-plist /Users/jibon/Library/Developer/Xcode/DerivedData/NativeScript-adfgotrkdkddichbuvtsttyxvsek/Build/Intermediates/NativeScript.build/Debug-iphonesimulator/NativeScript.build/LaunchScreen-SBPartialInfo.plist --auto-activate-custom-fonts --target-device iphone --target-device ipad --minimum-deployment-target 8.0 --output-format human-readable-text --compilation-directory /Users/jibon/Library/Developer/Xcode/DerivedData/NativeScript-adfgotrkdkddichbuvtsttyxvsek/Build/Intermediates/NativeScript.build/Debug-iphonesimulator/NativeScript.build /Users/jibon/Documents/My\ Work/NativeScript/platforms/ios/NativeScript/Resources/LaunchScreen.storyboard
** BUILD FAILED **
The following build commands failed:
CompileAssetCatalog build/emulator/NativeScript.app NativeScript/Resources/Assets.xcassets
(1 failure)
Error: Multiple errors were thrown:
Command xcodebuild failed with exit code 65
at DevicesService.<anonymous> (/usr/local/lib/node_modules/nativescript/lib/common/mobile/mobile-core/devices-service.js:267:23)
at throw (native)
at rejected (/usr/local/lib/node_modules/nativescript/lib/common/mobile/mobile-core/devices-service.js:11:65)
at process._tickCallback (internal/process/next_tick.js:109:7)
Analytics statuses:
{ TrackFeatureUsage: 1, TrackExceptions: 1 }
Trying to track feature 'CLI' with value 'help'.
List of registered commands: /?, appstore, appstore|upload, autocomplete, autocomplete|disable, autocomplete|enable, autocomplete|status, build, build|android, build|ios, clean-app, clean-app|android, clean-app|ios, create, debug, debug|android, debug|ios, deploy, dev-generate-help, dev-generate-messages, dev-post-install, dev-preuninstall, dev-test, dev-test|android, dev-test|ios, device, devices, devices|android, devices|ios, device|android, device|get-file, device|ios, device|list-applications, device|list-files, device|log, device|put-file, device|run, device|stop, device|uninstall, doctor, emulate, emulate|android, emulate|ios, error-reporting, extension, extension|install, extension|uninstall, help, info, init, install, platform, platform|add, platform|clean, platform|remove, platform|update, plugin, plugin|add, plugin|install, plugin|remove, plugin|update, post-install-cli, prepare, proxy, proxy|clear, proxy|set, publish, publish|ios, run, run|android, run|ios, test, test|android, test|init, test|ios, update, usage-reporting
Reading help for command 'run|ios'. FileName is 'run-ios.md'.
# run ios
Note: I have copied "app" directory from a windows mechine. In windows it was working fine with Android. But I moved to mac device to build for iPhone.
@jibon57 Do you have some resources on which your app is depending located in _App_Resources_ folder (e.g. like images with src of type "res://myImage"). If you are using custom resources for Android located in App_Resources/Android then you will need to provide these resources for iOS as well and locate them in App_Resources/iOS.
@NickIliev Thanks again for quick response. Yes, I am using one image "ic_menu.png". I have added screen short of my IOS directory here:
https://prnt.sc/fdpd9a
https://prnt.sc/fdpddl
My Code:
<NavigationButton text="Menu" icon="res://ic_menu_black" ios.position="left" (tap)="openDrawer()"></NavigationButton>
Please have a look, if I am doing something wrong here.
@jibon57 the _AssetCatalog_ and _imageset_ has different way of usage in the native iOS apps. In the default templates, we are using AssetCatalog with different scaled photos to create the splash screen. However in your case when you want to reference a photo with res://myImageName for iOS they should be stored in _App_Resources/iOS_ and not in a subfolder. So directly place the images (with all the different scale naming) in the folder _App_Resources/iOS_. For reference see how these images are placed in our sample application nativescript-marketplace-demo
In two words - make sure ic_menu.png (and all other iOS resource images) is placed directly in _App_Resources/iOS_
@NickIliev Thank you very much. I found the problem. It was related with icons. But now I am getting this error:
Jibons-Pro:NativeScript jibon$ tns run ios --emulator
Executing before-prepare hook from /Users/jibon/Documents/My Work/NativeScript/hooks/before-prepare/nativescript-dev-android-snapshot.js
Executing before-prepare hook from /Users/jibon/Documents/My Work/NativeScript/hooks/before-prepare/nativescript-dev-typescript.js
Found peer TypeScript 2.2.2
Preparing project...
Project successfully prepared (ios)
Executing after-prepare hook from /Users/jibon/Documents/My Work/NativeScript/hooks/after-prepare/nativescript-dev-android-snapshot.js
Searching for devices...
Skipping package build. No changes detected on the native side. This will be fast!
Installing...
Successfully installed on device with identifier '7B9429DE-EEE8-4204-9026-02EDBE2F28BF'.
Executing before-livesync hook from /Users/jibon/Documents/My Work/NativeScript/hooks/before-livesync/nativescript-angular-sync.js
Transferring project files...
Multiple errors were thrown:
cp: cannot create directory 'app': No such file or directory
# run ios
cp: cannot create directory 'app': No such file or directory
Is consistent with the fact that you have tried to migrate your project from Windows to Mac using copy/paste. One possible reason is that you have pasted your project in a folder for which you do not have root permissions to execute commands like cp
I can't tell fo sure what is causing your copy command to fail but the best case would be to use source control when working with different OS.
The easiest scenario would be to init a GitHub repository - push the code online and then clone the repository on your Mac.
e.g.
Create new repository in your GitHub and then from the project folder execute
git init
git commit -m "first commit"
git remote add origin [email protected]:Username/repositoryName.git
git push -u origin master
and then from your Mac
git clone [email protected]:Username/repositoryName.git
cd repositoryName
tns run ios
@NickIliev Thank you. I just chmod the directory & it's working... But it isn't installing in my simulator. It's stuck here:
Hooks directories: [ '/usr/local/lib/node_modules/nativescript/lib/hooks',
'/usr/local/lib/node_modules/nativescript/lib/common/hooks',
'/Users/jibon/Documents/My Work/NativeScript/hooks' ]
AfterHookName for command prepare is after-prepare
Executing after-prepare hook from /Users/jibon/Documents/My Work/NativeScript/hooks/after-prepare/nativescript-dev-android-snapshot.js
Executing after-prepare hook at location /Users/jibon/Documents/My Work/NativeScript/hooks/after-prepare/nativescript-dev-android-snapshot.js in-process
Validating after-prepare arguments.
Hook completed
Searching for devices...
startLookingForDevices; platform is ios
Starting to look for iOS devices.
Exec ps cax | grep launchd_sim
stdout: 2740 ?? S 0:01.87 launchd_sim
stderr:
Found device with identifier '623666B3-09F9-4F47-AF53-FCC7ED38924F'
startLookingForDevices; platform is iOS
Exec ps cax | grep launchd_sim
stdout: 2740 ?? S 0:01.87 launchd_sim
stderr:
Skipping package build. No changes detected on the native side. This will be fast!
Installing...
& nothing happening...
Click on Control + C
Transferring project files...
Transferring from /Users/jibon/Documents/My Work/NativeScript/platforms/ios/NativeScript/app to app
Successfully transferred all files.
Refreshing application...
^C^CError: Multiple errors were thrown:
Cannot read property 'trim' of undefined
at DevicesService.<anonymous> (/usr/local/lib/node_modules/nativescript/lib/common/mobile/mobile-core/devices-service.js:267:23)
at throw (native)
at rejected (/usr/local/lib/node_modules/nativescript/lib/common/mobile/mobile-core/devices-service.js:11:65)
Analytics statuses:
{ TrackFeatureUsage: 1, TrackExceptions: 1 }
Trying to track feature 'CLI' with value 'help'.
List of registered commands: /?, appstore, appstore|upload, autocomplete, autocomplete|disable, autocomplete|enable, autocomplete|status, build, build|android, build|ios, clean-app, clean-app|android, clean-app|ios, create, debug, debug|android, debug|ios, deploy, dev-generate-help, dev-generate-messages, dev-post-install, dev-preuninstall, dev-test, dev-test|android, dev-test|ios, device, devices, devices|android, devices|ios, device|android, device|get-file, device|ios, device|list-applications, device|list-files, device|log, device|put-file, device|run, device|stop, device|uninstall, doctor, emulate, emulate|android, emulate|ios, error-reporting, extension, extension|install, extension|uninstall, help, info, init, install, platform, platform|add, platform|clean, platform|remove, platform|update, plugin, plugin|add, plugin|install, plugin|remove, plugin|update, post-install-cli, prepare, proxy, proxy|clear, proxy|set, publish, publish|ios, run, run|android, run|ios, test, test|android, test|init, test|ios, update, usage-reporting
Reading help for command 'run|ios'. FileName is 'run-ios.md'.
@jibon57 try installing the app explicitly on the started device with the following workflow
Start your iOS simulator manually and then execute
tns device
Your simulator should be listed in a similar table
โ # โ Device Name โ Platform โ Device Identifier โ Type โ Status โ
โ 1 โ bullhead โ Android โ 00d3e1311075c66f โ Device โ Connected โ
โ 2 โ sdk_google_phone_x86 โ Android โ emulator-5554 โ Emulator โ Connected โ
Then uninstall any previously installed version of your app from the simulator and run
tns run ios --device deviceId
where deviceId is the id of your iOS simulator.
@NickIliev , Still no luck... I stuck ...
I had reset all settings & contents of that simulator.
I am on MacOS: 10.12.5 (16F73)
Xcode: Version 8.3.2 (8E2002)
@jibon57 have you changed your packageId during the development?
After Successfully transferred all files swipe left/right your simulator and look for the application - it is possible that it is deployed but not started if you have changed your packageId incorrectly.
Also, you can try to create a basic project and run it on the simulator just to eliminate the possibilities that you have environment issues.
tns create testApp
tns run ios
In order to help you further please create a detail;ed log with executing
tns run ios --log trace
or directly write the log to file and then send it to us
tns run ios --log trace > log.txt
Anyone maybe have LSLint installed into VSCode? That solved it for me (I think, knock on wood)
Thank you. I got same error.
And I could get more detailed log via tns run ios --log trace.
the log is there.
Python version: 2.7.10 (default, Jul 15 2017, 17:16:57)
[GCC 4.2.1 Compatible Apple LLVM 9.0.0 (clang-900.0.31)]
Generating metadata for i386
Error: Unable to generate metadata for i386.
dyld: Library not loaded: @rpath/libc++.1.dylib
Referenced from: /Users/shinriyo/tns_apps/HelloWorld/platforms/ios/internal/metadata-generator/bin/./objc-metadata-generator
Reason: image not found
I came across with this problem.
I removed the [email protected] and installed [email protected], problem solved.
tns update
Worked for me, YMMV.
tns build ios --clean solved the issue for me
In my case, I suspect the issue exists because I changed the app icons with tns resources generate icons path and I do not have an Apple Developper licence.
Can someone confirm ?
As expected, it works for me when I reseted the default icons.
I know this is really old but is there a simple method to reseting the default icons?
As expected, it works for me when I reseted the default icons.
If someone pass by, yes that was my issue as well, it fixed the problem.
I simply copy past the App_Ressources/iOS folder from a app created with tns create then it worked
Most helpful comment
tns updateWorked for me, YMMV.