CGBitmapContextCreate CGContextDrawImage CGBitmapContextGetData错误问题

CGBitmapContextCreate: unsupported parameter combination: set CGBITMAP_CONTEXT_LOG_ERRORS environmental variable to see the details
CGContextDrawImage: invalid context 0x0. If you want to see the backtrace, please set CG_CONTEXT_SHOW_BACKTRACE environmental variable.
CGBitmapContextGetData: invalid context 0x0. If you want to see the backtrace, please set CG_CONTEXT_SHOW_BACKTRACE environmental variable.

出现上面错误的原因,本人不太清楚,出现的环境iOS 12.0.1 iPhone 6;但是在iPhoneX模拟器上没出现
根据自己测试,找到了解决方案
传过去的image有问题,将图片转为NSData就可以了

[UIImage imageNamed:@"banner"]// 这个传过去图片不行

// 这样传过去的图片可以,将图片包一下既可以了 jpeg,png都可以
[UIImage imageWithData:UIImagePNGRepresentation([UIImage imageNamed:@"banner"])]