问题
I’ve been submitting my app to the App Store for test flight and after build 11, I’ve been getting failures via email from Apple:
Non-public API usage: The app contains one or more corrupted binaries. Rebuild the app and resubmit
I get no additional details from them. No method names or classes or anything.
I’ve submitted build 15, for example, which is literally an exact copy of build 11 (which went through!) with a version number bump and build 15 failed.
I believe this is an Apple error though I have no way to prove it other than the paragraph above. Builds 1-11 worked fine and were able to be uploaded and distributed.
I’m using Xcode 9.1 and 9.2, both give the same error.
I’ve also contacted Apple via DTS and they said they can’t help me.
What do I do now?
回答1:
I had this exact problem. I was using CommonCrypto as a 'fake' framework. I removed that, and switched to the method described by the accepted answer in this thread, and iTunesConnect accepted my build.
Getting a Swift 4 conversion warning by XCode or having "CommonCryptoModule" showing up in cmd output when using pod update seems to be a strong indicator whether you are affected by this issue or not.
回答2:
Our projects that didn't have bitcode enabled started failing on Friday 2018-01-26. Setting Enable Bitcode to Yes in the Build Settings of those projects solved the issue.
回答3:
After a LOT of investigations on this part we finally found the problem for this issue: It seems like Apple gives this error for applications that suport both 32 and 64 bits.
Apple gave this reminder for Mac Appstore, but it seems that iOS applications are affected as well.
So a solution for this is to support bitcode OR to drop support for 32 bit devices by removing support for ARMV7 and ARMV7S or bellow from Valid Architectures from build settings. This will mean your application will work only on iPhone 5S and above. I hope this helps someone. Thank you!
回答4:
Had the same problem since Saturday. Took long trial and error in our case, turning on Bitcode didn't work.
The following part of my podfile was the reason:
post_install do |installer|
puts("Set deployment target")
installer.pods_project.targets.each do |target|
target.build_configurations.each do |config|
config.build_settings['IPHONEOS_DEPLOYMENT_TARGET'] = '10.3'
end
end
end
After I removed this one it processed without an error (still with Bitcode turned off). It really puzzles me though why setting the deployment target suddenly causes a rejection.
回答5:
Seems like the problem was fixed in the iTunes Connect backend. After build 45 we got through yesterday evening. Tried to find out what fixed the problem from all those changes - seems to go through with the inital build as well now.
So three days I could have spent outside...
回答6:
Recently from 26th Jan 2018 Without any notice or announcement apple did some change related swift old code does not longer work with submission of application at app-store. I did not use CommonCrypto in my project at all
I am also face that issue and i do lots of search and posting a question at apple forums and various platform about Non-public API usage: The app contains one or more corrupted binaries. Rebuild the app and resubmit
After get to know that for that kind of Invalid Binary rejection have not single solution. I mention some possible solution that works for some user recently.
- Update your cocoa-pods if you are use since long and that contain some swift framework or class since swift 2.0 then just update your cocoa-pods with swift 4 support and target 10.0 that error goes away.
- One of user i have talk he enable bitcode on from Build setting and that issue solve for him.
- Some of user remove unused code, class and framework that directly use in code without cocoa-pods issue solve for them.
- For me i get warning in left panel like following image
- Once i conversion to
swift4i get following warning:
The use of Swift 3 @objc inference in Swift 4 mode is deprecated. Please address deprecated @objc inference warnings, test your code with “Use of deprecated Swift 3 @objc inference” logging enabled, and then disable inference by changing the "Swift 3 @objc Inference" build setting to "Default" for the "appname" target.
For fix this warning i use that answer: The use of Swift 3 @objc inference in Swift 4 mode is deprecated?
After that i need to add
@objcinswift3class public method that i used in myobjective-cclass using bridgeI also check other warning in left side panel there is some other dependency warning of application target might be that also helpfup for other.
Hope this answer can useful for some of user who does not find the answer yet and that might be helpful.
回答7:
I was able to resolve it for myself, here's what I did:
- Bitcode is disabled in my project and stays disabled
- I removed a 3 pods, one being CommonCrypto, which I'd forgotten I had (the other 2 were QRCode and SwiftyJSON)
- I removed their Linker Flags as well in Build Settings
I hope that helps!
回答8:
I found the solution by my self after uploading the 9th build.
- I have used some swift class in the objective-c source code that I used by a bridge. While you build the project you can see left panel warning of project related and there is one line said update for swift 4.
- After converting swift 4 I get some more warning like use @objc to use swift 3 to latest swift 4 code.
You can check how to use @objc at swift class check this link: The use of Swift 3 @objc inference in Swift 4 mode is deprecated?
Then I have change unused profiles.
Then I upload the app and it works. Let me know if anyone need help
回答9:
I used soffes/CommonCrypto with Carthage. Remove the CommonCrypto.framework are work for me, and please check this link how to import commoncryto framework: http://ioscake.com/importing-commoncrypto-in-a-swift-framework.html
来源:https://stackoverflow.com/questions/48478143/app-submission-failed-1-corrupted-binaries-non-public-api-usage-and-no-additi