Reputation: 3192
App built using two different Xcode versions behave differently. When built using Xcode 10.1, all images are being loaded by UIImage(named:in:compatibleWith:)
method as expected. But as soon as I build the app using Xcode 10.3, this method returns nil
for all unsliced images. Strangely, it returns non-nil
for sliced images.
Also worth noting, images are working normally when I run the app from Xcode (10.1/10.2.1/10.3), but they are always nil
when tested from command line using xcodebuild test-without-building
.
Upvotes: 3
Views: 441
Reputation: 3192
The problem was in xcodebuild -destination
flag contents. Since this was happening on CI, it wasn't obvious that different values were passed for two separate builds (Xcode 10.1 and 10.2.1).
When built with Xcode 10.1, iOS Simulator 10.3.1 was used. Thus, actool --filter-for-os-device-version 10.3.1
argument was inferred by xcode build system. The resulting car file was compatible with iOS 10+ runtimes.
When built with Xcode 10.2.1, iOS Simulator 12.2 was used. In this case, actool --filter-for-os-device-version 12.2
argument was inferred by build system. The resulting car file was compatible with iOS 12+ runtimes.
In both cases xcodebuild test-without-building
was used with iOS Simulator 11.3 environment. Thus, app built with Xcode 10.2.1 was suitable for iOS 12.2 environment only, making all images disappear in iOS 11.3 environment.
The fix is to synchronize the value of xcodebuild -destination
flag in build-for-testing
and test-without-building
in command invocations.
Another suggestion that can help is to switch ENABLE_ONLY_ACTIVE_RESOURCES
build setting to NO
.
Upvotes: 1