Internal API error - ios

Since few days, every time I try to run my app on my iPhone, I get get this error message "There was an internal API error".
I'm getting this error just with one application only on my iPhone. In fact, there's no problem with the same app on simulator or on my iPad. No problem too with other apps on my iPhone...
I've tried many things mentioned in those threads:
"There was an internal API error." while running an app on any iPhone/iPod-touch device
Xcode 4.4 - There was an internal API error
like remove/re-run the app, reboot iPhone/mac, clear cache, check plist, check profiles, check build settings, restore iPhone.
I'm using xCode 7.1.1 and iOS 7.1.2
Can someone point me on what I forget to check please ?

As per my work and research I got a solution. Since I was preparing the build in manual way from product. In that case my appname.app was copying in folder from which I have to create a build, that app was not copied properly and I prepared the build and installed in my device, in that case I got this error.
I again clean the Xcode prepare the build properly and installed it, it works.

When I rename my project and delete the special character "ç", xCode success to run the app on my iPhone. It might be related to xCode 7, before there was no problem for compiling.

I also had this problem. The way I solved it was by removing the special characters from the Product Name (in Build Settings) - I had an 'æ'. Indeed, it looks related to Xcode 7, because it used to work on previous versions of Xcode.

Related

Ios share extension does not work when installed by testflight but works installed by xcode

Installed with testflight the application does appear in the list of target applications to share an image with. When I select my application icon in the list I do get a normal Post dialog. After pressing "Post" in the dialog the application does open but nothing else happens.
When the same version of application is installed with xcode the shared file is delivered and the application displays the shared image.
I am not even sure how to debug such an issue as the application installed by testflight does not appear in the list of installed applications in xcode Devices window. Nothing that I can find in device logs either.
Please suggest any approach to troubleshooting the issue.
Update: I found a way to get much more detailed logs from device than the one provided by xcode's "Devices" window: deviceconsole utility. This gives at least some information to approach troubleshooting.
Update 1: It turns out that the application installed through ad hoc ipa file exported from the same archive that was submitted to testflight shows the same problem. This allows much quicker testing turn around.
This answer indicates that the problem can be caused by "Deployment Target" of extension set above the ios version of test device. I did try different combination of this setting in the application and extension, nothing helped thus far.
Update 2: I created code-level support request with apple for this issue and provided full source of the application to them. After few months of apathetic communications they concluded that the problem is due to a bug and suggested to create report Apple Bug Reporter. I did that and after another few months of more apathetic communications the issue was promptly closed on the basis that the application does not crash. Frustrating, but I still need to resolve the problem, now looks like without help from vendor.
If the deployment target is higher than the version number of the actual phone, your code cannot run. So the only choice is reducing the deployment target of the extension to be the same as the app.
I’d check if you have somehow set different deployment targets for debug and release.

Cannot Verify Client error 3000 with API problems [duplicate]

I am using xcode 7.1 and trying to upload my app to the app store directly through xcode. While uploading I am getting a weird error:-
cannot verify client 3000
Note:- I recently made changes in the accounts (xcode preference section). Is this related to my error?
I also restart the xcode but issue still there?
I already checked this question on SO, but they say restart your xcode. But this does not solve my problem.
For my case,I got this error after selecting "Generic iOS Device" when archiving, however i plugged in my iPhone and selected it, then archived, I got no errors this time.(I also cleaned both Shift+cmd+k and Shift+alt+cmd+k before archiving)
I encountered the same issue the first time I tried to submit to app store with the target on my device.
What worked for me:
I retried a couple of minutes later without changing a thing and everything went smooth.
This is temporary apple server bug. Try it again OR Retry after some time it will fix the problem.
Thanks
There is no need to reinstall Xcode. Just wait a few minutes and try again and it will work.
I tried :
waiting days,
restarting,
deleting the developer account in
preferences,
submitting archives from a connected device,
submitting
archives from a iOS generic device.
Nothing worked.
I needed to:
create an archive (it was from a connected device),
in the organiser window select the export button (on the right hand side underneath the "Upload to App Store" button.
Select that the export is for app store distribution.
Wait.
Take a note of the location the .ipa file is saved to.
Go back to Xcode, then select the menu item Xcode > Open Developer Tool > Application Loader.
Select Deliver Your App, and select choose.
Navigate to your .ipa file noted above.
Select next, wait, next, check for any error message, send.
Hope this helps someone.
I got this error while uploading my distribution archive to App Store with selecting Distribution provisioning profile scheme -> Product -> Archive -> Upload to App Store. The error is based on I chose my real iphone device in Xcode by mistake. You need to choose "Generic iOS Device" and repeat same steps as I mentioned before.
You have to plug in your iPhone to your Mac and try to upload to AppStore again.
For some reason, validating the archive before uploading fixed the issue for me.
With Xcode 7.1, I could only make a successful build without bitcode. Try it out if everything else fails.
I resolved this by exporting ("export" in xcode archive organizer -> "to iOS App Store") and using the Application Loader instead of xcode to submit.
It is recurring. Seems to me like an internal error with apples identification service or so.
My definite solution:
Get yourself a cup of tea and try it again.
You can, of course, do some voodoo or change the target device or something, but re-trying after a while will do.
I have the same issue.
I did the below steps:
Step 1: Select Code Signing Identity for "Release"
Step 2 : Select Distribution profile
I tried to use Application Loader instead and it worked well. Maybe that helps
I've been having this problem since Xcode 7.1 (for more than a month). I did everything I could trying to solve this: restart Xcode, clean project, clean build folder, build with a device connected, reinstall Xcode multiple times, even formatting the whole disk and starting from scratch. None of this worked.
During this time my colleague was always able to upload the very same builds to App Store without any problem.
Curiously, what solved this problem for me was disconnecting my non-Apple wireless mouse.
I found this out when I tried to submit an app from my home computer and got the same error. I disconnected the mouse dongle, tried again and it went through.
I've verified this three times both on my home (MacBook Pro 2013) and work computer (Mac Mini 2014).
This leads me to believe that during the app submission process Apple may check if your environment is purely made by Apple or not, and may block your submission based on that. This would explain the "Cannot verify client" message.
This one worked for me:
Delete the Archive that failed during upload.
Clean the solution.
Rebuild the solution.
Archive the it.
Go to Xcode's Organizer, then Validate (this should be 'Successful').
Upload the build.

App installation failed: Could not write to the device

In Xcode 6.3, I got this error when trying to run an iOS project written in Swift on a real device.
App installation failed
could not write to the device.
I tried to clean the project and run again, but the same error occurs.
How can I fix this error?
Deleting the app on the device and running the project again works for me.
I did a Clean and installed my app successfully.
Product->Clean(Shift-Cmd-K)
I turned off the device and turned it on again after which I did not get such error.
OK, few things you should consider that could guide us to the problem, please check and post the answers:
is your project using capabilities? are they set correctly (should be all green)
did you try with a different project (something really simple)?
are you able to install apps from the App Store?
did you check the amount of free space left in the device?
if not, another suggestion will be using exception breakpoint, there is someone that posted an explanation how to setup it, do it and post the logs
App installation failed
I hope it helps you
Got this problem twice in one week on complete different devices.
One device had no more storage left, after deleting some apps the project installed perfectly.
The other device was fixed after rebooting the device
If you are using a free developer account you may need to uninstall some other apps you have signed.
For me it was the provisioning profile - I used distribution instead of development
My issue was an embedded framework.
Go to "Build Phases" -> "Embed Frameworks" -> Check "Copy only when installing", and it got rid of the issue for me.
For me the following did not work on iOS 11 beta 10, XCode 9 beta 6:
Restart the device
Deleting the app from the device
No symlinks were in the project
There was plenty of storage available
Deleted Derived Data and voilá, it worked again
in my project this problem happened because there was a folder with symbolic link. I removed that folder and it worked properly.
This error has many potential root causes, as can be seen by the large variety of suggested answers. The best approach to troubleshooting app installation issues like this one is usually to inspect the console of the iOS device itself, as that'll often provide much more specific error messages. In Xcode open the 'Devices and Simulators' window and take a peek at the logs of the device where your app is being installed.
In my case, the "Could not write to the device" error was being caused by this:
Feb 27 10:54:58 iPhone-7-110 installd(MobileSystemServices)[46] : 0x16f92f000 -[MIBundle _validateWithError:]: 38: Failed to load Info.plist from bundle at path /private/var/installd/Library/Caches/com.apple.mobile.installd.staging/temp.ebmR6U/extracted/SampleApp.app/Frameworks/SomeFramework.framework
Which clearly hints at what's actually going on. I had forgotten to set an Info.plist file for my dynamic framework target (used by the app).
I had a symlink in my project to a file outside of the project. When I deleted this symlink the install worked fine.
I was having the same error, i just deleted the project and fixed!
Go to Window -> Project and right click, and remove from projects!
In the case of your device have an app with the same bundle identifier, Xcode will throw this error.
Try to delete potential app with the same bundle identifier.
Check your provision profile, maybe you are using the app store provision profile like me. I had to change the app store provision profile to development, now it's working.
Tried all of the above answers: Deleting the app, clearing storage space, cleaning the project...
What finally worked was bumping the build number in info.plist (General > Build)
For anyone still facing this Issue:
There are so many reasons and this is one of them as it happened to me.
I've faced the same problem and I was connected wirelessly and If you are trying to install the application in wireless connecting mode (connected through same network), this might probably because of poor internet connection. Check your internet connection and try again, it works fine...
Get rid of embedded libraries, dont' just throw it in there make sure it is embedded indeed.
If you use your iPhone for debug, maybe, because your iPhone's storage space is less than your debug App.
Clean your iPhone --- Real machine
Clean your Mac --- Simulator
This looks like another time waster courtesy of Apple's amazingly high class development team. On iOS11 Xcode9 (pick your beta, any one works) this will happen randomly. Appears to be more frequent if you dare to switch apps while compiling. Just build again and stare at xcode - it'll work the second time without fail in my experience.
Apparently this message can also appear if the system clock of device where the app is being installed is too far away from the current time.
I was doing some tests with date formatters by changing my iPhone's system clock and eventually forgot to reset it to the current time. Afterwards it always displayed the same message ("could not write to the device.") whenever I attempted to run the app. Simply resetting the clock in Settings fixed the issue.
Nothing helped me. I followed the below steps,
Clean derived data folder
Quit Xcode and disconnect device
Restart Macbook
Restart Device
Open Xcode
Clean and run the project
Finally I got it working!!
I am facing same issue then solved out follow this step and now its working.
Deleting the app from the device
Try to install another application
Remove derived data in X-code.
Restart X-Code then clean and build the project then run.
It's still not working then
Remove un-used application
Restart the device and check the Available and capacity in settings
Again app run in device
I hope its worked, enjoy it.
My problem was I had initially installed the app using a different set of developer credentials on the device. Deleting the app from the device fixed it.
Maybe it can be due to the following error App installation failed. No code signature found. In my case after a project clean the description of the error switched to "No code signature found".
In my case I created two frameworks but they had the same bundle identifier.
This caused the installation to fail, so double check the frameworks bundle identifiers and make sure that each of them have a unique bundle identifier.
Environment: Xcode 10
sometime this error occurs due to wrong certificate.Please make sure your certificate.
Also this the error shown if your machine running Xcode is low on space.
Once I had to load an App Container for debugging purposes into an iPad, said operation failed because the container was too big (18 GB) for this device (16 GB minus the OS), so that I desisted the task and completly forgot about it, leaving the failed installation in the device. Later, when trying to install a different application this error appeared, once I got rid of the failed app installation, everything got back to normal.
Basically, your Ipad might be low in storage.
One reason this can happen is if your app bundle contains broken symlinks.

Xcode 4.4 No such file found launching executable

Before anyone just assumes what I am saying here, please read what I have to say.
I have read the hundreds of posts on this topic and have tried pretty much all the suggested resolutions, in no particular order:
Quitting Xcode
Deleting the derived data folder
Cleaning the project
Hard resetting iPhone
Resetting Mac
Tried a second iPhone
Different USB port
All these in 'special' order
Checked code signing attributes
"Validate Settings" returns no problems
Validation returns no problems
I am stumped when it comes to this. The only thing I can think of is actually resetting my phone, but don't see how this could help when it doesn't work on the second phone either.
Are there any other suggestions, tips, ideas on what could be causing this rather annoying bug?
UPDATE: The exact error:
Error launching remote program: No such file or directory (/Users/Username/Library/Developer/Xcode/DerivedData/ProjectName-dnfacjtdklqktcazrpfyupofdryp/Build/Products/Debug-iphoneos/ProjectName.app/ProjectName).
To get the error, I do any combination of the listed steps above, then click Run on "My Device" (an iPhone 4). Application never installs to the phone and Xcode reports the application has finished running then shows the above error.
My problem was cause by me accidently changing the "Deployment Target" (ios version) to a version higher than what was on the phone I tried to run the code on.
Change the deployment target to below or equal to the ios software version on your phone.
(this answer wasn't on your list) :)

Xcode will run app on simulator but not on device

I receive the following error when trying to run the app on my device.
error: failed to launch '/Users/michael/Library/Developer/Xcode/DerivedData/Build/Products/Debug-iphoneos/Word Processor.app/Word Processor' -- No such file or directory (/Users/michael/Library/Developer/Xcode/DerivedData/Build/Products/Debug-iphoneos/Word Processor.app/Word Processor)
The app runs fine in the simulator. When I try to debug on the device, it appears to copy the app (I can see the icon), but then stalls with the above message. Xcode says it is running the app on my iPod, but nothing is happening on my iPod.
When I click on the app, the app appears to launch, but seems to be missing resources.
Other projects of mine work properly. What setting do I need to change to make this work properly.? Looking at the error message, it seems to be looking in my mac for the app. But this doesn't make sense since I am trying to run it on my 4th gen iPod touch. I am using Xcode 4.3.1 and iOS 5.1
With Mountain Lion and the latest version of Xcode (4.4.4F250), none of the suggestions in this thread worked directly (clean, clean project, remove derived data folder, etc). This sequence did. From DhilipSiva:
Disconnect your device
Delete the app from your device
Quit Xcode (Don't just simply close the window, quit it)
Delete derived data folder rm -fr ~/Library/Developer/Xcode/DerivedData (console)
Start Xcode,connect device & run the project
I solve this by going to Targets-> Info -> Required Device capabilities and delete the option with armv7.
Hope this helps!
This is a recurring problem that many developers are having with the current version of Xcode. The temporary workaround has been consistently deleting the DerivedData folder.
You can add doing it to a build script or even make it a cron job:
rm -rf ~/Library/Developer/Xcode/DerivedData
Sad, but true.
For me restarting of Xcode, cleaning DerivedData and restaring device wasn't enough in most cases, until I had figured out that iTunes was also running, and after quitting iTunes everything worked fine!
So my steps now are simple:
1. Quit Xcode.
2. If iTunes is running, quit iTunes.
3. Reopen project.
No need to remove app from the device, clean project or restart/disconnect device.
I think that's because Xcode and iTunes use some common libraries (as you know, Xcode Installer always asks to quit iTunes on installing iOS SDK).
I also had this problem after changing from a lower XCode and iOS version to the current XCode and iOS version.
I fixed this problem by changing th iOS Depolyment Target to a lower version, since my Device is not updated to the latest iOS yet.
You can do this by clicking the project inside the Info tab.
Have you looked at the Developer Certs and Distribution Certs if you have. When running in debug mode from Xcode your will need your app assigned with the developer cert and not the distribution cert. The distribution certs do not allow for debugging.
This error will manifest whenever the device capabilities described in the Info.plist do not match those of the device.
In my case, I was requesting GPS support and location-services support and trying to test on an iPod touch.
I struggled with this problem for 2 days and went through all the posts, tried all the options including, restarting Xcode, device, deleting DerivedData folder etc.
Finally, the problem was with the Info.plist file. In my case, I had improper icon paths in the Info.plist file. I suggest you to archive the application and then validate it to get the exact problem in you case. Only when I did that, I was able to find the issue.
I solved this problem many times with DhilipSiva's solution. However, it may not work sometimes. If that is the case, consider deleting and re-adding the target.
Removed armv6 support and it started working again
I stumbled upon this same problem on several diferent projects, researched a lot on forums and even here on Stack overflow. A lot of solutions were given, and some people seemed to get them working, but none of them worked for me.
So we tried some pretty obvious course of action, which for some reason we didn't tought about before: I've done a CHMOD -R 777 on the EXACT path indicated by the error message (I copied it directly).
Worked like a charm, 100% times!
Hope it helps, guys!
As Chronos mentiod, the device capabilities might be the reason. In addition I would say that in my case it was all about the UIRequiresPersistentWiFi key, which (for some unclear reason) didn't let me to install my app on an iPhone4. Hope this helps ones who tried everything else and haven't fixed the problem yet.
I solve this by going to Targets-> Info -> Required Device capabilities and check id at 0 index if armv7 not in 0 index then remove other things and armv7 set on 0 index and clean app connect device and run.
Hope this helps fine!
I did these steps:
Delete derived data: rm -rf ~/Library/Developer/Xcode/DerivedData
Deep cleaned the project: Shift Key + Option Key + Command Key + letter K key
Quit the project
Quit XCode
Deleted the app from my device
When I reopened the Xcode, launched the project, and then launched the app it successively ran on my device
For me it was Command Line Tools
Go to Xcode -> Preferences -> Locations -> Command Line Tools
Make sure you select latest Xcode version. I selected Xcode 11.0, and everything started working.
I get the similar question and has searched via the internet the whole day without solution yet...
Xcode 12, iOS 14.
I'm using a cocoaPods call GCDWebServer, which will open a build-in http service in iOS. Now it works fine in simulator and I could open a home page of it in my Mac's browser. But I cannot open the home page if running it with real iPhone. The browser said "Cannot connect to server"
And in console, everything is same without any errors provided for me.
Thus, how could I debug this?
[DEBUG] Did open IPv4 listening socket 3
[DEBUG] Did open IPv6 listening socket 4
[INFO] GCDWebUploader started on port 80 and reachable at http://192.168.1.3/

Resources