codesign failed: resource fork, Finder information, or similar detritus not allowed

After updating AdscendMedia SDK in one of our app, when building the app, stumbled upon this error:

<project_folder>/Frameworks/AdscendMedia.framework: replacing existing signature
<project_folder>/Frameworks/AdscendMedia.framework: resource fork, Finder information, or similar detritus not allowed
Command /usr/bin/codesign failed with exit code 1

Found the solution here: https://developer.apple.com/library/content/qa/qa1940/_index.html

First, find files inside SDK framework folder which have extended attribute containing resource fork or Finder info:

cd <project_folder>/Frameworks
xattr -lr AdscendMedia.framework/

If got files, then delete them:

xattr -cr AdscendMedia.framework/

Slack MacOS client keep crashing

Recently updated my MacBook Pro (Mac OS High Sierra 10.13.1), and noticed Slack client keep crashing whenever it’s launched, can’t even get to see the GUI appear

Similar crash report found here – https://github.com/electron/electron/issues/10561

Solution found in this Apple forum – https://discussions.apple.com/message/32423169?ac_cid=tw123456#32423169

Summary:

rm -f ~/Library/Application Support/com.apple.backgroundtaskmanagementagent/backgrounditems.btm

then reboot

PS: The same bug also affect Spotify client (keep crashing when launched), solution above also fixed that.

Creating [object] in a different context than the calling function.

Creating [object] in a different context than the calling function.

This warning occured when a JS callback function is passed to Objective-C as KrollCallback and then executed on non-JS thread.

KrollCallback *callback = [args [email protected]"callback"];

[OneSignal initWithLaunchOptions:[TiApp app].launchOptions appId:appId handleNotificationAction:^(OSNotificationResult *result) {
    [callback call:@[] thisObject:nil];
}];

Problem with this warning is, if the JS callback create Ti.Network.HTTPClient instance, then that instance is null.

function callback() {
    var http = Ti.Network.createHTTPClient();
    http.open('GET', getUrl()); // JS error! http is null
    http.send();
}

To fix, get krollContext instance of current module/proxy and execute callback inside invokeBlockOnThread

// For TiModule / TiProxy descendants
KrollContext *context = [self.executionContext krollContext];

// For TiUIView descendants
KrollContext *context = [self.proxy.executionContext krollContext];

// invoke
[context invokeBlockOnThread:^{
    [callback call:@[] thisObject:nil];
}];

Activity & fragment lifecycle events

1. Start new activity

Activity, onCreate
Fragment, onAttach
Fragment, onAttach
Fragment, onCreateView
Fragment, onActivityCreated
Fragment, onStart
Activity, onStart
Activity, onResume
Fragment, onResume

2. Close activity (tap back button)

Fragment, onPause
Activity, onPause
Activity, onStop
Fragment, onDestroyView
Fragment, onDestroy
Fragment, onDetach
Activity, onDestroy

3. Hide activity (tap home button)

Fragment, onPause
Activity, onPause
Activity, onStop

4. Resume activity (from home screen)

Activity, onRestart
Fragment, onStart
Activity, onStart
Activity, onResume
Fragment, onResume

5. Go to other activity

Fragment, onPause
Activity, onPause
Activity, onStop

6. Resume from other activity (return back)

Activity, onRestart
Fragment, onStart
Activity, onStart
Activity, onResume
Fragment, onResume