Corona Enterprise Xcode proj runs in simulator, but fails to archive "app_sign cannot resign <myapp>" - xcode

I'm at the point where I'm ready to build, but when I try to archive the project I get the following error in xcode:
app_sign cannot resign
/Users/me/Library/Developer/Xcode/DerivedData/My-App-bzgdaitstcabzpaiygqfnluetfhk/Build/Intermediates/ArchiveIntermediates/App/InstallationBuildProductsLocation/Applications/My-App.app/My
App. Please remove and then build
Does anyone know why this is happening?
In build settings I've tried leaving the code signing identity blank, and tried it with the correct distribution profile.
I've tried with and without the provisioning profile specified.
I've tried deleting the whole file in my DerivedData folder.
It would seem that this is the line in question that causes the problem:
"$TOOL_PATH" app_sign sign "$SHARED_RESOURCE_DIR/developerkey.cert"
"$CORONA_RESOURCE_CAR_PATH/resource.car" "$CORONA_EXECUTABLE_PATH"
little
But I don't know enough about what it's doing here to think of the solution. If I build the sample app that comes with Corona Enterprise still builds fine, but my own app still fails.

It turned out that the problem was to do with the xcode.proj file itself. Not sure what the cause was, it seemed to be keeping a reference to a file which no longer existed, rather than the new build.
I made a new project, copied all of my own source files across but left the new proj files in, and then it built successfully.

Related

ResearchKit.framework error: Image not found

I have an Objective-C app I wrote roughly 12 months ago, with the iOS Deployment target set to 12.1 . I added the ResearchKit framework to it, and during the time of development the app was working fine. What I do remember is that it only worked on an actual device and not on the simulator.
A year later Im back to make changes, using Xcode 11, and am now getting a familiar error, solution to which I cannot figure out. This is both on real device and simulator.
I have done all that is required to add the library. See attached images below:
TARGETS -> General Tab
TARGETS -> Build Phases
ERROR
Attempting to run on an iOS 12 device fails too. Is there something I'm missing?
I ended up removing the pre-build Research.framework and adding the full Project instead:
Remove the Pre-built ResearchKit.framework file, select Move to Trash when prompted.
Make sure the ResearchKit project is closed (if it's open it wont be added as a project but as a file)
Drag and drop the ResearchKit.xcodeproj project file, into destination project. After this make sure the ResearchKit project has its files under it.
Go to Main project file of your project (not ResearchKit) and select your Target.
Make sure ResearchKit.framework is listed under Embed Frameworks. If not, then add it by selecting the + button and selecting it from the list. If it is not on that list then build the ResearchKit project to create the .framework file.
Under the same Target, go to Build Phases, and make sure ResearchKit.Framework is added under Link Binary with Libraries, and also under Embed Frameworks. If not then add it where absent.
Build and run.
There may be better ways to resolve the issue, but for now this works for me to run the App. App now runs on simulator. However, an initial build takes up-to a minute because the ResearchKit project it pretty big.
Update: I later figured out that the reason why I was encountering the 'Image not found' error is that I was trying to run on simulator while the ResearchKit framework had been build to target arm64 (real device). You will have the same issue the other way around (attempting to run on device-arm64 while app was build for simulator).
So how do the above steps fix this? That fixes the issue because by having the ResearchKit project files included you get to build everything for the currently selected architecture, whether device, or simulator. Happy coding.

Xcode not recognizing directory structure

I've recently downloaded GPUImage which is made up of one large directory containing the framework and various sample projects within it. Usually when I run a project it's simply one folder containing the project and everything works fine. However, when I run one of the sample projects within GPUImage, it's not recognizing the provisioning profile. When I move the sample project out of the GPUImage folder on its own, the provisioning profile error goes away, but then I get a bunch of new errors about it not being able to find the framework and other things (I messed around with moving stuff around but it turned into a disaster).
I'm wondering, is there a path somewhere that I need to change to get Xcode to work like normal when running a sample project from within the GPUImage directory so I don't get the provisioning profile error?
The problem was, somewhere along the line I deleted my team provisioning profile! Didn't realize it, but I was also unable to run any other sample projects that weren't created by me.

Renaming a Project Causing Provisioning Erros

I did a major restructuring of my app, and decided the easiest way to do this, was to create a new project with a new name. After everything was working, I went in and renamed the project but now I get "A valid provisioning profile for this executable was not found."
I went into my app-info.plist and ensured that my CFBundleIdentifier is the same. I confirmed that the Project Name is the same, and that the built app is the same. I confirmed in my Build Settings that it shows my Distribution Profile.
This is the first time I've completely rewritten the app this way, is there something I've missed?
Have you tried cleaning both projects? (cmd+shift+k)

Xcode fails without specifying and errors

All of a sudden my project fails to build in Xcode. If I look at the log I see all the needed dependencies being built, and then I get a strange error:
Verify final result code for the complete build operation
Build operation failed without specifying any errors.
Individual build tasks may have failed for unknown reasons.
I removed my code directory and replaced it with a backup, did a clean, tried building all the other components separately (they succeed) - nothing works. I tried a command line build, same issue.
There were only a few hits on google for this error, none offered any useful advice.
Can anyone please help?
Update: When I run the command line build, I see the following error:
2012-05-25 08:55:53.830 xcodebuild[3358:4203] No recorder, buildTask: <Xcode3BuildTask: 0x400f35e60:'ProcessPCH MyProject-Prefix.pch':REfc(32370056113422336):deps=0:phaseNum=4>
I checked the output of xcodebuild and it is returning '65'.
I thought there might be a problem with the MyProject-Previx.pch file, so I shut off "Precompile Prefix Header", and now I get the same error with a different file:
2012-05-25 09:15:11.784 xcodebuild[3882:3703] No recorder, buildTask: <Xcode3BuildTask: 0x40048ab60:'CompileC HelperRoutines.m':REfc(33777199068741632):deps=0:phaseNum=4>
Build operation failed without specifying any errors. Individual build
tasks may have failed for unknown reasons. One possible cause is if
there are too many (possibly zombie) processes; in this case,
rebooting may fix the problem. Some individual build task failures (up
to 12) may be listed below.
I've run into this problem consistently recently while running Xcode 9.0 Beta 3 and Xcode 8.3.3.
The fix is to delete ALL in the Derived Data folder. It then seems to work again.
rm -rf ~/Library/Developer/Xcode/DerivedData
NOTE: just cleaning the build or deleting the current build folder for a project does not seem to help.
Hope this helps :)
I was hitting this error and it infuriated me for an hour or so. The answer below helped me out a lot: essentially your machine has a ton of running processes, XCode can't handle it, and rebooting your machine is the best answer.
https://stackoverflow.com/a/13183522/1863655
I looked around for a bit and the only one that worked for me was shortening my project folder name.
All other tries: restarting, recloning, deleting derived data, etc. didn't work. The only thing that worked was making the project folder name shorter.
I also encountered same error. I was edited .pch (Prefix Header) file. Then I started getting this strange error.
Then I removed all editions which I made in .PCH.
Then I quit my Xcode.
When I restarted Xcode this strange error was gone.
Hope this will work for you also.
Best luck Buddy (y)
Build operation failed without specifying any errors. Individual build tasks may have failed for unknown reasons.
One possible cause is if there are too many (possibly zombie) processes; in this case, rebooting may fix the problem.
Some individual build task failures (up to 12) may be listed below.
This happens occur when the total path length is too long.
change the folder name or location of directory, shorter then before.
Happy 2019, everyone, but sad to say this can still happen in Xcode 10.2.
I had four projects open in Xcode but only one failed in this way. I tried a main menu > Product > Clean Build Folder. The little progress spinner started up and 5 minutes later was still spinning. Hmmmm.
So I quit Xcode and in Terminal did a cd ~/Library/Developer/Xcode/DerivedData. Although ls -alww showed only one subfolder named after each of my other projects, as expected, there were five subfolders whose name began with the name of the problem project. I deleted all of them
rm -R ProblemProjectName-*
and relaunched Xcode. Problem solved.
Mine gave this error sometimes, also LLVM failed with exit code 1 and clang failed with exit code 255, at different code locations each time. I just had to reboot (OS X 10.7, Xcode 4.5).
I rebooted, no luck. Then I noticed that when I relaunched XCode, one of my tabs was loaded with no file in it. I figured out what file I was editing in it, opened it, saved it and then I was able to build.
None of these answers worked for me on XCode 5.
Luckily, I'm still only testing XCode 5 - I kept XCode 4 around.
XCode 5 simply won't build one of my two projects, claiming that my libraries aren't built with the right settings, and I keep running into the error described on this page on the other one... so I'm sticking with XCode 4, which builds both of my projects perfectly well.
If you are experiencing this issue on XCode 5, consider "reverting to XCode 4" as another strategy.
Overall the idea that repeatedly running a program, XCode or not, degrades your system to the point where you have to reboot does not fill me with confidence in that program.
With Xcode 5.0.0, this error was caused after an update to the CLI tools.
Updating to Xcode 5.0.1 and installing all the required components again still didn't fix the error. However, 5.0.1 was kind enough to actually emit an error that was useful.
/bin/mkdir -p /Users/xxx/Documents/XCode/SampleApp/bin/SampleAppDebug.app/Contents
error: (null)
This lead me to look at the bin folder, and find out that the 5.0.0 build with broken CLI tools had made a symlink in bin/ to the derived information folder with SampleAppDebug.app, which for some reason it could not write to.
I manually removed all contents of the bin/ folder and rebuilt without errors.
I faced same problem. I have change my System time.I delete file "/Users/YOURNAME/Library/Developer/Xcode/DerivedData/ModuleCache/YOURBUNDLEID/UIKit.pcm". Then it's work fine for me. Try this.
I added into the Framework search paths the header file location.... removing this from the top level project settings fixed the issue for me.
Change at your peril.
The only workaround, that works for me - push your code to git repo and clone it to new location.
I highly recommend to reclone your repo, because you'll deal with some random problems if you prefer rebooting/turning off and onXcode.
did you set "Perform Single-Object Prelink" to Yes?
try turn it off.
i had the similar problem. i have tons of files in a static library. reducing the number of files or setting "Perform Single-Object Prelink" to NO solved my problem.
Same error and following didn't work for me for Xcode 6.3.2 on Mac OS X Yosemite 10.10.3:
Git discarded changes to last successful build point
Creation of new fresh project from scratch from a builtin template (though I cannot recall whether it built successfully or not)
Restart of Xcode
System Reboot
and the following worked:
I faced the problem in the morning and it got resolved in the evening with a couple of Xcode restarts and System reboots and creation of new project. So, I'm not sure what really triggered.
I faced the same problem today. Cleaning the DerivedData and cloning the project somewhere else didn't help. What fixed my problem was repairing the volume from the Disk Utility app and removal of all Xcode plugins.
I have encountered same issue without having any code changes for my project running on Xcode 9.2. It looks like if you have some run scripts or external build systems attached to the project, this might cause an issue. Try committing or discarding changes and build again. If it still persist, delete local repo and clone again. Also maintain smaller folder names for project location.
Same issue when added watchOS target inside iOS app, using Xcode 11.1 with SwiftUI:
Go to menu Xcode / Preferences / Locations
Open Derived Data folder in Finder clicking on the arrow next to /Users/yourUserName/Library/Developer/Xcode/DerivedData
Locate your app Derived Data folder and delete it
Menu Product / Clean Build Folder
You should be able to compile again.
I know this is super late to answer but I'm answering since none of the above solutions worked.
For me restarting, clean building, deleting derived data nothing worked.
Because the issue was not due to any zombie objects or something like that.
I'm using Xcode 11. I think it's an Xcode bug that sometimes errors are not shown in the issue navigator. But don't worry check the build report in Report navigator(The last tab in project navigator: the one that looks like a comment box with lines in it. or simply cmd + 9).
Click the relevant build and resolve the issue, mine was missing file in pods directory.
just try to rename the folder name of the project. it did the trick for me
I had this same problem, however the accepted solution did not work for me, what worked was:
deleting .workspace file
deleting Podfile.lock file
deleting the Pods folder
pod deintegrate ; pod install
For me it was fixed by changing to the new build system(in File -> Project settings)
I have Xcode 11.7

Xcode error: failed to launch

I have a Mac app I have written to support iCloud. However, I get this when trying to run the app:
error: failed to launch /Users/padsoftware/Library/Developer/Xcode/DerivedData/Scrawl-heofvoywsunchdhjowxkvkoiqvan/Build/Products/Release/Scrawl.app/Contents/MacOS/Scrawl
The odd thing is that this appears for all of my Mac apps, with or without iCloud, with or without sandboxing, with or without entitlements, or ever with or without code signing. Any idea on how to fix this?
I had this problem too. For me, it was a code sign issue. Make sure you're signing with developer, not distribution.
I encounter this problem every once in a while. Like the others mentioned, these are the steps I take:
1. Clean (Shift+Cmd+K) ------
Removes all the product files, as well as any object files (.o files) or other intermediate files created during the build process (Apple Doc)
2. Navigate to "~/Library/Developer/Xcode/DerivedData", delete folder for app in question ------
Derived data consists of project indexes, logs, and build products including intermediate files (Apple Doc)
3. Restart Xcode
One or the other usually fixes it. I haven't had to change Code Signing settings, but that would be my next step. Wouldn't re-install Xcode unless absolutely necessary.
I had such problem also and restarting Xcode Fixed the issue .
even it happened after renaming the application ....
Under Build Settings make sure you are signing with a valid developer profile for debug and release.
Then Build for Testing
That fixed the problem.
"Product"->"Scheme"->"New Scheme" fixed my problem
Just in case it helps anyone else, my problem was fixed by rebooting my iPhone (4S). Then the app suddenly appeared on the Springboard (it was like it was already installed but somehow hidden).
...I did all the other steps (restart Xcode, clean project, delete derived data) but none of it worked this time.
What worked for me... I was already code signed as developer so I cleaned my code
menu bar -> Product -> Clean
That still didn't fix it but I noticed that I was getting handshake error, I had a large amount of apps already running on my phone (~15-20) so I exited out of all of them and retried. It worked after exiting out of all other apps.

Resources