tidev / titanium-sdk

🚀 Native iOS and Android Apps with JavaScript
https://titaniumsdk.com/
Other
2.76k stars 1.21k forks source link

Crash with LiveView enabled on 12.3.0.RC2 #13988

Closed eddyinet closed 9 months ago

eddyinet commented 9 months ago

I have searched and made sure there are no existing issues for the issue I am filing

Description

12.3.0.RC2 with LiveView enabled triggering a file change in VS Code causes crash:

ti build --project-dir "/Users/eddy/Documents/Development/Projects/SDKTest/SDKTest" --log-level info --platform ios --color --no-prompt --target simulator --liveview --device-id 64FB7221-CB50-466C-B2C0-F8E43BA781EA --sdk "12.3.0.RC2"

Titanium Command-Line Interface v7.0.0-beta9 SDK v12.3.0.RC2 Copyright TiDev, Inc. 4/7/2022-Present. All Rights Reserved.

Want to help? https://tidev.io/donate or https://tidev.io/contribute

2/13/2024, 8:23:50 AM

Operating System Name = macOS Version = 14.2.1 Architecture = 64-bit

CPUs = 8

Memory = 17179869184

Node.js Node.js Version = 20.11.0 npm Version = 10.2.4

Titanium CLI CLI Version = 7.0.0-beta9

Titanium SDK SDK Version = 12.3.0.RC2 SDK Path = /Users/eddy/Library/Application Support/Titanium/mobilesdk/osx/12.3.0.RC2 Target Platform = iphone

Command /Users/eddy/.nvm/versions/node/v20.11.0/bin/node /Users/eddy/.nvm/versions/node/v20.11.0/bin/ti build --project-dir /Users/eddy/Documents/Development/Projects/SDKTest/SDKTest --log-level info --platform ios --color --no-prompt --target simulator --liveview --device-id 64FB7221-CB50-466C-B2C0-F8E43BA781EA --sdk 12.3.0.RC2

[INFO] Deploy type: development [INFO] Building for target: simulator [INFO] Building using iOS SDK: 17.2 [INFO] Building for iOS Simulator: iPhone 15 Pro Max [INFO] Building for device family: iphone [INFO] Team ID: n/a [INFO] Minimum iOS version: 13.0 [INFO] Logging disabled [INFO] Debugging disabled [INFO] Profiler disabled [INFO] Set to copy files instead of symlinking [INFO] Transpile javascript: true [INFO] Generate source maps: true [INFO] Forcing clean build: /Users/eddy/Documents/Development/Projects/SDKTest/SDKTest/build/iphone/build-manifest.json does not exist [INFO] Initializing the build directory [INFO] Creating Xcode project [INFO] Creating Entitlements.plist [INFO] Creating Info.plist [INFO] Disabling ATS [INFO] Creating main.m [INFO] Copying Titanium iOS files [INFO] Installing default LaunchScreen.storyboard [INFO] Cleaning Xcode derived data [INFO] Creating debugger and profiler plists [INFO] Analyzing Resources directory [INFO] Analyzing module files [INFO] Analyzing CommonJS modules [INFO] Analyzing localized launch images [INFO] Processing JavaScript files [INFO] Writing app properties [INFO] Creating asset catalog [INFO] Creating assets image set [INFO] Creating launch image set [INFO] Creating app icon set [INFO] Writing bootstrap json [INFO] Creating launch logo image set [INFO] Missing 5 launch logos, generating missing launch logos from DefaultIcon.png [WARN] If this app has been previously installed on this simulator, you may need restart it to see the latest launch logo [WARN] iOS renders and caches the launch screen to a PNG image that seems to only be invalidated by restarting iOS [WARN] The default icon "DefaultIcon.png" contains an alpha channel and will be flattened against a white background [WARN] You may create an image named "DefaultIcon-ios.png" that does not have an alpha channel in the root of your project [WARN] It is highly recommended that the DefaultIcon.png be 1024x1024 [INFO] Missing 12 app icons, generating missing icons [INFO] appicon-Small@2x.png - Used for iPhone, iPad - size: 58x58 [INFO] appicon-Small@3x.png - Used for iPhone - size: 87x87 [INFO] appicon-Small-40@2x.png - Used for iPhone, iPad - size: 80x80 [INFO] appicon-Small-40@3x.png - Used for iPhone - size: 120x120 [INFO] appicon-60@2x.png - Used for iPhone - size: 120x120 [INFO] appicon-60@3x.png - Used for iPhone - size: 180x180 [INFO] appicon-Marketing.png - Used for iPhone - size: 1024x1024 [INFO] LaunchLogo~iphone - Used for iphone - size: 320x320 - size: 320x320 [INFO] LaunchLogo@2x~iphone - Used for iphone - size: 374x374 - size: 374x374 [INFO] LaunchLogo@3x~iphone - Used for iphone - size: 621x621 - size: 621x621 [INFO] LaunchLogo~ipad - Used for ipad - size: 384x384 - size: 384x384 [INFO] LaunchLogo@2x~ipad - Used for ipad - size: 1024x1024 - size: 1024x1024 [INFO] Writing i18n files [INFO] Processing Titanium symbols [INFO] Creating Xcode config files [INFO] Removing files [INFO] Writing index.json with listing of JS/JSON files [INFO] Invoking xcodebuild [INFO] Finished building the application in 28s 860ms [LiveView] version 1.5.6 [LiveView] File Server Started on 127.0.0.1:8324 [LiveView] Event Server Started on 127.0.0.1:8323 [INFO] Launching iOS Simulator [LiveView] Client connected -- Start simulator log ------------------------------------------------------- [INFO] SDKTest 1.0 (Powered by Titanium 12.3.0.5272d8a72a) [INFO] Reachability Flag Status: -R ------- networkStatusForFlags [INFO] Application started [LiveView] Reload Triggered REASON: File Changed FILE: /Users/eddy/Documents/Development/Projects/SDKTest/SDKTest/Resources/app.js [LiveView] Client disconnected [INFO] [LiveView] Reloading App [INFO] UI SHUTDOWN COMPLETE. TRYING TO RESUME RESTART [INFO] Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[TiApp applicationWillResignActive:]: unrecognized selector sent to instance 0x104109bb0' [INFO] First throw call stack: [INFO] ( [INFO] 0 CoreFoundation 0x0000000180491128 exceptionPreprocess + 172 [INFO] 1 libobjc.A.dylib 0x000000018008412c objc_exception_throw + 56 [INFO] 2 CoreFoundation 0x00000001804a5f78 +[NSObject(NSObject) instanceMethodSignatureForSelector:] + 0 [INFO] 3 CoreFoundation 0x0000000180495054 __forwarding + 732 [INFO] 4 CoreFoundation 0x000000018049759c _CF_forwarding_prep_0 + 92 [INFO] 5 SDKTest 0x0000000102b4a340 -[AppModule _resumeRestart:] + 116 [INFO] 6 TitaniumKit 0x0000000103ffd47c -[TiRootViewController shutdownUi:] + 588 [INFO] 7 SDKTest 0x0000000102b4a2c0 22-[AppModule _restart:]_block_invoke + 64 [INFO] 8 libdispatch.dylib 0x000000018016b4f4 _dispatch_call_block_and_release + 24 [INFO] 9 libdispatch.dylib 0x000000018016cd3c _dispatch_client_callout + 16 [INFO] 10 libdispatch.dylib 0x000000018017bb24 _dispatch_main_queue_drain + 1272 [INFO] 11 libdispatch.dylib 0x000000018017b61c _dispatch_main_queue_callback_4CF + 40 [INFO] 12 CoreFoundation 0x00000001803f1a30 CFRUNLOOP_IS_SERVICING_THE_MAIN_DISPATCH_QUEUE + 12 [INFO] 13 CoreFoundation 0x00000001803ec148 CFRunLoopRun + 1936 [INFO] 14 CoreFoundation 0x00000001803eb5a4 CFRunLoopRunSpecific + 572 [INFO] 15 GraphicsServices 0x000000018e9fbae4 GSEventRunModal + 160 [INFO] 16 UIKitCore 0x00000001852f02e4 -[UIApplication _run] + 868 [INFO] 17 UIKitCore 0x00000001852f3f5c UIApplicationMain + 124 [INFO] 18 SDKTest 0x0000000102a79040 main + 852 [INFO] 19 dyld 0x00000001034e5544 start_sim + 20 [INFO] 20 ??? 0x0000000102e8a0e0 0x0 + 4343767264 [INFO] 21 ??? 0x8c68800000000000 0x0 + 10117477300376174592 [INFO] ) [INFO] libc++abi: terminating due to uncaught exception of type NSException -- End simulator log ---------------------------------------------------------

Expected Behavior

When using LiveView and saving a file the App should reload without crashing

Actual behavior

When using LiveView and saving a file the App should reload cleanly.

Reproducible sample

Standard blank project using ti create

Steps to reproduce

Save any file with LiveView enabled

Platform

Android & iOS

SDK version you are using

12.3.0.RC2

Alloy version you are using

No response

rohidjetha commented 9 months ago

Same issue here, Liveview is working in RC1

hansemannn commented 9 months ago

The reason is that the handled delegates changed, so the code needs to be updated. Only Liveview v1 uses this internal/private API, but we can still update it for backwards compatibility 👍

hansemannn commented 9 months ago

Possible fix - more testing tomorrow: https://github.com/tidev/titanium-sdk/pull/13989