Duplicate
Create a simple project, add a label and build using Xcode beta 8
Emulator works fine: tns run ios --emulator
Problem:
Trying to compile using XCode 8 Beta 2 on iOS 10 Developer Beta 2:
NativeScript loaded bundle file:///System/Library/Frameworks/Foundation.framework
NativeScript loaded bundle file:///System/Library/Frameworks/UIKit.framework
** Fatal JavaScript exception - application has been terminated. **
Native stack trace:
1 0x100569494 -[TNSRuntime executeModule:]
2 0x1000b93f0 main
3 0x185c705b8
JavaScript stack trace:
1 @file:///app/tns_modules/utils/utils.js:206:72
JavaScript error:
file:///app/tns_modules/utils/utils.js:206:72: JS ERROR TypeError: UIDevice.currentDevice is not a function. (In 'UIDevice.currentDevice()', 'UIDevice.currentDevice' is undefined)
Version details:
tns --version: 2.1.1
nodeVersion": "4.4.5"
"_npmVersion": "2.15.5"
"tns-android": {"version": "2.1.1"}
"tns-ios": {"version": "2.1.1"
"babel-traverse": "6.10.4"
"babel-types": "6.11.1"
"babylon": "6.8.4"
"lazy": "1.0.11"
"nativescript-dev-typescript": "^0.3.0"
"typescript": "^1.8.10"
"dependencies": {
"nativescript-barcodescanner": "^1.3.5",
"tns-core-modules": "2.1.0"
}
Hi @johanteekens
Xcode 8 is still a beta version and currently is not supported by NativeScript.
Still, can you give us details on your OSX version - are you also using "Sierra" as your OS or "El Capitan"?
I'm using macOS Sierra, Developer Beta 2.
Just to confirm, same program works fine on my old macbook, on El Capitan, Xcode 7. Maybe an interesting head up. Feel free to close.
@johanteekens thank you for sharing the info with us.
We have this in mind this as a feature but still the idea is to bypass developing code for beta OS versions.
Keep in touch and at the moment we have an official release of Sierra there will be NativeScrip support as well.
Just to mention that on iOS 10 currentDevice has changed from method to a class property (which are not supported by the iOS runtime, yet).
@jasssonpet when might we expect support for this? I want to get my hands on the imessage extensions :D
Support for class properties is most likely coming with the 2.3 release of the iOS runtime, but if you are eager to try it I've uploaded the latest build from the release branch here. (You can add it to the project with tns platform add ios --framework-path <path_to_package>.) It currently requires OS X 10.11+ because the latest Clang build that we downloaded has such deployment target.
And here are the updated tns-core-modules if you want to build and use them: https://github.com/NativeScript/NativeScript/pull/2639.
@jasssonpet Awesome! I've all up to date so I'll try this out. Thank you!
@jasssonpet actually, I'm still having this issue with xcode 7.3.1 and simulator 9.3. I've also set the command line tools to 7.3.1 in xcode preferences.
I was using an iphone 6s simulator. using an iphone 6 resolved it.
@jasssonpet unfortunately this doesn't work for me. Still occurring the same error :( Is there another idea to solve it? Thx
And, of course, me too. I guess I will just wait till you release a version that supports iOS 10 ... hopefully soon! I've discovered a need to get a new build out before iOS 10, but wanted to build with the new Xcode, etc.
I am currently experiencing the same issue and unable to run app on iOS simulator.
Running Sierra with latest version of Xcode.
@slaction - More than likely you have a plugin that has broken code in it. v2.30 works fine on iOS 10 devices and simulators. I have a blog article on the actual issue and solution http://fluentreports.com/blog/?p=401 on what you need to fix in the plugin or to let the author know about the fixes that they need to do...
@slaction @NathanaelA Here's a great gist written by @jasssonpet that also describes these changes. https://gist.github.com/jasssonpet/919adaf64bc6482ea8521a32eb16280d
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.
Most helpful comment
Just to mention that on iOS 10
currentDevicehas changed from method to a class property (which are not supported by the iOS runtime, yet).