Dark Mode working in Debug configuration but not Release config

Hi folks,


I have a weird one I hope someone can help with because I can't find any related problems out there and can't tell if this is a bug or something I've goofed. I've been working on getting our app ready for Dark Mode and it looks and works fantastic when I build and run in Xcode-beta. When I archive (Release config build), sign, and test it out on any Mac running Mojave and I get some really strange behavior:


1. All system views/controls are correctly adapted to Dark Mode as expected

2. All of my custom image and color resources incorrectly display the Light version, despite having correct Any,Light,Dark variants

3. When I attach to the process in Xcode and run the view debugger, the views (text labels, images) in question all have inherited the correct effective appearance for Dark Mode--yet the wrong resource is being used/displayed


What gives? Why would this be happening and how can I debug it further?


Thanks!

Billy

Answered by billymeltdown in 328546022

Figured it out! (D'OH!) I think this information was actually in one of the WWDC session videos on Dark Mode and I must have overlooked it:


The workstation where we do our Release config beta builds was running the latest Xcode 10 beta, but we hadn't updated the machine itself to 10.14 Mojave. Upgraded to the latest developer beta of Mojave and voila, it's working!

Please check if your app using the release config has all the resources in the exact same place as your debug config.


I found out that Archive is useless in my case because my build process is a complex one. It requires the timely execution of scripts to prepare the contents of the app properly, as my app contains 3 helpers, one of which a login item, and one framework that must be placed in the correct places. I found out that Archive does not execute all these scripts correctly and messes up everything. Thus, I never use Archive anymore and made a new target that includes all the targets to generate the release app. I can live with that because I distribute my app via the Developer ID program.


HTH

Accepted Answer

Figured it out! (D'OH!) I think this information was actually in one of the WWDC session videos on Dark Mode and I must have overlooked it:


The workstation where we do our Release config beta builds was running the latest Xcode 10 beta, but we hadn't updated the machine itself to 10.14 Mojave. Upgraded to the latest developer beta of Mojave and voila, it's working!

Thanks for the advice and sorry to hear about the trouble! We don't have a very complicated build process (completed product is an .app bundle with one login item helper embedded), so we roll with xcodebuild to archive then exportArchive, and then productbuild to create a signed .pkg installer.

Dark Mode working in Debug configuration but not Release config
 
 
Q