Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

New angular project crashes on startup when ns run ios on real device with ios version 12.5.7 #10463

Open
3 tasks done
pichurichko opened this issue Dec 27, 2023 · 10 comments
Open
3 tasks done
Labels

Comments

@pichurichko
Copy link

Issue Description

Creating project from scratch and running on real iOS device with 12.5.7 iOS crashes on start.

Reproduction

  1. Create project using command:
    ns create myCoolAppTest --angular
  2. Run command to launch newly app on real iOS device with 12.5.7 iOS version
    ns run ios

Relevant log output (if applicable)

Exception Type: EXC_CRASH (SIGABRT)
Exception Codes: 0x0000000000000000,
0x0000000000000000
Exception Note: EXC_CORPSE_NOTIFY
Termination Description: DYLD, Symbol not found: _objc_opt_class | Referenced from: /private/var/containers/Bundle/ Application/CA7076DD-4ADD-44E4-
BDB2-78813F0EF534/
myCoolAppTest.app/Frameworks/ TNSWidgets.framework/TNSWidgets
(which was built for iOS 13.0) | Expected in: dyld shared cache

Environment

OS: macOS 14.1.2
CPU: (16) x64 Intel(R) Core(TM) i9-9980HK CPU @ 2.40GHz
Shell: /bin/zsh
node: 20.3.0
npm: 9.6.7
nativescript: 8.6.3

# android
java: 15.0.2
ndk: Not Found
apis: Not Found
build_tools: Not Found
system_images: Not Found

# ios
xcode: 15.0.1/15A507
cocoapods: 1.14.3
python: 2.7.18
python3: 3.9.6
ruby: 2.7.4
platforms: 
  - DriverKit 23.0
  - iOS 17.0
  - macOS 14.0
  - tvOS 17.0
  - watchOS 10.0

Dependencies

"dependencies": {
  "@angular/animations": "~16.2.0",
  "@angular/common": "~16.2.0",
  "@angular/compiler": "~16.2.0",
  "@angular/core": "~16.2.0",
  "@angular/forms": "~16.2.0",
  "@angular/platform-browser": "~16.2.0",
  "@angular/platform-browser-dynamic": "~16.2.0",
  "@angular/router": "~16.2.0",
  "@nativescript/angular": "^16.0.0",
  "@nativescript/core": "~8.6.0",
  "@nativescript/theme": "~3.0.2",
  "rxjs": "~7.8.0",
  "zone.js": "~0.13.0"
},
"devDependencies": {
  "@angular-devkit/build-angular": "~16.2.0",
  "@angular/compiler-cli": "~16.2.0",
  "@nativescript/ios": "8.6.3",
  "@nativescript/types": "~8.6.0",
  "@nativescript/webpack": "~5.0.18",
  "@ngtools/webpack": "~16.2.0",
  "typescript": "~5.1.6"
}

Please accept these terms

@pichurichko pichurichko added the bug-pending-triage Reported bug, pending triage to confirm. label Dec 27, 2023
@rigor789
Copy link
Member

You may need to adjust the deployment target, however iOS 12.5.7 is quite old, and lowering the deployment target to support it in your app could cause build issues for newer devices.

Try setting your deployment target to 12.4 according to the note here:

image

https://docs.nativescript.org/troubleshooting#dyld-symbol-not-found

@pichurichko
Copy link
Author

@rigor789 thx for your reply.

  1. Added this value to build.xcconfig:

IPHONEOS_DEPLOYMENT_TARGET = 12.4;

  1. Created Podfile with content:
platform :ios, '12.4'

post_install do |installer|
  installer.pods_project.targets.each do |target|
    target.build_configurations.each do |config|
      config.build_settings['IPHONEOS_DEPLOYMENT_TARGET'] = '12.4'
    end
  end
end

Application still crashes with the same log (provided in description).

@NathanWalker
Copy link
Contributor

@pichurichko Possible to update your Xcode to latest on your Mac? If so, you can set this target:

platform :ios, '13.0'

post_install do |installer|
  installer.pods_project.targets.each do |target|
    target.build_configurations.each do |config|
      config.build_settings['IPHONEOS_DEPLOYMENT_TARGET'] = '13.0'
      config.build_settings['CODE_SIGNING_ALLOWED'] = 'NO'
    end
  end
end

@NathanWalker NathanWalker added question and removed bug-pending-triage Reported bug, pending triage to confirm. labels Jan 9, 2024
@pichurichko
Copy link
Author

@NathanWalker thx for your reply.
Updated Xcode to latest version (15.1), but I could set target 13.0 on Xcode 15.0.1 as well.
The problem that I need to run the app on devices with iOS version 12+.
Are there new limitations of NS iOS version defined and set to iOS 13.0? Because current app was created from scratch without any additional libraries in it.

PS: the app built on new Xcode crashes too with same log.

@pichurichko
Copy link
Author

@NathanWalker no such issue when changed reference version of @nativescript/core package to 8.5.9.

"@nativescript/core": "8.5.9"

So changes in 8.6.0 caused the app crash issue on iOS 12.

@rigor789
Copy link
Member

@pichurichko curiously I'm not able to reproduce the issue with:

ns -v
8.6.3
✔ Up to date.

ns create ns10463 --angular
cd ns10463
ns run ios
Build Output

Project successfully built.
Build time: 25.463 s.
The build result is located at: /Users/rigor789/Code/_tmp/8.6/ns10463/platforms/ios/build/Debug-iphonesimulator/ns10463.app
Installing on device 43F98363-DBE0-4D29-B367-F71A1844EF12...
Successfully installed on device with identifier '43F98363-DBE0-4D29-B367-F71A1844EF12'.
Successfully transferred bundle.js on device 43F98363-DBE0-4D29-B367-F71A1844EF12.
Successfully transferred package.json on device 43F98363-DBE0-4D29-B367-F71A1844EF12.
Successfully transferred runtime.f63322446b196f924188.hot-update.js on device 43F98363-DBE0-4D29-B367-F71A1844EF12.
Successfully transferred runtime.f63322446b196f924188.hot-update.json on device 43F98363-DBE0-4D29-B367-F71A1844EF12.
Successfully transferred runtime.js on device 43F98363-DBE0-4D29-B367-F71A1844EF12.
Successfully transferred tns_modules on device 43F98363-DBE0-4D29-B367-F71A1844EF12.
Successfully transferred inspector_modules.js on device 43F98363-DBE0-4D29-B367-F71A1844EF12.
Successfully transferred vendor.f63322446b196f924188.hot-update.js on device 43F98363-DBE0-4D29-B367-F71A1844EF12.
Successfully transferred vendor.js on device 43F98363-DBE0-4D29-B367-F71A1844EF12.
Restarting application on device 43F98363-DBE0-4D29-B367-F71A1844EF12...
  [HMR][0c8c48295227b6342f9f] boot | HMR Enabled - waiting for changes...
  Angular is running in development mode.
  NativeScript debugger has opened inspector socket on port 18183 for org.nativescript.ns10463.

@pichurichko
Copy link
Author

@rigor789 which iOS version did you use on the simulator\device when trying to reproduce the issue?

@rigor789
Copy link
Member

@rigor789 which iOS version did you use on the simulator\device when trying to reproduce the issue?

Right, sorry I missed that part - I'll try again with 12.5.7 tomorrow - my test was with 17.2!

@pichurichko
Copy link
Author

For those who still have support of iOS 12.5.x and uses Xcode 15 see my recommendations:

  1. Use "@nativescript/core": "8.5.9" version in your project
  2. Production build app will still crash in runtime for iOS 12.5.x devices. Follow the actions described in the link below after
    ns prepare ios --release --bundle --env.uglify --env.aot (depends on your config)
    command execution:
    https://developer.apple.com/forums/thread/743323

@pichurichko
Copy link
Author

@rigor789 any updates on the issue reproduction or its fixes?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants