开发者

"object file format unrecognized, invalid, or unsuitable" Xcode error

开发者 https://www.devze.com 2023-04-03 14:07 出处:网络
I don\'t see any reasons why this message should come at the end of the log: /Users/Val/Library/Developer/Xcode/DerivedData/Mathematics-dzakmzlewrmgvibasvuixiwmkwwp开发者_C百科/Build/Products/Debug-i

I don't see any reasons why this message should come at the end of the log:

/Users/Val/Library/Developer/Xcode/DerivedData/Mathematics-dzakmzlewrmgvibasvuixiwmkwwp开发者_C百科/Build/Products/Debug-iphoneos/Mathematics.app: object file format unrecognized, invalid, or unsuitable
Command /usr/bin/codesign failed with exit code 1    

How can I fix this error?

I am desperate, all my certificates and profiles are valid, the app itself has no bugs at all.


I ran into the same issue with Xcode 7.0.1 and cocoapods. I ended up doing the following:

  1. Closed Xcode
  2. Removed everything under my DerivedData folder

    rm -fr /Users/{user}/Library/Developer/Xcode/DerivedData/*

  3. Restarted Xcode and rebuilt the project


For me, this turned out to be the Build Settings/Build Option/Compiler for C/C++/Objective C had become mismatched between Project and Target ... set to default in each case and problem resolved.


Make sure the 'Executable Name' (CFBundleExecutable) entry in your target's info.plist matches the 'Product Name' specified in your target settings.

iPhone Codesign object file format invalid or unsuitable


After battling this error for about 2 weeks and trying every suggested solution, in my case the problem was the following:

* Under Project --> Build Settings --> Build Options, the "Build Variants" was set to something different than Targets --> Build Settings --> Build Options --> Build Variants

Make sure these are set to the same setting, which should be "normal".

That change finally got rid of the usr/bin/codesign failed with exit code 1.


For me, the solution was:

  1. Navigate to YOURPROJECTNAME.xcodeproj
  2. Right Click and Show the content of package
  3. Enter to xcuserdata and remove all users folders
  4. Right Click on project.xcworkspace and Show the content of package
  5. Enter to xcuserdata and remove all users folders
0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号