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)
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
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))
Update to tns-ios 6.5.2
tns platform remove ios tns platform add [email protected]
tns build ios --release
You should now be able to build and test your app. Let me know if this solves your issues.