Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-23781] iOS8: Image Assets are distorted with Xcode 8.0

GitHub Issuen/a
TypeBug
PriorityCritical
StatusClosed
ResolutionNot Our Bug
Resolution Date2016-09-08T06:31:20.000+0000
Affected Version/sRelease 5.5.0
Fix Version/sn/a
ComponentsiOS
Labelsqe-5.5.0
ReporterHarry Bryant
AssigneeEric Merriman
Created2016-08-15T22:50:56.000+0000
Updated2018-06-12T01:41:59.000+0000

Description

Image assets are distorted in apps built with Xcode 8.0 (10.0 SDK) on iOS8 devices. For a default two-tabbed classic application with an ImageView, it affects: - The LaunchScreen Icon. - The two Tab Icons. - The Custom Image within the ImageView. *This does not occur in Simulators.* *This does not occur with iOS9 / iOS10.* *When reverting to Xcode 7.3 (9.3 SDK), the issue is no longer reproducible.* *This affects Classic & Alloy Projects.*

TEST CODE:

// this sets the background color of the master UIView (when there are no windows/tab groups on it)
Titanium.UI.setBackgroundColor('#000');

// create tab group
var tabGroup = Titanium.UI.createTabGroup();

var image = Ti.UI.createImageView({
  image:'facebookIcon.png'
});


//
// create base UI tab and root window
//
var win1 = Titanium.UI.createWindow({  
    title:'Tab 1',
    backgroundColor:'#fff'
});
var tab1 = Titanium.UI.createTab({  
    icon:'KS_nav_views.png',
    title:'Tab 1',
    window:win1
});

var label1 = Titanium.UI.createLabel({
	color:'#999',
	text:'I am Window 1',
	font:{fontSize:20,fontFamily:'Helvetica Neue'},
	textAlign:'center',
	width:'auto'
});
win1.add(image);

win1.add(label1);

//
// create controls tab and root window
//
var win2 = Titanium.UI.createWindow({  
    title:'Tab 2',
    backgroundColor:'#fff'
});
var tab2 = Titanium.UI.createTab({  
    icon:'KS_nav_ui.png',
    title:'Tab 2',
    window:win2
});

var label2 = Titanium.UI.createLabel({
	color:'#999',
	text:'I am Window 2',
	font:{fontSize:20,fontFamily:'Helvetica Neue'},
	textAlign:'center',
	width:'auto'
});

win2.add(label2);



//
//  add tabs
//
tabGroup.addTab(tab1);  
tabGroup.addTab(tab2);  


// open tab group
tabGroup.open();

Steps to Reproduce

1. Create a Classic Mobile Application. 2. Paste test code into the app.js file. 3. Add your own Custom Image to the Resources Directory and specify the image name under Ti.UI.createImageView's image property. 4. Build to iOS8 device. 5. Launch App and observe the LaunchScreen / ImageView / Tab bar.

Actual Result

Image Assets are distorted on an iOS8 device with Xcode 8.0

Expected Result

Image Assets should not be distorted on an iOS8 device with Xcode 8.0

Attachments

FileDateSize
IMG_0207.PNG2016-08-15T22:53:19.000+000033380
IMG_0209.PNG2016-08-15T22:53:23.000+000073436
IMG_0210.PNG2016-08-15T22:53:17.000+000058687
screenshot-1.png2016-08-16T22:17:34.000+00008424

Comments

  1. Hans Knöchel 2016-08-15

    -Please also attach some screens.- And to ensure: This only affect iOS8-devices from Xcode 8 (SDK 10.0)? 7.x, 9.x and 10.0 unaffected as you said?
  2. Harry Bryant 2016-08-15

    Screenshots uploaded, Can confirm that iOS9 / 10 are not affected by Xcode 8.0, Will have to test with iOS7.
  3. Chee Kiat Ng 2016-08-16

    [~htbryant] I'm assuming that you are using the default new app, so in your tiapp.xml you should be seeing true true Can you try setting app thinning to false to see what happens? (or a combination of true/false) to see what's the result.
  4. Chee Kiat Ng 2016-08-16

    I just tried with an iPhone 5 iOS 8.0.2, and can't reproduce, no matter app-thinning or enable-launch-screen-storyboard. I used *appc new --classic* to create project. APPC CLI Core 5.4.0-31 Ti SDK: 5.5.0.v20160815165906 APPC NPM 4.2.7 Can you try with another device?
  5. Hans Knöchel 2016-08-16

    Reassigning to Kiat for now, since I don't have an iOS 8 device to test in Germany right now. [~htbryant] Please also attach the project you were using (make sure to delete the build-directory before, as well as the Resources directory if you use Alloy).
  6. Harry Bryant 2016-08-16

    [~cng] Strange, I tested this issue further and found a number of things: 1. Tested on an iPhone 5S device (iOS 8.3) and found that I could not reproduce the issue at all. 2. Created a new project using the CLI, Ran on the affected device and was still able to reproduce the image distortion. 3. Reset the affected iPhone 6 device (iOS 8.2) completely. Below is a matrix of the app configurations I ran on this device, as well as the results. (Between each build, I deleted the app from the device, cleaned the project, and rebuilt the app to device). !screenshot-1.png! Simply reverting my Xcode back to 7.3 fixes the issue, additionally found a very recent StackOverflow post regarding the same issue: http://stackoverflow.com/questions/38972093/xcode-8-simulator-ios-8-image-get-distorted , though the cause is unclear. Currently I have no explanation as to why this would be affecting one device but not the others, however seeing as this issue has already been reported a day after Xcode beta 6 was released, it may not be just an individual issue. Tested On: iPhone 6 (8.2) Device iPhone 5s (8.3) Device Mac OSX El Capitan 10.11.6 Ti SDK: 5.5.0.v20160816120242 Appc Studio: 4.7.0.201607250649 Appc NPM: 4.2.7 App CLI: 6.0.0-25 Xcode 8.0 beta 6 (8S193k) Node v4.4.7
  7. Hans Knöchel 2016-08-16

    Good catch on the ticket, pretty sure it's a Xcode Beta issue then. Let's watch the ticket and I file a radar with this tomorrow.
  8. Chee Kiat Ng 2016-08-17

    Either it's an Xcode 8 issue, or something in assets catalog changed between Xcode 7.3.1 and Xcode 8, Specifically for iOS 8.2, and not iOS >= 8.3 Will continue to investigate.
  9. Hans Knöchel 2016-08-20

    Although the interaction with the asset-catalog looks like the issue, we don't really do much more with the asset catalog than generating the hash for the unique file-name and copy it over to the .pbxproj. Let's see if the next Beta comes up with a fix for this. Another Stackoverflow-thread: http://stackoverflow.com/questions/39094618/xcode-8-beta-6-app-image-broken-in-ios-8
  10. Hans Knöchel 2016-09-04

    I'm beginning to think this is no Xcode 8 issue. Please refer to [this test-project](https://www.dropbox.com/s/jwlw99qft0z25ji/AssetCatalogTest.zip?dl=0) I made that is displaying a simple UIImageView with an image-reference to the asset catalog. When running on iOS 8.4, the image looks fine an non-distorted, see [here](https://abload.de/img/simulatorscreenshot04fupif.png). -[~cbarber] Any special image transformation we do with asset-catalog images that might broke?- --- However, I can't even select the iOS 8.2 simulator in Xcode, although it is installed - only 8.3, 8.4, 9.x and 10.0. I also edited the above comment with another Stackoverflow-thread that was created two weeks ago. One of the comments: {quote} [...]. I found that the same image on iPhone 4s was distorted but not on iPhone 6s. So I then tested it by disabling the 1x and 2x asset for the same image. It then started working on iPhone 4s. I hope Apple fixes this issue in the gold master. {quote}
  11. Chee Kiat Ng 2016-09-08

    Tested with Xcode 8 GM on ti SDK 5.5.0.v20160831100821 appc cli 5.5.0-5 appc npm 4.2.7 iPhone 5s (iOS 8.0.2) And the images are not distorted. Resolving as not our bug.
  12. Hans Knöchel 2016-09-08

    The fix in the GM was also confirmed by several Stackoverflow-users. If QE has the device where the whole thing occurred, we'd appreciate it to validate with Xcode 8 GM (8A218a) again. Thanks!
  13. Lee Morris 2017-03-24

    Closing ticket with reference to the previous comments.

JSON Source