Not able to archive Swift app and upload to the app store without "Your app can't contain standalone executables or libraries" error - swift

After trying to investigate this, I've seen this in a few other places, namely the Flurry Analytics framework, but their solutions don't seem to apply to my issue.
The error is referencing a file with my app's name and a .o extension
My build log shows it twice under two "CompileSwift normal arm64" sections:
"/Users/Admin/Library/Developer/Xcode/DerivedData/App_Name-fglhmhjmskcjuedbcbpinrnjxaey/Build/Intermediates.noindex/ArchiveIntermediates/App
Name/IntermediateBuildFilesPath/App Name.build/Release-iphoneos/App
Name.build/Objects-normal/arm64/AppNamePrefs.o" -o
Searching for anything .o in Xcode turns up nothing, but maybe I could navigate to what it shows in the build log, but I don't know how that would solve my issue, aside from attempting to delete it, but I'm not sure if it's the right approach because I have no idea what this file is for.

Related

Xcode Build Fails on Archive, but the Build does not Fail on Run with ResearchKit

What I am trying to achieve is to archive the app and still have a working consent form on the app.
Although this piece of code is deprecated and says to use ORKInstructionStep I haven't found anywhere how to use ORKInstructionStep instead of ORKVisualConsentStep.
Whenever I try to Archive the app I keep getting this problem. Still, I also can't remove the ORKVisualConsentStep because I haven't been able to find anywhere how to add the consentDocument otherwise.
I've looked at so many other tutorials and all of them use the ORKVisualConsentStep and haven't seen anyone that has had this problem show how to still keep the consent form working. I can get the app running on a phone but I can't get it to archive so not entirely sure what is going on.
Any insight would be beneficial thank you
If you don't know how to added all frameworks, libraries and Embedded contents then you can find shown below what I shared and you can remove it. Please check after your local files remove it.
I managed to fix the problem by using cocoapods to install the ResearchKit framework instead of dragging ResearchKit into my project. It now archives however I had to comment out this line of code instructionStep.imageContentMode = .scaleAspectFit for my survey tasks.

Packing an Actionscript (Flash Builder) application for iPhone

Recently I tried to build a flash application in Flash Builder, and I wanted to export it to my iPhone. I have gone through all the required steps in order to certify my application.
Now, with all that done, all that was left to be done is building the ".ipa" file in Flash Builder. Now, this gives the following error:
'Launching TestGame' has encountered a problem.
Error occurred while packaging the application:
NotBefore: Wed Apr 11 18:52:40 CEST 2012
Google didn't give me a decent answer, nor does Adobe's information regarding mobile application development. All I can think off, is that I can't build the application before that date. That's ridiculous, I can't imagine a certain check like that.
I'm pretty sure my ".p12" key file is generated correctly.
Is anyone else familiar with this error? Please, be so kind to guide me in the right direction.
Kind regards,
Matthias.
The error occurs because the compiler didn't find the files under the corresponding directory such as debug-bin or release-bin folder. (explains from: http://forums.adobe.com/thread/893772)
For example, if you are doing a debug-build, and you didn't select the project option: copy non-embeded files to the output folder. And debug-build needs some files such as icons files under the debug-bin folder, and it couldn't find it.
Solution: select project compiling option: the copy non-embeded file to the output folder.
Try again, if still not you will need to try the ADT build to get more details http://help.adobe.com/en_US/air/build/WS901d38e593cd1bac35eb7b4e12cddc5fbbb-8000.html
I suggest compiling from command line. I'd ported an AIR app to iOS and compiled using adt dirrectly (without FB or whatever), and there were more meanful messages then yours. Take a look at the manual on how to build ipa wit adt. The other advise is to check your iPhone node in app.xml (take a look here) and icons.
The "error" was thrown because the certificate wasn't valid yet. It became valid on the date shown above.
You could also fix the manifest file in the iOS developers center.
This problem does come up more often than needed. The error reporting is lacking distinctions but is also difficult to asses since there can be many factors causing this error. If it was one factor or even just a few then it would most likely let you know.
A great way to ensure that the error reporting can do its job and tell you where the problem is is to check your error log. It will tell you at least a few of the places that threw the block.
If you are unable to read those strange glyphs then just ensure that all your resources are being packaged. This does mean a little time of list checking but it is well worth it, for the errors and to get rid of development junk.
The first step in the asset list check is to go through each part of your Assets class (flash builder reference). If you do not have a direct Assets class then you may want to make one and move all of your asset calls to that one class - since it will save you time if this happens again.
Your Assets class is not the same as your Assets folder. Your folder is where the files are stored - i.e. images, bitmaps, sounds, etc. Your Assets class is what categorizes and assigns references to each individual file.
Go through your Assets class to ensure that each of those files exist in the folder as well. Then go to the Project menu (top near Navigate and Search) and select Clean. Either clean all your projects or check the current one. Once this is done you need to click on your Assets Folder (right click or highlight and hit edit or whatever), and select Refresh. This will check that all the files are still there and get rid of/update them.
If none of this throws an error -red X- or other errors then you need to check your project .xml file. This may take you some time to ensure that all of your add on packages and details are correct. Make sure you have the correct:
at the top and it matches your current air release.
Make sure all the filenames, names, ids, version numbers, aspect ratios, fullscreen, visible, icons, extensionIDs, and everything else are not only correct but actually there. Most of these statements should have something written and not be blank. If they are blank find out what to put in.
Ensure that you have the proper icon file extension. If it says assets/icon48.png and the icon48.png is actually in assets/pictures/images/icons/toomanyfilesextensions/whatever/icon48.png
you need to fix that link.
The last thing that you will need to check is when you want to either Release Build or Debug. You need to make sure that all assets are checked and selected.
Go to Project - Properties.
then select ActionScript Build Path.
Click the Native Extensions tab and see if there are any red X's. If there are tap the little arrow beside them and see what the matter it. Add the correct ANE or get rid of it or whatever you need to do.
Then in the same menu go to the left and select ActionScript Build Packaging. A little arrow should be beside that one too. Tap the arrow and it will open to Apple iOS, BlackBerry, Gooogle and whatever else you have (probably nothing more). Select the OS your want to use, lets say Apple, and you will have 4 tabs pop up. Make sure you have the correct certificates selected. If you have none or are confused about this you need to spend some time on Google.
The biggest one for this error is under the Package Contents tab. Most people miss this!
Open the tab and see if anything is not checked. There will 99.99% be something or many of them not checked if you are getting this error. Just check them all and you can figure out what you need and don't need later. Some of them will be listed because you just threw in a bunch of ANEs and .SWFs to have some awesome app. Those add on packages will throw in unnecessary contents into this package. That is fine and don't worry until you want to be picky. Just make sure they are all selected and hit Apply and Ok.
That's it. You should have a working Release Build if you did everything else correct and this error should be easy from now on (but time wasting).
You may get a 'slip' error now, but that is another story. But that is a great sign because you are getting closer to that stupid mistake that we all make: the elusive spelling mistake.

Xcode won't build to device

This problem has been KILLING me. I've been working on this app for 8 Months, and I am so close to finishing, I just can't seem to build for device. Building for the simulator works fine, but device always gives me the SAME 2 errors.
The 1st Error:
"Instruction requires a CPU feature not currently enabled"
From googling, I've found this probably means I'm not linking a binary I should be, but I'm not sure.
The 2nd Error:
If you can't read it, it says: Generating JWFNS.app.dSYM ... error: unable to open executable '/Users/ajr1188/Library/Developer/Xcode/DerivedData/JWFNS-azshgysfabycfagnebotitpcyaww/Build/Products/Debug-iphoneos/JWFNS.app/JWFNS'
This is the big one. I cannot seem to build the .app.dSYM file properly. I went in and deleted the build folder, I looked at EVERY stackoverflow question I could find and tried changing any random thing mentioned in another question, but all of it is to no avail. I'm so suck right now. AHH. PLEASE. Any help would be so appreciated!
Maybe your project has become hopelessly corrupted. One thing to try is to start a brand new project and copy/import all your sources/assets into the new project to see if that fixes the problem.
Another less nuclear (but perhaps more time consuming) approach is to binary search the build. Exclude absolutely everything except main.m and see if that fixes the problem. If it does, include half your sources, and buid again....repeat, trying to narrow in on the problem spot. Maybe a file or group of files has received special build settings that don't belong there.
I've had very similar problems, I cant remember the exact error message but it was very similar. Are you able to make a new project that will run on your device?
if so (and I know this sounds bad but it's worth a try) Create a new project and simply copy all the code and resources across and see if it still works. If it doesn't then there is something wrong with you code and you can continue trying to isolate the problem from there.
Hope this is helpful.
check the frameworks you link to. there's a chance that you linked a framework (say quartz) of osx, instead of ios.
Answering in detail is probably going to take looking at your target settings. But it looks like you may be building for the wrong architecture. (It doesn't link, so there is no .dSYM symbol file.) For example, if you have only recently built for device, you probably created your project under an older Xcode, and it may not have the arm6/arm7 settings right.
To check, show the Build Settings for your target (not the project), and filter on Architecture.
Make sure that in build settings the architectures are armv6 and armv7. Also make sure that in .plist file, the "Application requires iPhone environment" is TRUE. Delete "Required device capabilities" in the .plist if present.

iOS code signing fails: "A sealed resource is missing or invalid."

I have been with this problem already 8 hours unable to solve it.
Whats Cool JLD$ codesign -vvvv build/Distribution-iphoneos/Whats\ cool\?.app
build/Distribution-iphoneos/Whats cool?.app: a sealed resource is missing or invalid
/Users/JLD/Desktop/iOS Development/Whats Cool/build/Distribution-iphoneos/Whats
cool?.app/Whats cool?: resource modified
I have tried the solutions posted on all these threads to no avail:
https://discussions.apple.com/thread/1590980
https://discussions.apple.com/message/9167082
http://www.iphonedevsdk.com/forum/iphone-sdk-development/2256-application-failed-codesign-verification.html
https://forums.macrumors.com/threads/entitlements-plist.584209/
How to solve "Application failed codesign verification" when uploading to iTunes Connect?
I even tried recreating the whole project again redoing all the IB connections and nothing works! It builds everything, but it is unable to code sign it! So I'm unable to upload it through the AppLoader.
I am doing all these following the instructions found at the provisioning profile on the Distribute application page.
https://developer.apple.com/ios/manage/distribution/index.action
I even tried building from another Mac. I have my distribution profile and my distribution certificate both set to WildCard. But it still doesn't work. I made a new app under a different name with another Bundle ID to no avail. I don't know what to try anymore!
Thank you future problem solver! I know you are there so come to my aid, I'll thank you forever!
UPDATE: I tried to make the new project from scratch. Copying the source code and remaking all the connections on IB to no avail. I even followed this link with instructions:
http://techiechok.com/2009/03/30/resolving-iphone-code-signing-error/
Unsuccessful. I don't know what else to do. I'm even considering using one technical incident to solve this problem once and for all.
I just experienced this error trying to sign an archive with Xcode 4 on Lion. The problem turned out to be related to the fact that the archive had been zipped on one machine and transported to another --- the zip utility did not support symbolic links, and the app code signature uses a symlink inside the bundle, so the unzipped archive was invalid.
Possible solutions are:
Use the Finder's contextual (ctrl-click/right-click) menu and choose "Compress" to create the zip file, or:
Use the command line version of zip and provide it with the -y argument to preserve symbolic links.
This isn't a specific answer I'm afraid, but something you may not have thought about.
From your command line snippet, it looks like you're code signing your app bundle after it's been built. Are you moving the bundle (.app folder or maybe an IPA or ZIP file) from another machine, or from another drive? I've had problems with moving app bundles between file systems that don't support symbolic links properly. Are you using a network drive, or have a local drive that's not formatted for Mac OS.
Solved. The problem was a '?' character on the product name. Shouldn't be like that but that's how it is. Nowhere apple says that that makes a codesign verification issue.
Apple's new APFS file system has some bugs to process unicode characters and it is causing the issue.
Moving the whole project to the legacy MacOS Extended volume and archiving again solved the issue.
Another problem could be your app contains image file name with none English characters in your app. Such as 'ş ç ğ'. If you remove those images or change the file name it will proceed.
I passed days on this problem, for me it's because the name of the application contains arabic caracters :(, So apple on xcode 12 doesn't accept arabic caracters ? on xcode 10 i publish without any problem
it's very complicated to be a developper on ios
In my case, I got that error because the disk image I created to distribute my app ran out of space and ditto did not copy all files from the build folder to the disk image. As the script I used generates so much noise, I missed the warning of ditto that it ran out of space in the target disk image. Unfortunately, ditto should have aborted the whole procedure, instead of burying the warning into a myriad of other paths of smaller files that it managed to copy.

Couldn't install Ad-Hoc in iPhone 3.0 OS?

I've created an Ad-Hoc of my iphone app, but i couldnt install it on my iPhone (upgraded to iPhone OS 3.0). And also i created new provisioning file and plist file but it still shows error:
The application was not installed on th iPhone "Unknown" because an unknown error occured (0xE8008017)
Please send me a solution..........
I saw the 0xE8008017 when dragging a .ipa file that I created into iTunes, but NOT when dragging the .app folder directly into iTunes.
Update: There seem to be lots of reasons why this can occur:
1) You should use "ditto" instead of "zip" to create the .ipa file, as that is what gets used if you use Finder and choose "Compress":
ditto -c -k --sequesterRsrc Folder OutputFile.ipa
2) This link has a comment explaining the error is due to stale resources, i.e. you have a file in the .app bundle that has not been code signed. Check that all the files in your binary have a corresponding entry in the CodeResources file (except those explicitly excluded in ResourceRules.plist).
If you are trying to debug this problem you should check if dragging the .app folder into iTunes directly works. If it does, look for a problem with your creation of the .ipa file.
On another occasion when I changed my Info.plist 'Bundle identifier' from com.domain.appname to appid.com.domain.appname it made iTunes report a 0xE8008019 error instead of the 0xE8008017 one (importing the .app still worked directly). I think using appid.com.domain.appname in the Info.plist is wrong, but I mention it here in case somebody is searching for that error code!
I solved one 0xE8008017 error by renaming one of my resources. It was a PNG file with the danish letter 'ø' in it.
I've seen one other report about 0xE8008017 where the fix was about a colon in one of the resource filenames.
I am getting the same error.
I looked for the names of the files in the resources.
But the names have only alphabets a-z and digits 1-9.
Only at couple of places, hyphen - and underscore _ have been used.
I don't think that can cause the issue.
What else can be the reason?
This is a generic error, and often the real error will be reported to the OS X console.
Fire up the Console app (should be in Applications, or use Spotlight to find it automatically), and scroll to the bottom. Look at the timestamps, and see if there's a detailed message.
I've several times used this to fix completely different bugs which use the same error message.
(sadly, Apple is very bad at writing error messages - you often find they didn't bother to write new text for the popup error, and re-use old text, so that you have to read the Console to find out the "real" error)
Alternative answer (I had this problem recently):
"Upgrade to iTunes 9"
A bunch of these "missing" error messages appear to have been added in iTunes v9, including some of the most common ones. I guess Apple just forgot to include them first time around...