xCode 6.1| stdlib-tool failed with exit code - error-handling

for some reason I can't seems to run any project on my device.
For the experiment, I've created a new empty blank project named it: emptyApp.
I've deleted any certificate I had in Apple Developer webSite and start from scratch.
I've created developer certificate and download it -> save it to keychain
New app ID for my emptyApp, double checked the bundle ID.
New provision Profile for my app and download it with my device enabled inside the certificate.
So i've got a new project, with all the right settings and i'm getting this error:
*** Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'Couldn't posix_spawn: error 1'
Command
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/swift-stdlib-tool failed with exit code 6
Now I can Kill myself, but why i'm keep getting this error ?
I've did everything according to the book, and it's amazing I can't seems to run an empty project on my device (iPhone 6 plus).
any suggestion how to fix this error?

I had this problem after changing my apple id. Here is what i did.
Go to xcode -> select your project -> Build Phases -> open "Compile Sources" and "Copy Bundle Resources". Check if any files are listed in red color. If so , just delete it. Then clean and run.
You might have to restart (idk why but it worked for me).
Hope this helps.

In my case i changed my apple id and i had to redo the whole generating dev, sign in etc certificates. Its finally working on my device. It used to only work on the simulator

Code 6 means Code Sign error (system file).
the solution is to bring this file from backup or reinstall your current OSX.

Just restart your mac, that worked for me.

Related

App get Rejected: crashes on launch , but worked fine for me on all devices as well

My app is for the iPhone only .And it is working fine on all devices but when submitted the app it get rejected by apple by saying .......
On 1st time submission
We found your app crashed on launch so we were unable to review it.
Please revise your app and test it on a device to ensure it will launch without crashing, and that it runs as expected, before resubmitting.
this the crash report link please
this is the crash report
crash report
on second submission it get rejected they says
Thank you for your resubmission. However, we were still unable to review your app, as it crashed on launch. We have attached detailed crash logs to help troubleshoot this issue.
Specifically, upon review we found the application will shortly crash after launch.
they send crash report
on second time submission
on second time submission
I didn't get where i am doing wrong ,please check this ,Thanks in advance
I also try Bhavin step to find the crash location but terminal show's me like that
I found the solution. We can just directly drag and drop the crash-report on the device log.
Then it will convert the crash report into readable format.
STEPS:
Attach your device to mac.
Open Xcode
Goto window from menu bar
Click on devices like this
Now, drag and drop your crash report you received from apple. It will symbolicate it and show you in readable format. If the file extension is .txt, change it to ".crash".
Follow these steps :
Get the .ipa file that you submitted to the app store.
Rename the extention .ipa with .zip , extract it. You'll get a Payload Folder which contains .app file.
Create a folder with this .app file and crash log file.
Now, open terminal application and go to the folder created in above step (using cd command).
Run this magic line :
atos -arch armv7 -o YourAppName.app/YourAppName MEMORY_LOCATION_OF_CRASH
Where, MEMORY_LOCATION_OF_CRASH = location where your app crashed as
per the report.
It'll give you the exact line, method name which resulted in crash.
If you test your app and it works fine but Apple keeps rejecting it then you need to test it on release mode not debug mode as follows:
Edit scheme > Run > Build configuration > release
Hope this helps someone because I came across this issue and it took me too long to sort it out!

Error when enabling auto login of macOS app using a helper

I'm trying to have my app auto launch on login following Tim's tutorial: http://blog.timschroeder.net/2012/07/03/the-launch-at-login-sandbox-project/
I followed the instructions to the letter but I'm getting an error when I re-login to my computer as follows:
Jan 10 12:55:01 pc61 com.apple.xpc.launchd[1] (com.myApp.macgap.helper[25725]): Could not resolve CFBundleIdentifier specified by service: -10814: com.myApp.macgap.helper
Jan 10 12:55:01 pc61 com.apple.xpc.launchd[1] (com.myApp.macgap.helper): Service only ran for 0 seconds. Pushing respawn out by 10 seconds.
To outline:
I have my main app called "myApp" (ID: com.myApp.macgap )
In that app I have a helper app with ID: com.myApp.macgap.helper
When you launch the main app and go to preferences, you have an option to enable auto login (to fit to the Apple compliance rules)
I log out of my computer, log back in and look at the console to see what's going on (that's how I get the code above)
Another point worth mentioning, is when I do "Show package content" on the app and double click the helper app, it does launch the main app...
It all comes down to how launchd and launchctl work, as already answered, the regular use case often can be solved by reinstalling the app and ensuring the app is inside the applications folder. But there's another case that #byb is talking about, when this happens on your development machine – this can be caused by invalid launchd configuration.
When you run SMLoginItemSetEnabled it registers your bundle identifier along with other information in launchd service. At some point later, when your app changes, gets cleaned, or something else happens to it, which gets picked up by launchd, launchd may disable that particular login item. Apparently, sometimes this doesn't go smoothly, and consecutive calls with SMLoginItemSetEnabled will not work as expected or the agent / helper app simply won't launch.
The first thing to try is simply changing the bundle identifier for your launcher. If this solves the issue, try figuring out what's wrong with the original. Run launchctl print-disabled "user/$(id -u)" to display disabled services and login item associations. If the output contains your troubling bundle identifier – you are in luck.
I didn't find a way of removing disabled services by name using launchctl and had to do it by manually editing configuration files. Because they system-owned, you won't be able to simply click and edit, instead launch Xcode as root and remove the necessary references.
sudo /Applications/Xcode.app/Contents/MacOS/Xcode "/private/var/db/com.apple.xpc.launchd/loginitems.$(id -u).plist"
sudo /Applications/Xcode.app/Contents/MacOS/Xcode "/private/var/db/com.apple.xpc.launchd/disabled.$(id -u).plist"
Restart, run launchctl print-disabled "user/$(id -u)" to confirm removed items are no longer in the list. Try SMLoginItemSetEnabled again, hopefully now it will work as expected.
I had the exact same problem just now, and while looking for a solution found this (unanswered) question.
At least in my case, this desired functionality of the worked fine when I copied the app (exported from Xcode as a dev-id signed .app) to a fresh OS X install/account without all my development stuff on it. Of course it must also be in /Applications, as stated in the tutorial referred to in the question.
I am not sure why this feature of the app did not work on my development machine. Perhaps the problem could be due to some form of conflict with all the other near-identical copies of my app I have on disk (I have an archive of different versions of the app, plus the copies Xcode stores itself), all with the same bundle id of course.
Hope this helps in one way or another!
I had the same problem, removing other copies of app except one in /Applications solved the problem for me. To remove .app files generated by Xcode you can run Product->Clean.
I was struggling with this for hours. I had many apps with auto login but a new one just did not want to work.
Strangely this worked on the development machine:
Build App as normal
Move it to Application directory
Clean Xcode (CMD+k)!!
Enable auto login in the app.
Logout Login
I accidentally noticed that the system started the app (it tries in every 10 sec) when I clean Xcode :)
I can't find the duplicate copy but did find you can remove the service:
In a terminal window:
launchctl remove com.annoying.service
As it was already stated if there are more then one copies of service bundle on the machine launchd cannot resolve which one must be started by bundle identifier.
What I would recommend to you is find all copies of your service and then remove not desired ones.
For this you need to run following Swift code (It works even in Swift Playground):
import Cocoa
let bundleId = "com.your.bundleId"
let paths = LSCopyApplicationURLsForBundleIdentifier(bundleId as CFString, nil)
print("Available service instances by bundle id: \(paths)")
In my case it produces:
Available service instances by bundle id:
Optional(Swift.Unmanaged<__ObjC.CFArray>(_value: <__NSArrayI 0x6000002234a0>(
file:///Applications/MyApp.app/Contents/Library/LoginItems/MyService.app/,
file:///Users/igor/Library/Developer/Xcode/Archives/2017-12-27/MyApp%2027-12-2017,%2016.06.xcarchive/Products/Applications/MyService.app/
)
))
So I easely identified copy to be removed:
file:///Users/igor/Library/Developer/Xcode/Archives/2017-12-27/MyApp%2027-12-2017,%2016.06.xcarchive/Products/Applications/MyService.app/
Hope it help.
Assuming that you followed Tim Schroeder's recipe at: http://blog.timschroeder.net/2012/07/03/the-launch-at-login-sandbox-project/ :
What actually ended up working for me, was, in Xcode, to change my main project's build number from 1 to 2. I also tried a build number of 1000 and that worked fine as well.
In Xcode, select your main project target. Then, select the 'General' tab. If you see your Build is set to 1, change it to 2 and then rebuild, redeploy and see if that resolves the issue for you.
This was probably one of the screwiest bugs I have run into, in a while.

calabash-android block in start_test_server_in_background

I've been trying to troubleshoot the issue I am having after I changed my computer with getting .apk file to run properly. I have read all the various solutions, but none worked so far.
I continue to get this error can can't figure out why:
Starting calabash-android console...
Loading /Users/sasaro/.rvm/rubies/ruby-2.1.2/lib/ruby/gems/2.1.0/gems/calabash-android-0.5.2/irbrc
Running irb...
irb(main):001:0> start_test_server_in_background
RuntimeError: App did not start
from /Users/sasaro/.rvm/rubies/ruby-2.1.2/lib/ruby/gems/2.1.0/gems/calabash-android-0.5.2/lib/calabash-android/operations.rb:609:in block in start_test_server_in_background'
from /Users/sasaro/.rvm/rubies/ruby-2.1.2/lib/ruby/gems/2.1.0/gems/retriable-1.3.3.1/lib/retriable/retriable.rb:31:inperform'
from /Users/sasaro/.rvm/rubies/ruby-2.1.2/lib/ruby/gems/2.1.0/gems/retriable-1.3.3.1/lib/retriable/retriable.rb:59:in retriable'
from /Users/sasaro/.rvm/rubies/ruby-2.1.2/lib/ruby/gems/2.1.0/gems/calabash-android-0.5.2/lib/calabash-android/operations.rb:608:instart_test_server_in_background'
from /Users/sasaro/.rvm/rubies/ruby-2.1.2/lib/ruby/gems/2.1.0/gems/calabash-android-0.5.2/lib/calabash-android/operations.rb:125:in start_test_server_in_background'
from (irb):1
from /Users/sasaro/.rvm/rubies/ruby-2.1.2/bin/irb:11:in'
What am I doing wrong? What am I not seeing? Is there a solution?
On Mac OS X 10.9.4. The app get's reinstalled when I run reinstall_apps, and when I run start_test_server_in_background I see the app open in the emulator. But, then I get the above error. The app is still usable and running in the emulator.
I'm new at calabash install so please be gentle and detailed if you have come across anything like this.
Try running this command:
calabash-android resign path/to/file.apk
Delete all Test_Server, delete android app from folder and copy new one after that
Try to:
calabash-android console app-debug.apk
irb> reinstall_apps
irb> start_test_server_in_background
it should start
and after that if it wont recognise server try calabash-android resign app-debug.apk
and calbash-android run app-debug.apk
Delete the test_server folder and resign your apk file
calabash-android resign path/to/file.apk
Then open the console
calabash-android console path/to/file.apk
and
reinstall app by typing
reinstall_apps
then start your app
start_test_server_in_background

Command /usr/bin/lipo failed with exit code 1 error

I have finally finished my app and I was getting ready to upload when this sudden error hit me and I have no idea what to do. I have checked other posts saying to change the code signing identity and I have done this but no luck. I tried every single option in the identity and no change. If anyone knows what is going on I would really appreciate it since I would simply just like to submit my app.
Here is what else it says in the erorr log:
/usr/bin/lipo: /Users/teddy/Library/Developer/Xcode/DerivedData/grocery_stores-dcyubhefhrcjhtcxbhldfpukdgdz/Build/Intermediates/grocery stores.build/Release-iphoneos/grocerystores.build/Objects-normal/armv7/grocery stores and /Users/teddy/Library/Developer/Xcode/DerivedData/grocery_stores-dcyubhefhrcjhtcxbhldfpukdgdz/Build/Intermediates/grocery stores.build/Release-iphoneos/grocery stores.build/Objects-normal/armv7/grocery stores have the same architectures (armv7) and can't be in the same fat output file
Command /usr/bin/lipo failed with exit code 1
I solved this issue by changing the value of the Valid Architecture found in Project > Build Settings > Architectures from the default "armv6 armv7" to "armv7". Hope this helps.
It's hard to see what exactly is happening without the command you are running. It looks to me like you are specifying the same input file twice, namely the arm7 version and lipo is telling you you can't add 2 arm7 versions of grocery stores to the universal file. Can you please enter the entire lipo command you are running? From the lipo man page:
-create
Take the input files (or file) and create one universal output file from them.
Do you possibly have the same file listed twice here?
Try changing your build target to a simulator build, clean and re-run.
In my case I used pods and oped projectFile instead of project workspace
In my case it was building a project on simulator in a release scheme, changed it to debug and it worked.

Application Loader: "Cannot proceed with delivery: an existing transporter instance is currently uploading this package"

I have been unable to overcome this error in Application Loader. I've quit, restarted, tried different computers - it's like the server is hung up on an op that I never initiated and it won't time out. Has anyone seen it before and beaten it?
Basically, you need to clear out the transport tokens. This can happen if you were to close out of Xcode while in the middle of submitting an app to iTunes Connect.
The token files now appear in the
Library/Caches/com.apple.amp.itmstransporter/UploadTokens/ subfolder of the given user's home directory. Which, honestly, is a better place for them anyway.
Delete any .token files in this directory.
--
If you are unable to find the .token files, this is because they are hidden in Finder. To hide/show hidden files in Finder, use the following Terminal command (TRUE = UNHIDE, FALSE = HIDE):
defaults write com.apple.finder AppleShowAllFiles TRUE;killall Finder
You need to clear out the transport tokens.
Open Terminal on your Mac, and paste:
rm /Users/<username>/Library/Caches/com.apple.amp.itmstransporter/UploadTokens/*.token
That should clear the stuck token. After this, try uploading the build again.
It might be because Xcode crashed as you were uploading your app. Either, all you need to do is delete the token files:
Open Terminal on your Mac, and paste:
rm ~/.itmstransporter/UploadTokens/*.token
That should clear it. If it still doesn't work (at this point you should try re-uploading your app), run that command on Terminal again, or manually go to...
/Users/<username>/.itmstransporter/UploadTokens/
...and delete all the .token files.
Hope that helps!
token was in here
/Users/(user_name)/Library/Caches/com.apple.amp.itmstransporter/UploadTokens/
Appreciated #WrightsCS 's answer It helps me to overcome Application Loader issue.
I would like to highlight one more thing here.
I proceed as per #WrightsCS answer and it resolved Application loader error:
Can not proceed with delivery: an existing transporter instance is currently uploading this package
But I found one more issue after removing all tokens from
/Users//.itmstransporter/UploadTokens/
I went to iTunesConnect and clicked on "My Apps", what I saw a message that "Can not connect... please contact Apple".
Here I don't know why it suddenly stops working!
I submitted the same build which was there on iTunesConnect for submission but it has shown as processing.
After submission of that build, iTunesConnect works fine! Also, I am able to see last uploaded build in a list for submission.
In my case (I am using OSX Catalina), I was not able to find the folder:
Library/Caches/com.apple.amp.itmstransporter/UploadTokens/
Under my user home directory (even when showing hidden files and folders)
but it seems my problem was a bit different and I just closed xCode completely (every xCode window opened) and reopened it again then I archived my project and uploaded it without any issues
maybe this could help someone else fix this issue
You need to clear out the upload tokens that are "stuck". To do this, open the tokens file found in /users//.itmstransporter/UploadTokens/. You should see one line of text at the top that refers to your current upload token. Simply delete this line and save the file. You should now be able to submit your app again.
Cheers