Build Failed No Reason Stated - ios

When I build my application in the simulator mode, it works fine. But when I try and build it for the active target to be my iOS device I get a build failed with no explanation as to why?
Does anyone know what I need to do, it was working yesterday I have all my certificates and everything I don't understand.

Definitely check your bundle identifier. I accidentally put a * in there and got the Build Failed with no reason.

In my case, I had not linked a framework which I was using in the project.

With this information, I can just guess.
I was running in a similar problem and my problem was the bundle identifier in the Info.plist. I had a whitespace in the name and that's why it failed with "No Issues".
My current Bundle identifier is: com.mycompany.${PRODUCT_NAME:rfc1034identifier}.
I think the "rfc1034identifier" makes everything working fine.

Check the Resurces added into the project such as images,textfiles which was copied into Xcode project ,if the copied file's original source is deleted this can also have similar issue, i faced the same.
Note:Only the files copied as, Copy items into destination group folders's Unchecked while adding the file to Xcode.

In my case, I had a syntax error which did now show up in the panel. I was compiling within a workspace that contained two projects. When I opened both of them individually, the syntax error showed up and I could fix it!

Related

Cocoapod issue not able to run on simulator

I have created my cocoapod and cross check in sample project but it is showing everytime this error.
I googled and found solution
Reset content and setting
Clear derived data
Clean and build
Restart xcode
But non of them works
i tried on device
Make sure you are opening the newly created .workspace file rather than your original project.
Refer to this answer for debugging.
https://stackoverflow.com/a/26129829
Basically you need to look at ~/Library/logs/CoreSimulator/CoreSimulator.log for the source of the errors.
You need to consider the fact that the simulator is not linking files properly than any specific cocoapod issue.
Alternately, the problem could be related to code signing.
Refer : https://stackoverflow.com/a/17402788/2569560
If details like the Podspec and the simulator log were shared, perhaps we could be of more help.

Xcode 8.0 Command /Applications/Xcode-beta.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/swiftc failed with exit code 1

When I compile my code on Xcode Version 8.0 beta 4 (8S188o) I get this single error bringing the compilation to failure:
Command
/Applications/Xcode-beta.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/swiftc
failed with exit code 1
I tried to clean the project and wipe the derived folder but that did not change things.
What is it and how may I know more about it?
When I try to compile on the terminal the error being reported is:
Invalid bitcast\n %.asUnsubstituted = bitcast %swift.error* %13 to
i2, !dbg !438\nLLVM ERROR: Broken function found, compilation
aborted!\n
Happened to me, when I had two classes with the same name in my project. After deleting the redundant one, error disappeared.
If you look above the error, Xcode will tell you which ViewController is added/declared twice, navigate to it and remove the reference. Build and you're good to go.
I am going to tell you my silly mistake, the error is showing the issue and It took 3 hours to me to understand. look into below error
look into above 2 lines of error, the problem is shown, Obviously, In my case Xcode is complaining that Location.swift and Customer.swift file is missing, look into my project hierarchy, the same issue can understand.
It's my advice to everyone that first understand the error and then look into issues. I removed my desktop files, which were referenced in the project, and therefore compile error occurred.
Clean your project that fixed my project
Product/clean
I got this error for core data models that i've created manually.And it got resolved by changing particular entity's 'Codegen' attribute to 'Manual/None' under Data Model Inspector.
If you change any file folder location or change any Objective-C Bridging file path. Then it's happened some time.
Update your Bridging path.
Clean your project alt + Shift + Command + K
Quit Xcode completely Command + Q
Open project again and wait for Xcode to index files.
I got this error when I was trying to run an xcode project. A swift file wasn't being found and complied correctly, even though clearly in the xcode project file you can see the swift file and when you click on it in finder the file comes up as a separate xcode swift file. I solved this by:
Deleting the problematic swift file
Creating a new swift file with the same name
Xcode prompts that the file is already created, press replace
copy/replace the code/etc. in the file
Clean the project (for good measure)
Run the project
The problem went away by itself for mysterious reasons. Instead of the whimsical linking error I got a new bunch of errors due to Swift 3 fling which the app compiles and run fine.
The solution that worked for me is I had to delete the .xcdatamodeld file in my project and create a new one. This solved it.
I got this error and resolved by changing Xcode command line tools,
Goto Xcode -> Preferences -> Choose Locations tab
Choose required Command Line Tools from drop down, run the project error has been fixed.
In my case the error triggered when Xcode could not find a file/folder from the external Framework and dependency. In such a case just pod update / pod install do the job.
Try removing inactive file(deleted file) from Build phases...
Based on #Mohammed Rizwan N answer
If error not gone, do the clean project and close Xcode. Then click right button on .xcodeproj/.xcworkspace file and choose appropriate Xcode version.
In my case, I tried to run a project in Xcode9/Swift4, while the project was written on Xcode8/Swift3
1.Go to build settings and check the path of the info.plist file and bridging header file.
2.If not sure they are correct , from the left side drag and drop the files into respective fields .This creates the path automatically .
Clean the project and build again .
I created 3 new groups and put my MainVC under one of those groups. After I deleted one of the new groups I created, the error went away after I cleaned my project.
Please update your entire log which suggests the error, mine is telling me I have duplicated classes in file
Try closing Xcode, cleaning the project and building again.
At first, cleaning wasn't enough. I had to actually close it and try again.
I faced this issue when I resolved git conflict for the project file, which was for adding and removing some files.
What I found out is Xcode creates the folder named folder named "Recovered References", just search this from bottom left search option from Xcode and delete it. After you delete it you will only get an error for missing files. Resolve that by adding files again by right-clicking and selecting add files option. Once you are done with it project compiles with no error.
Happened to me when I found two swift files with the same name within the project, even if the classes have different names.
In my case error came when I moved my bridging-Header.h file from one folder to another. and when I checked in Build Settings -> Objective-C Bridging Header it was showing old path. Then I moved that file back to previous folder.
My problem was that my machine was running out of available space. Restarting it cleaned up ~8GB of temporary files, but I guess you can also delete something instead.
This is mainly because xcode is not getting the exact path of any file or duplication of file name under linking area.
In my case I have added bridge header file under Resources file and added the path in
BuildSettings->Objective-C bridge header-> bridgehearfilename.h
You should specify the exact path of that file in this section.
eg: BuildSettings->Objective-C bridge header-> Projectfolder/Resources/bridgehearfilename.h
Correct your file paths in the build settings then Clean and build the project.
For me it was ,
Product > alt + Clean Build Folder
OR
alt + Shift + Command + K
Do these 3 steps:
Clean Project: Shift+Command+K
Make sure low disk space shouldn't be on your mac
Focus on the upper lines of this error...Try reading them again...Paste those files that are missing or having some light icon in xcode project navigator and delete those files with light icon.
Hope you will fix the error.
I tried to run a project in Xcode12/Swift4, while the project was written on Xcode8/Swift3
so I install Xcode version 11.7 and run this work for me.

ERROR "swiftc failed with exit code 1" when converting to latest syntax

I was trying to convert syntax of old Swift project to new one as per few suggestion on Stack Overflow I tried converting it through Edit > Convert > To latest Syntax that did not work properly instead I started getting new errors shown as below
Command/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/swiftc
failed with exit code 1
And
Command /usr/bin/ditto failed with exit code 1
I tried Xcode 6.0.1 Command /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/swiftc failed with exit code 1, but it's a different situation.
Have you tried to do clean with Clean build folder?
The combination keys is:
ALT + SHIFT + COMMAND + K
Try delete Derived Data folder and Build it.
Go to Xcode -> Preferences -> Locations for get the derived data path
Clean Xcode. (cmd+shift+k)
Quit Xcode completely.
Open project again.
Wait for Xcode to indexing files.
Now run your project.
Just had the same issue. For me it was because I had renamed some of the project directories. I had a ton of red files in my project navigator. To solve, follow these steps:
click on the directory in project navigator where many files show as red
Under "Identity and Type" in the File Inspector (on the right side), click Containing directory
Select the new directories
Rebuild - command shift K, command B
As far as I know there can be multiple reasons why a compiler fails. Although cmd+alt+shift+k will help most of the time. If this fails, then click on the error message and try to debug it.
For example in the image below, if you read the message, we get to know that, there has been a name duplication. Fixing the name duplication will fix the issue.
Just remove inactive file(deleted file) from Build phases
then
Clean Xcode. (cmd+shift+k)
delete Derived Data folder and Build it.
Go to Xcode -> Preferences -> Locations for get the derived data path or cmd+Alt+shift+k
OR
Just remove inactive file(deleted file) from Build phases
Cleaning the project wasn't working for me, this is because I didn't pay attention to the message right above (Xcode highlights only the final command).
In my case it was
<unknown>:0: error: filename "FileDuplicated.swift" used twice: '/../filepath/FileDuplicated.swift' and '/../filepath/FileDuplicated.swift'
<unknown>:0: note: filenames are used to distinguish private declarations with the same name
Command /../bin/swiftc failed with exit code 1
I had to change the name of one of the two files and it was solved.
Hope this can help someone, cheers
In my case it was due to the few swift files which has been showed grayed out in the Build Phases section. After removing those files it was successful.
In my case I deleted few files from project and when try to commit the code, the files was showing there . To solve this issue.
1. Open terminal
2. Type git clean -n // it will show you list of files which are deleted from project but still are saved somewhere
3. Type git clean -f // All unwanted files will be removed
In my case, it was "Other swift flags". I had declared a flag there but not -D, so this was not getting recognized and resulted in the same error
In my case swift development snapshot was selected instead of xcode 9.2. here are the steps and image.
xcode on screen and click on xcode top menu bar.
Than go to toolchains option and check on xcode 9.2. thats it.
Note: If no toolchain found in your xcode than download from Here and install it. (after installation restart xcode).
Happy Coding!!!
Ok, my turn now. In my case I had an existing project. I copied in a few files from another project. One of the files I brought in was SettingsViewController.swift and there was already a file by the same name I was not aware of. The files were in different directories of the project so no duplicate message was shown. The compile/link messages offered no clue to this. I figured out the issue by adding one file at a time to the project (there were 12 total) and the building each time until I found the offending file. I renamed the new file and project builds now.
In my case it was a compiler flag change that didn't work well. It took a few compiles before it actually started failing though! Xcode caches what it compiles.
I just had this issue. It's due to path references. Have you been moving files around and/or copying folders? Check if .xcodeproj is inside or outside of the main project folder. Also, make sure that the project's file and directory structure are intact.
/yourFolderProjectName/ <-- contains your .xcodeproj file AND folder with Xcode project name
/yourProjectFolder <-- here are .swift, info.plist, assets folder, etc.
/yourProjectXcodeFile.xcodeproj
Another thing to check:
In my case I had deleted a row in the "Other Swift Flags" section in the Build Settings screen under the Release setting.
That row had been a value for a compiler flag key/value pair. So the key was there but not the value.
Once I deleted the key as well, then the build worked again.
This issue is happening because of pods
So Follow the below steps to resolve this issue
Remove all the pods and re-install again.
Remove all the pods using below this command (rm -rf "pwd/Pods/")
Quit the Xcode and open it again and build the app with device (generic iOS device).
Now check this issue will be resolved.
I had this error when Xcode found two .swift files with same name. Rename one of them and build again.
Wait for completing the indexing and run the project again. You must get an error then check it which may be Objective-c bridging file not found error. This error comes if you are using any Objective-C library or code directly in the project and your project unable to find the bridging file in the system. This issue basically caused by, if project is unable to find any file in the system which is using in the project (path issue).
I faced this issue while using the Swift auto-generated header file in my project (named as 'TargetName'-swift.h) to use Swift classes in Objective-C.
There was a typo in the file where I had imported this swift header. Correcting the typo helped me resolve the issue.
Clean the build in Xcode cmd+shift+k.
Update the pods.
look the where errors showing.
Add the missing files in Xcode.
After Run the Code. Working fine.
Try below if none of the above working for you.
My project location was desktop/my_project_folder
I tried all above then i made simple change.
I create one more folder on desktop past my project
.
then...
Cause of problem in my case:
This problem occurred when i change my project name in xcode & project folder name from desktop.
I was working on a private pod and was also pointing to it locally. I had made some file name changes.
Hence I was getting this error.
All I had to do was to run pod install so it would reflect the file name changes. After that it compiled.
In my case I copied a core data entity and only renamed the entity but not the class.
So go to your xcdatamodel and select the enitity > rename also the class name
Had the same issue but with duplicate file references.
Deleting Derived Data and cleaning had no success. But I got it fixed by doing this:
Navigate to your project.pbxproj -> open with your text editor of choice(I use atom).
Command+F and find the duplicate file sources and then delete them.
Build/Run and should be fixed.
For me, it was the keychainAccess problem as described in this answer (my error messages were completely opaque, all I had to go by was 'failed with exit code 1')

Error itms-90035 - Xcode

I have developed a phonegap application which is running absolutely fine on iPhone. Now, I want to submit the app to the appstore. Following is the procedure I am following to submit my app:
Open Xcode and archive the project
Click on validate (which is successful)
Click on Submit to appstore (which is where I am getting the following error)
Until yesterday night, I wasn't even getting this error and today morning, I archive the project and I get this error. Not sure what the issue is.
This is the final stage which is stopping me from submitting the app and is very frustrating, I tried to search for the same error code on the stackoverflow forum and I could not find one single post which is exactly of the same error code as mine, which is very strange.
Please help :)
I had the same problem, turns out that one of my libraries installed via bower includes a .sh file, which is not needed. I have just deleted the file and everything has been uploaded successfully.
Seems like that Apple now enforces developers to have .sh files in their apps signed. As Cordova/Phonegap app don't need any of them, you can safely delete them.
This happened to me after updating to the latest Xcode (6.3.1). It's not just .sh files, as I was getting these errors about node scripts. It appears that ANY file that starts with #!/usr/bin/env will cause these errors. I was able to cause arbitrary errors by adding a #! to a random file.
Temporarily deleting the #!/usr/bin/env directive from the top of the files will work but you'll want a better long-term solution :)
You'll have to fix it by dealing with each script file case-by-case for what makes sense in your project.
As noted above this could be a temporary problem on Apple's side, not necessarily related to Xcode version.
EDIT: I managed to avoid this error by removing my projects .sh files from my target.
So far I'd say that's a bug on Apple's side.
I submitted an app yesterday without any issue, rejected it today to submit a slightly altered binary today, but like you I'm now encountering the same error.
I thought it was related to Xcode6.3.1 because I installed it this morning so I installed Xcode 6.3.0 again but the error remained. Then I checking everything thoroughly:
Certificates
Provisioning Profiles
iTunes connect application status
But no success so far.
The fact a "itms-90035" Google search returns only 1 result makes me think that may be some temporary incident.
In my case I got this error because the app display name had a special character in it. It escapes me why proper error messages cannot be generated.
As others have said, the problem appears to be due to including files named "upload-dsym.sh" in the app bundle. Here are the steps I took to get past this error:
Went to the project settings in Xcode and selected the "Target" app icon.
Selected the Build Phases tab.
Clicked on "Copy Bundle Resources"
Looked for a file being copied named "upload-dsym.sh".
I removed that file and then the upload went fine.
It has something to do with included .sh files, not that obvious indeed.
In our case, it was the AudioKit library. README says:
In most cases, when building for iOS or tvOS, regardless of how you install the framework, you will need to add a run phase to your project's target with the following script:
"$BUILT_PRODUCTS_DIR/$FRAMEWORKS_FOLDER_PATH/AudioKit.framework/fix-framework.sh"
Sometimes you don't see them directly in your target's build phases. Some of the 3rd party libraries can cause this error because they are dealing with .sh files as well.
Check your 3rd party libraries/pods README's files for more info.
I have the same issue. Then I delete the .sh file. And I submit my app again. Successful!
This issue has been resolved in CrittercismSDK CocoaPods 5.2.0 : https://github.com/CocoaPods/Specs/blob/master/Specs/CrittercismSDK/5.2.0/CrittercismSDK.podspec.json
You may either upgrade to sdk 5.2.0 or delete the file and remove the following lines from the Pods-resources.sh file:
if [[ "$CONFIGURATION" == "Debug" ]]; then
install_resource "CrittercismSDK/CrittercismSDK/dsym_upload.sh"
fi
if [[ "$CONFIGURATION" == "Release" ]]; then
install_resource "CrittercismSDK/CrittercismSDK/dsym_upload.sh"
fi
Thanks
We had a very similar problem today and solved it.
ERROR ITMS-90035: "Invalid Signature. A sealed resource is missing or invalid. The binary at path [MyNiftyApp.app/MyNiftyApp] contains an invalid signature. [...]"
We are using Jenkins-CI for the build process together with the xcode-plugin.
When I reviewed the jenkins build log I found this error message:
file added: /Users/Shared/Jenkins/Home/workspace/RELEASE_STAGE_my-nifty-app/build/MyNiftyApp.app/MyNiftyApp.app
file modified: /Users/Shared/Jenkins/Home/workspace/RELEASE_STAGE_my-nifty-app/build/MyNiftyApp.app/Assets.car
]
Codesign check fails : /Users/Shared/Jenkins/Home/workspace/RELEASE_STAGE_my-nifty-app/build/MyNiftyApp.app: a sealed resource is missing or invalid
After searching for that Assets.car I found this post:
https://issues.jenkins-ci.org/browse/JENKINS-21253
The User had a similar problem, could solve it by deactivating the following plugin option "XCode -> General Build Settings -> Generate Archive? " (it was true before, now it's false).
At least this solved the problem on our side - maybe it will guide you to the correct direction.
I resolved this by simply removing the "binary" file(s) in the error.
For you its www/js/release.sh.
For me it was two redundant bower-files, a .sh-file and a .js-file that was located under a "bin"-folder (maybe thats why it thought it was a binary?).
On a side-note, it seems that you could still continue the upload process by just clicking Send after being presented with the errors in Application Loader.
I received this same error when I tried to upload my app using ApplicationLoader 3.0. Upgrading to ApplicationLoader 3.1 (i.e. the latest), fixed the issue for me.
In the platforms directory run:
grep -r '#!/usr/' *
This will show you all the files that can be executed. Typically this would include .sh and node files.
From the results find the files that are in your project folder (e.g. my project folder was platforms/ios/www/*) and delete them leave the rest.
I had the exact same problem. I was writing a bug on the myApp.app/myApp
Decision:
Look for files that start with special characters or characters other than English. I found, deleted and everything worked!
I had same issue using both xcode 6.3.1 and 6.4 beta. Mine said it was my main.o file. I looked in the copy bundle resources and for some reason my project's main file was there. I removed it and archived it again to send up to itunes connect for testflight and it uploaded fine. Took me 3 hrs to figure out it was that stupid file. Home this helps. Seems you need to really pay attention to what your sending up in that "Copy Bundle Resources" in build phases. Whatever file its telling you is a problem remove taht from this area and give it a try.
In my case, I got the error when submitting a re-signed ipa file. Turns out I had looked at the application package in Finder, and it had created a .DS_Store file (this was after re-signing with codesign, which would have complained if the file were present at the time of signing).
After removing the .DS_Store file, the upload succeeded.
Run the following command (in mac) : codesign --verify -vvvv <your_application>.app
sample:
codesign --verify -vvvv project.app
project.app: a sealed resource is missing or invalid
file missing: /Users/iHTCboy/workspace/Payload/project.app/.DS_Store
Looks like that have a hidden file .DS_Store inside the assets of my app.
Kindly find and remove it and try again.
that is work for me

How do i fix this CopyPNG File error?

While reading /Users/user/Desktop/AppProject/PruebaApp/Logo Retina.png
pngcrush caught libpng error:
Read Er Could not find file:
/Users/user/Library/Developer/Xcode/DerivedData/PruebaApp-cblepoaxbqzyopcbcswwqjtftyon/Build/Intermediates/ArchiveIntermediates/MaderoAPP/InstallationBuildProductsLocation/Applications/MaderoAPP.app/Logo
Retina.png
Command
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/copypng
emitted errors but did not return a nonzero exit code to indicate
failure
Im getting these errors while archiving project, at the end it does archive but i want to get rid of it. I had trouble with the app before and i read that i should delete the DerivedData/(myproject)folder so i did. and apparently it is trying to look for the images in that folder how do i fix this??? Help!
Try first by Hard Cleaning your project CMD+OPTION+SHIFT+K, If problem exists apply following method,
Build Phases -> Copy Bundle Resources, Any fileName is red color?
Or
Convert Logo Retina.png or Create it again, maybe it's an encoding\format issue.
Or
Rename "Logo Retina.png" to "LogoRetina.png".
~Good luck~
It also happens when you have multiple images with the same name in TARGET->Build Phases->Copy Bundle Resources. To resolve it -
Search for the image name that you are getting an error for in Build
Phases search bar at the top.
If you get multiple results in Copy Bundle Resources for the search query, just remove others from it by clicking on "-" sign. Make sure you have same images for the multiple results. If not you have to rename the actual files of other entries.
Just compile your code. You are good to go.
Hope it works for you.
Just open image in Preview app and export it as png file. Replace old image with new in Xcode.
Honestly I have had this problem intermittantly many times and clean then rebuild has fixed it.
Since the answers here are either not useful at all or quite complicated I want to add mine:
The error means that Xcode can not find the file, whether it is in the project's folder or not.
If you still need that image, what you can do is to open a Finder view and navigate to your project. Drag the file Xcode was complaining about into the project an uncheck 'Copy to folder'.
if you do not need the file anymore, on the left side of Xcode, find the file, it will be shown in red, simply tap on it and then delete / backspace
Hope that helps some people :)
To solve the issue copy the Image name. Then Filter it (Build Phases -> Filter textfield). Finally I removed it.
Also check that you are not naming the images with only a number like "0.png" I change it to "tuts0.png" and it worked.
I just had this error and honestly I think it was being caused by another error. I had an issue with my Crashlytics framework and I'm convinced it was effect some unassociated pngs with the copypng error. I replaced the Crashlytics.framework with a fresh version and viola, all errors were gone.
Don't ask me how this works, I'm just posting this in case someone else can benefit from it.
I wasn't able to fix this problem. So i delete and reinstalled xcode, this helped for me.
Fixed it by reverting to my old product name (in "Build settings"). Seems that the new product name confused the images path.
I have the same issue with resources. The problem was that I have copied target from another one and just forget to uncheck checkbox at target membership window.
i face this problem and this solution is working form me
you need to remove any reference for that image
Build Phases -> Copy Bundle Resources
after that clean and build and problem will be fixed
I had accidentally deleted the file from the location which was linked to x-code project. I had not copied the file in my xcode project but just the path. Hope it helps someone.
I've had similar issues with pngcrush /libpng crashing with PNGs (checksum errors / freeing object that have been freed etc). These could be reproduced on the command line so I recreated the PNGs, even converted them to other formats then back but the errors persisted. In my case Xcode then rejected the resulting archive for not having iPhone 5 support (as pngcrush killed the Default-568h#2x.png image). The above fix resolved this.
For those who are struggling with this error while building Cordova app.
Please keep the following point in consideration as it may lead to this error.
The images should be tagged as "resource-file" and not as "source-file" in plugin.xml of your Cordova plugin as the former includes the images in "Copy Bundle Resources" (under Build Phase) and the latter to "Compile Sources" of your equivalent xcode project of cordova app.
If non of above answers can fix your problem, try look into Xcode project where you reference your image file, I happened to referenced twice to the same png file. Once I delete one the reference, it worked. The error went away. Good luck.
It also happens when you have multiple images with the same name in TARGET->Build Phases->Copy Bundle Resources. To resolve it -
Search for the image name that you are getting an error for in Build Phases search bar at the top.
If you get multiple results in Copy Bundle Resources for the search query, just remove others from it by clicking on "-" sign. Make sure you have same images for the multiple results. If not you have to rename the actual files of other entries.
clean cmd+option+shift+k and Build Project...
work well for me....

Resources