Nativescript: iOS 14 and Nativescript

Created on 23 Jun 2020  Β·  59Comments  Β·  Source: NativeScript/NativeScript

Hello,

Has anyone been able to run their Nativescript on iOS 14?
Running
"tns-ios": {
"version": "6.5.1"
}

does not work with iOS 14.

Running it in XCode 12 showed the error in main.m

[runtime executeModule:@"./"];
Thread 1: EXC_BAD_ACCESS (code=1, address=0x2818dd0)

Any ideas on how to resolve this issue?

in progress

Most helpful comment

We have some good news here - v8 iOS beta actually runs great on iOS 14 right now as the mention in apple's release notes above is with regards to the current JavaScript Core runtime 6.5.0. If you'd like to try iOS 14 with {N} right now in your apps change this:

"tns-ios": {
   "version": "6.5.0"
}

to this:

"tns-ios": {
   "version": "7.0.0-beta.3-v8-2020-06-20-121910-01"
}

Clean you apps entirely with npx rimraf hooks node_modules platforms package-lock.json && npm i and give it a shot.

Couple things to keep in mind. Several iOS SDK vendors have not updated their own SDK's to be compatible. One example is Airship - can see reported issue which they have in progress here:
https://github.com/urbanairship/ios-library/issues/249

So depending on how many SDK's you have integrated you may wanna check each vendor you use for reported issues.

The other thing is that to build your project with XCode 12 and for iOS 14, you will need to target a minimum of iOS 13 in the info xcode window it appears.

Lastly we are fixing the current JavaScript Core runtime with the patch Apple suggested and anticipate having a release on that sometime next week.

All 59 comments

We're going through the beta, thanks for the ping πŸ‘

@NathanWalker

Is it worth trying to do:

tns update next

I'm more than happy to test all of our plugin including your custom background audio plugin ;)

At least one issue is mentioned at the third bullet here under "Third-Party Apps": https://developer.apple.com/documentation/ios-ipados-release-notes/ios-ipados-14-beta-release-notes

Easy pals ! Give'm time ❀️ beta come out yesterday so expect a bit of delay πŸ˜‰

PS: i'm also exited πŸ˜‚

Erik - Thanks for the heads up ---

The bullet point is:

Apps using the NativeScript framework might quit unexpectedly on launch. NativeScript performs an unsafe operation to determine if an arbitrary pointer is an Objective-C object pointer. You can temporarily work around this issue by using object_getClass(_:) instead of reading the isa directly; however, this code should be updated to avoid checking if arbitrary pointers are Objective-C object pointers. (62913064)

We're updating that in iOS runtime and confirming against 6.5.x release as well as the new v8 iOS runtime that's in beta. Will ping back here when updated runtimes available to use with iOS 14 πŸ‘

Thank you Nathan for the update! I am sure I can speak for all of us here
that we appreciate you guys!!!!

On Tue, Jun 23, 2020 at 7:27 PM Nathan Walker notifications@github.com
wrote:

We're updating that in iOS runtime and confirming against 6.5.x release as
well as the new v8 iOS runtime that's in beta. Will ping back here when
updated runtimes available to use with iOS 14 πŸ‘

β€”
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
https://github.com/NativeScript/NativeScript/issues/8665#issuecomment-648479703,
or unsubscribe
https://github.com/notifications/unsubscribe-auth/AIBTPM7WGU3BCMKFXGONTSDRYE27XANCNFSM4OGAEKXA
.

@NathanWalker, just a quick follow up to prepare for this fix that {N} is making.

Will this fix work only with the latest {N} version 6.5, or will this fix also address version": "5.3.1" without the webpack?

I have an enterprise-level application that is running v 5.3.1 and wasn't sure if I need to start getting it to upgrade to {N} 6.5 or if this fix addresses older versions as well.

Thanks again for all your help and all your team does!

We have some good news here - v8 iOS beta actually runs great on iOS 14 right now as the mention in apple's release notes above is with regards to the current JavaScript Core runtime 6.5.0. If you'd like to try iOS 14 with {N} right now in your apps change this:

"tns-ios": {
   "version": "6.5.0"
}

to this:

"tns-ios": {
   "version": "7.0.0-beta.3-v8-2020-06-20-121910-01"
}

Clean you apps entirely with npx rimraf hooks node_modules platforms package-lock.json && npm i and give it a shot.

Couple things to keep in mind. Several iOS SDK vendors have not updated their own SDK's to be compatible. One example is Airship - can see reported issue which they have in progress here:
https://github.com/urbanairship/ios-library/issues/249

So depending on how many SDK's you have integrated you may wanna check each vendor you use for reported issues.

The other thing is that to build your project with XCode 12 and for iOS 14, you will need to target a minimum of iOS 13 in the info xcode window it appears.

Lastly we are fixing the current JavaScript Core runtime with the patch Apple suggested and anticipate having a release on that sometime next week.

@NathanWalker Thanks for the great news!

I can confirm that I was able to upgrade my {N} 6.5.1 to
"version": "7.0.0-beta.3-v8-2020-06-20-121910-01"

and I was able to get this working on iOS 14 !

My project is using the following plugins:
"nativescript-plugin-firebase": "^10.5.2"
"@nstudio/nativescript-loading-indicator": "^3.0.4",
"nativescript-feedback": "^1.3.12",
"nativescript-statusbar": "^5.0.0",
"nativescript-advanced-webview": "^5.0.0",

and that seems to be working well.

Great job!!!!!

P.S. ... now if you would tell me that version": "5.3.1" without the webpack will work like this I could sleep much better :)

@mspusta78 that's really exciting to hear thank you for confirming. Which version 5.3.1 you refer to there on that last part?

@mspusta78 that's really exciting to hear thank you for confirming. Which version 5.3.1 you refer to there on that last part?

@NathanWalker I have an enterprise-level application that is still running on
"tns-ios": {
"version": "5.3.1"
},

The current application is not compatible with NativeScript CLI 6.0 as it runs "tns-core-modules": "~5.3.1"

Will the fix for iOS 14 work for this version as well, or will the fix require

"tns-ios": {
"version": "6.5.0"
}

@mspusta78 oh gotcha! Yes you should be able to bump tns-ios to v8 beta there as well (on the core module 5.3 project) but lemme know if you encounter issue as we can adjust cli for it as should run fine.

@mspusta78 oh gotcha! Yes you should be able to bump tns-ios to v8 beta there as well (on the core module 5.3 project) but lemme know if you encounter issue as we can adjust cli for it as should run fine.

@NathanWalker I am happy to confirm that running

"tns-ios": {
"version": "7.0.0-beta.3-v8-2020-06-20-121910-01"
},

with {N} 5.3.1 works on iOS 14 emulator!
Thanks again for such a quick solution!

Because I run CLI 6.0 I had to run the old project with the following command:
npx [email protected] run ios

but as I mentioned I was able to get it to work with iOS14 emulator; however, I am unable to make it work on a real device running iOS14.

  • maybe we need to wait for public beta of iOS14 ?

Any suggestions?

@mspusta78 real device should be fine - you may try running app from xcode and capture any stack from there and could share it here. Just make sure in your src/package.json that discardUncaughtJsExceptions: false if you had that enabled to allow any exception to come on through.

It crashed on the main.m
[runtime executeModule:@"./"];

objc[2719]: Class TKDataSource is implemented in both /System/Library/Frameworks/CryptoTokenKit.framework/CryptoTokenKit (0x1ea660800) and /private/var/containers/Bundle/Application/0599D41B-0AD4-4CC3-9795-6353A8DA9920/MyTestApp.app/Frameworks/TNSListView.framework/TNSListView (0x107121fb8). One of the two will be used. Which one is undefined.

2020-06-26 09:14:16.432571-0400 MyTestApp[2719:512726] - [I-ACS036002] Analytics screen reporting is enabled. Call +[FIRAnalytics setScreenName:setScreenClass:] to set the screen name or override the default screen class name. To disable screen reporting, set the flag FirebaseScreenReportingEnabled to NO (boolean) in the Info.plist
(lldb)

I get the same warning as above when running it on the iOS14 simulator; however, as I mention the app launches on the simulator and does not crash on the main.m [runtime executeModule:@"./"]; (when run on the simulator)

@mspusta78 Exceptions and a stack are always so helpful - That's actually related to a conflicting class name in RadListView and the latest iOS which was fixed in nativescript-ui-listview 8.2.0 and newer. You should be able to bump ui-listview to latest version on that project, clean/rebuild and try once more πŸ‘

@NathanWalker Thank you for all your help. I can't get the older version of {N} without webpack to work.
The {N} 6.5 with the "version": "7.0.0-beta.3-v8-2020-06-20-121910-01" works well.

However, keep in mind that there are many older plugins that do not work with iOS 14 :(

@mspusta78 what occurs on the older version project when you run without webpack and why do you have to use it without webpack, further what is preventing you from updating it?

Not just older plugins but SDK vendors still need to update for iOS 14. It's not expected to be publicly released until early September so I think you have some time :)

Update: I just published an alpha version of the jsc runtime with a fix for ios14. (https://github.com/NativeScript/ios-runtime/pull/1275)

You can give it a try by setting the ios version to 6.6.0-alpha.0-ios14-2020-07-02-159364-01

Let us know if you run into any issues!

I can confirm [email protected] for JavaScriptCore runtime today including the fix Apple engineers suggested indeed fixes the launch crash for iOS 14.

So we will publish that as an official update likely by this Friday making the current tns-ios on JavaScriptCore and the future v8 engine iOS 14 compliant πŸ‘

Released 6.6.0-alpha.1-ios14-2020-07-03-159377-01 with a safer version of the fix!

Hi @rigor789 @NathanWalker, using the 6.6.0-alpha.1-ios14-2020-07-03-159377-01 runtime fails compiling and gives me the following error:

Assertion failed: (isStatic.getError().value() == 0), function serializeModule, file /Volumes/_external/ios-runtime/src/metadata-generator/src/Binary/binarySerializer.cpp, line 310.

Using this version of xcode:

Xcode 12.0
Build version 12A6159

And the following TNS components:

[email protected]
[email protected]
[email protected]

I suspect that the reason could be that the runtime and metadata generator might have been compiled in Debug configuration. Nevertheless, it could be interesting to investigate the reasons behind the debug assertion failure with your project's native dependencies.

The metadata stderr output could shed some light on this. For more info about this log see this article: https://docs.nativescript.org/plugins/use-native-ios-libraries#metadata-generators-parsing-errors-and-warnings

metadata-generation-stderr-i386.txt

BTW There's a lot of verbose logging as well in comparison to previous runtime, actually so much that it breaks Travis builds by exceeding the log limit.

@patrick-nurt I released 6.6.0-alpha.2-ios14-2020-07-06-159403-01. I haven't changed anything except I double checked I have cleared every build artifact to ensure everything gets rebuilt. Curious if this makes a difference!

What command are you using to build on travis?

Trying that one out now, I'm using this command in travis tns build ios --bundle --env.uglify --env.production --env.aot --for-device --release --provision

It's the same logs that's in the medata-generation file, there lots of lines starting with verbose ....

On another I've tried downgrading to latest iOS runtime and then it built fine.

Good news, it now builds locally with the new version - will try Travis now.

@patrick-nurt 🀞 it works on travis too. The last build could've had some debug artifacts that I forgot to clean.

@rigor789 it built on Travis aswell :-)

Thanks for letting us know @patrick-nurt - @rigor789 go ahead with official release of tns-ios 6.6.0 - it's possible could be released as 6.5.2

I can confirm that installing 6.6.0-alpha.2-ios14-2020-07-06-159403-01 works for me in the Simulator and on a physical device with iOS 14.

Hi! When doing "tns devices" I could not find the iOS 14 emulator. I there anything I could do?

Mine will build for an iOS 14 simulator device, but will not install on the simulator. I can drag it onto the device from the output directory, and then it will recognize it going forward.

I also receive an Command xcodebuild failed with exit code 65 when trying to run a build for a device with [email protected] for iOS 14. Works fine on previous versions and with Xcode 11.5 and iOS 13.

@darrenkhouston thats usually a common error with certificates on iOS when building for device. Can you open the platforms/ios workspace file in XCode and check the project signing in there and may need to set the team development Id in the build.xcconfig

@NathanWalker I wish that was the case, but like I said, it builds fine with Xcode 11.5 and iOS 13.5, but not with Xcode 12 and iOS 14. Simulator works, but the build fails every time I try. All same settings, Distribution Certificate and everything, just fails to build with exit code 65.

UPDATE
I was able to successfully get it to build with Xcode 11.5. I was under the impression that it required Xcode 12. Build was successful.

Hi @NathanWalker Just to confirm, there is still work being done for iOS 14 support, right? This bug is marked as closed but notice it still has the in-progress tag...

I've been able to run our existing production app on emulators with iOS 14, as well as on a real device (iphone 8 w/ iOS14) when downloading it from the app store. Yet I've received reports of the app crashing immediately on an iPhone 11 running iOS 14. Can provide logs from that phone if needed.

@spstratis definitely share those logs - we aren't aware of any more issues with ios14, so anything that comes up is very useful to know!

Thanks @rigor789 link to the log below along with the version of the iOS run time and core modules that the app is built against.

https://gist.github.com/spstratis/51502d5b4630566031e9ba0fa3a2e013

    "tns-ios": {
      "version": "6.5.0"
    }

  "dependencies": {
    "@nativescript/theme": "2.2.1",
    "@nstudio/nativescript-cardview": "^1.0.0",
    "@nstudio/nativescript-loading-indicator": "^3.0.4",
    "moment": "2.24.0",
    "moment-timezone": "0.5.27",
    "nativescript-appversion": "1.4.4",
    "nativescript-dom": "2.0.5",
    "nativescript-drop-down": "5.0.4",
    "nativescript-intl": "3.0.0",
    "nativescript-iqkeyboardmanager": "1.5.1",
    "nativescript-local-notifications": "4.1.5",
    "nativescript-localize": "4.2.0",
    "nativescript-master-technology": "1.1.3",
    "nativescript-modal-datetimepicker": "1.2.1",
    "nativescript-plugin-firebase": "10.3.3",
    "nativescript-secure-storage": "2.6.0",
    "nativescript-ui-sidedrawer": "8.0.0",
    "node-sass": "4.13.1",
    "tns-core-modules": "6.5.1",
    "validator": "12.2.0"
  },
  "devDependencies": {
    "lazy": "^1.0.11",
    "nativescript-dev-webpack": "^1.4.1",
    "tslint": "^5.20.1",
    "typescript": "^3.7.5",
    "yarn-check": "^0.0.3"
  },


@spstratis you are using 6.5.0 of the ios runtime, as mentioned in this thread the fix has landed in https://github.com/NativeScript/ios-runtime/releases/tag/v6.5.2

Hello! I have troubles with new ios tns version 6.5.2
I started ios app from terminal by tns run ios --env.local

and starting of app stack on next lines:

Project successfully prepared (ios)
Configure firebase
Add iOS crash logging
Installing on device 00008020-00127542146A002E...
Successfully installed on device with identifier '00008020-00127542146A002E'.
Restarting application on device 00008020-00127542146A002E...

but I can launch my app manually, but terminal stops printing logs as it was before updating to 6.5.2

@befirst is this on ios14? What version of xcode? Does switching back to 6.5.0 without any other changes make it work again? (delete platforms and rebuild after changing the version).

@rigor789 Yes, ios 14, xcode Version 11.6 (11E708).

Does switching back to 6.5.0 without any other changes make it work again?

I haven't tried yet. But in my xcode, there is a problem that my iPhone always is not available.
I checked google, and according to this: https://stackoverflow.com/questions/61863826/iphone-is-not-available-please-reconnect-the-device
I realized that I need beta version of Xcode to build app. I think these problems are connected. but anyway, I will check my app with tns version 6.5.0

@rigor789 it's obviously an issue connected with my phone and ios14 version that incompatible with my xcode. I built project with tns version 6.5.2 on a simulator and it's working fine.
But anyway, thank you for your quick response

Do we have a solution for nativescript build with IOS 14?
As a workaround I install de xcode 11.7 to build my project.

It doesn’t work with ths 6.5.2 and later for Apple devices released in 2018 and later
xcode 11.7 or later

I've an app running on NS 5.4.0 and I was trying get it work on iOS 14. So, I've updated the iOS platform to 7.0.0-beta.3-v8-2020-06-20-121910-01. But now, when I run the xcode build, it gives me following error.

spawn: xcodebuild "SHARED_PRECOMPS_DIR=/Users/xxxxx/platforms/ios/build/sharedpch" "build" "-configuration" "Debug" "ONLY_ACTIVE_ARCH=NO" "BUILD_DIR=/Users/xxxx/platforms/ios/build" "-sdk" "iphonesimulator" "CODE_SIGN_IDENTITY=" "-workspace" "/Users/xxxx/platforms/ios/myapp.xcworkspace" "-scheme" "xxxx" "-allowProvisioningUpdates"
Build settings from command line:
    BUILD_DIR = /Users/xxxxx/platforms/ios/build
    CODE_SIGN_IDENTITY = 
    ONLY_ACTIVE_ARCH = NO
    SDKROOT = iphonesimulator13.2
    SHARED_PRECOMPS_DIR = /Users/xxxxx/platforms/ios/build/sharedpch

note: Using new build system
note: Planning build
note: Constructing build description
error: There is no XCFramework found at '/Users/xxxxx/platforms/ios/internal/NativeScript.xcframework'. (in target 'myapp' from project 'myapp')
error: There is no XCFramework found at '/Users/xxxxx/platforms/ios/internal/TKLiveSync.xcframework'. (in target 'myapp' from project 'myapp')

** BUILD FAILED **

Command xcodebuild failed with exit code 65

And the tns info output

$ tns info
βœ” Getting NativeScript components versions information...
⚠ Update available for component nativescript. Your current version is 5.4.0 and the latest available version is 7.0.8.
⚠ Update available for component tns-core-modules. Your current version is 3.4.1 and the latest available version is 6.5.18.
⚠ Update available for component tns-android. Your current version is 5.4.0 and the latest available version is 6.5.3.
βœ” Component tns-ios has 7.0.0-beta.3-v8-2020-06-20-121910-01 version and is up to date.

@JamesPJ what's your XCode version? Can you try with [email protected] too? (That's the version that should be working with ios14)

@JamesPJ what's your XCode version? Can you try with [email protected] too? (That's the version that should be working with ios14)

I'm on Version 11.3 (11C29)

Have similar issue:

[NativeScript start:config]; --> EXC_BAD_ACCESS (code=1, address=0x16d682e07)

Runtime initialization took 185ms
2020-09-21 07:10:21.681999+0200 ........ [14354:259081] NativeScript could not load bundle file:///Library/Developer/CoreSimulator/Profiles/Runtimes/iOS%2012.4.simruntime/Contents/Resources/RuntimeRoot/System/Library/Frameworks/SensorKit.framework
(lldb) 

Zrzut ekranu 2020-09-21 o 07 14 13

NS7 + Angular10. Issue only when building with --release flag, in debug mode app works perfect.

@JamesPJ what's your XCode version? Can you try with [email protected] too? (That's the version that should be working with ios14)

I can confirm that, with [email protected] app is working fine on iOS 14.

@JamesPJ Can you tell how you solved the error "Command xcodebuild failed with exit code 65"? And the version of XCode you are using is still 11.3?

I just reinitialized the ios platform with the veriosn 6.5.2. And yes, the version of XCode is still 11.3.

I have an application with

tns-ios: 6.5.0
tns-core-modules: 6.5.0
nativescript-ui-listview: 8.0.1 (I've also tried it with 8.2.0)

The application worked until the release of iOS 14.
I already updated XCode to version 12 and installed Command Line Tools.

As the first screen of the application has the list, the application crashes immediately.
If I use "tns-ios 6.5.2" I still get the error "Command xcodebuild failed with exit code 65", but if I use "tns-ios 7.0.0-beta.3-v8-2020-07-01- 222820-05" the build is successful but RadListview does not work and I get the error" Module 'nativescript-ui-listview' not found for element 'nativescript-ui-listview: RadListView' " (application crashes).
Can anyone help?

Why is this closed? This is still totally broken.

@stephan-v the original cause for the original issue has been fixed - the recent issues, mostly related to xcode12 are tracked here: https://github.com/NativeScript/NativeScript/issues/8867

Constructive feedback and more info is always welcome, either here on the linked issue!

If you are using NativeScript 6; the fix is:

tns platform remove ios
tns platform add [email protected]

If you are running NativeScript 7, this specific issue does not apply -- however we are tracking other NS7 & iOS 14 issues in issue #8867

Was this page helpful?
0 / 5 - 0 ratings

Related issues

rLoka picture rLoka  Β·  3Comments

OscarLopezArnaiz picture OscarLopezArnaiz  Β·  3Comments

pocesar picture pocesar  Β·  3Comments

dhanalakshmitawwa picture dhanalakshmitawwa  Β·  3Comments

NickIliev picture NickIliev  Β·  3Comments