With the release of iOS14 and XCode 12, NativeScript apps started crashing. Unfortunately, the timing conflicted with the release of NativeScript 7 which caused lots of confusion. I ran into this issue with a NativeScript app that I built. Since I didn’t want to update the entire app to NativeScript 7 and wanted to get a quick fix out, I was able to make minor changes that fixed the app. To find this solution, I spent several hours trying different solutions and wanted to write this guide to help others that may be facing these issues.
The error I was seeing before these changes
[runtime executeModule:@"./"]; Thread 1: EXC_BAD_ACCESS (code=1, address=0x2818dd0)
Step 1
Add Podfile to app/App_Resources/iOS/ folder with this content:
post_install do |installer| installer.pods_project.targets.each do |target| target.build_configurations.each do |config| config.build_settings.delete 'IPHONEOS_DEPLOYMENT_TARGET' config.build_settings['CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER'] = 'NO' end end end
Step 2
Add this content to app/App_Resources/iOS/build.xcconfig file
EXCLUDED_ARCHS__EFFECTIVE_PLATFORM_SUFFIX_simulator__NATIVE_ARCH_64_BIT_x86_64=arm64 arm64e armv7 armv7s armv6 armv8 EXCLUDED_ARCHS=$(inherited) $(EXCLUDED_ARCHS__EFFECTIVE_PLATFORM_SUFFIX_$(EFFECTIVE_PLATFORM_SUFFIX)__NATIVE_ARCH_64_BIT_$(NATIVE_ARCH_64_BIT))
Step 3
Update to tns-ios 6.5.2
tns platform remove ios tns platform add [email protected]
Step 4
tns build ios --release
You should now be able to build and test your app. Let me know if this solves your issues.
Thanks for reading. Make sure you follow me on Twitter to stay up to date on the progress of my side projects T.LY, Weather Extension, and Link Shortener Extension. If you are interested in the tech I use daily, check out my uses page.
I spent 3 days looking for a fix. I submitted the app many times. All crashed until I applied your fix. Thank you Tim.
Awesome! Glad it helped. Make sure you share with other devs.
Thanks for this! Had random reports of my app crashing (it’s been released for a while) and couldn’t reproduce it. Updated libraries and submitted it to the App store, and the App store reported it failing. Your fix resolved it for me!
Awesome! Glad it helped.
Tim, I don’t know how to thank you enough… What an absolute legend, cheers 🍻
Thanks!! Glad it helped
Hi there, my issue has been resolved too. Thank you so much, can you please bring us through the thinking process of finding the solution (e.g. how did you figure out the code in Podfile and why we need to modify the build.xcconfig).
Also, do you know if this fix only work in tns-ios 6.5.2?
Hi, currently that solution is not working in ns 8 and ios 14.