57

I am running Xcode 6 and iOS 8 GM. Every other time I run my app I get this message from Xcode:

"Could not inspect the application package"

So I can run and build, I will get the message. I run and build again, everything runs as expected (this is to my device). Then it will rinse and repeat, every other time giving me this error.

I have looked at all the other solutions that have been suggested but cannot stop this error. I have cleaned my project, cleaned the build folder, deleted derived data etc with no luck.

How can I see what is causing this in the first place?

Interestingly, this only happens when running on my device. Not on the simulator. Also, it only happens on my device, when building for debug. If I change the scheme to release, I can build and run endlessly without with error. Ideas?

halfer
  • 19,824
  • 17
  • 99
  • 186
Josh Kahane
  • 16,765
  • 45
  • 140
  • 253
  • What other solutions did you tried exactly? – idmean Sep 29 '14 at 15:20
  • I'm not using any pods, although I have added the Parse framework. Although I don't see why that would change anything, it hasn't in the past. Other solutions, cleaning build folder, deleting all derived data, recreating provisioning profiles. There isn't a great deal on this issue and it is so nondescript it makes it very difficult to resolve. – Josh Kahane Sep 29 '14 at 15:32
  • any preceding errors in the console? – Brad Allred Sep 29 '14 at 18:11
  • Nope, the app never runs. Just before it runs and after is completes building, it gives the error. Nothing in the console. – Josh Kahane Sep 30 '14 at 09:50
  • It doesn't happen if the app wasn't on the device before. – Dali Oct 01 '14 at 14:16
  • Josh have you tried any of the existing [SO threads'](http://stackoverflow.com/search?q=Could+not+inspect+the+application+package) answers? – carlodurso Oct 01 '14 at 22:20
  • 1
    Here is my clue. When Xcode is not display any useful warning or error, see the system log to analyze. Lookup the system log form Console.app And we have found missing info.plist file in carthage framework. So wonderfull. The system log is very very helpful !!! – JateXu Apr 10 '19 at 02:35

23 Answers23

33

This error seems to happen when you have third party code which isn't signed by you in your bundle. Check this thread, it helped me once.

Also when performing build clean opt for cmd + option + shift + k.

Community
  • 1
  • 1
Marcos Curvello
  • 873
  • 13
  • 25
31

This can happen with Xcode 6 and iOS 8 if a product name contains non-latin characters. In this case changing product name to the one with only latin characters for debug builds fixes this problem.

borisgolovnev
  • 1,780
  • 16
  • 20
  • TaDa! Very elusive, but that was it! I had a `ß` in my title. That sorted it! Thanks. – Josh Kahane Oct 16 '14 at 11:39
  • 9
    Apple should fix that! – Dali Oct 27 '14 at 14:51
  • I had to change both release and debug product names to run on device. – Denis Kutlubaev Nov 11 '14 at 09:05
  • check if you have copy-paste from other project but forgot rename product name will cause the error, refer http://stackoverflow.com/questions/3872175/how-do-i-change-the-product-name-within-an-xcode-project – Chris Ho Mar 17 '16 at 08:32
  • 1
    additional : targets->Copy Bundle Resources-> remove Info.plist also solve the problem for me. http://stackoverflow.com/questions/3095612/warning-the-copy-bundle-resources-build-phase-contains-this-targets-info-plist – Chris Ho Mar 17 '16 at 08:47
  • XCode 11 still has the same problem... This solved my problem. Thank you. – Booyoung Park Mar 23 '20 at 01:54
10

Try to remove some libraries from your Xcode => Click on Target => General tab => Embedded Libraries (Keep only required libraries or Framework)

Here, remove (Use - sign on bottom to delete).

If you require the framework or libraries that you deleted, add this using Xcode => Click on Target => General tab => Linked framework and Libraries (Use - sign on bottom to add this).

This will work.

Community
  • 1
  • 1
Roney Francis
  • 356
  • 2
  • 15
9

In my case, I needed to check the option that says "Copy only when installing" under "Build Phases/Embed Frameworks" in one of the frameworks I was embedding.

Daniel Molina
  • 286
  • 3
  • 5
5

I got this when a custom built .framework was missing its Info.plist.

Dan Field
  • 20,885
  • 5
  • 55
  • 71
4

If you have moved or copied a folder named resources or resource into your project, try renaming it. Then perform a clean.

picciano
  • 22,341
  • 9
  • 69
  • 82
3

I deleted my Info.plist and I dragged a new info.plist into my project. Xcode did not show me any warning but my app would not launch until i changed the name to Info.plist.

Yannick
  • 3,210
  • 1
  • 21
  • 30
2

Happened to me today. Yesterday everything was working fine and suddenly today I can't deploy because of this error:

Could not inspect the application package.
Domain: com.apple.dt.MobileDeviceErrorDomain
Code: -402653103

on Xcode 13.4.1 and iOS 15.4. Nothing changed from yesterday. Tried to rebuild the project (not helped), relaunch Xcode (not helped), restart the phone (not helped) and rebooted my MacBook (not helped)...

Then I remembered that I merged the .project with another branch and inspecting the changes noticed that GENERATE_INFOPLIST_FILE = YES was removed from our custom .framework settings, so it was missing the Info.plist. Reenabling the flag the app deployed properly.


TLDR: Our custom built .framework was missing its Info.plist.

Shebuka
  • 3,148
  • 1
  • 26
  • 43
1

I've seen this error before when there is something in the entitlements file but is not enabled for the app id in the provisioning centre.

Specifically I had HealthKit enabled in the entitlements file but not configured for the application identifier.

earltedly
  • 248
  • 2
  • 10
1

I had a potentially similar problem, hardware only, when I had an app which was given entitlement to run in the background and had run previously on the phone. For such apps, I found the Xcode deployment to phone broken and had to change the bundle identifier to unjam the deployment.

Faisal Memon
  • 2,711
  • 16
  • 30
1

I think there are third party files in your code, which might include compiled code which is not signed by you. If so, you can use iReSign to resign them using your own certificate. You can also use the command line:

 codesign -f -s "iPhone Developer: Name (XXXXXXXXXX)" nameOfAppToSign.app

Replace the example identity with your own (you can man codesign to read more about this command).

1

I had the same issue, And was unable to install the ipa. It always ended with an error "Could not inspect the application package." and some warnings in device console

Feb 10 17:38:16 iPhone mobile_installation_proxy[356] <Warning>: LaunchServices: Please include the kCFBundleIdentifierKey in the options   dictionary when installing an app.
Feb 10 17:38:16 iPhone mobile_installation_proxy[356] <Warning>: LaunchServices: installing app with unknown bundleID
.
.
Feb 10 17:38:16 iPhone installd[44] <Error>: 0x101bcc000 -[MIBundle _validateWithError:]: 28: Failed to load Info.plist from bundle at path
Feb 10 17:38:16 iPhone installd[44] <Error>: 0x101bcc000 + [MIInstallable installablesAtURL:packageFormat:userOptions:error:]: Failed  to create bundle for …

After spending hours, I got it fixed by adding the "Application requires iPhone environment" in info.plist

<key>LSRequiresIPhoneOS</key>
<true/>
Bilal
  • 18,478
  • 8
  • 57
  • 72
1

Found a solution by adding the Framework to General -> Linked Frameworks And Libraries and setting the status to optional. (Leave the embedded binaries blank)

1

deleting Pods and then calling pod install worked for me

jbart12
  • 117
  • 6
0

Mine turned out to be something to do with Apple's certificates and such. I was working between two different computers and I think something went amiss. So I had to revoke my developer certificate at the Apple iOS dev site, and request a new one with a private key etc. Once the new certificate was installed, the message went

aeldron
  • 1,575
  • 1
  • 13
  • 16
0

For my case, it was file missing in a newly added *.framework. One *.plist file and "_CodeSignature" folder were missing in that *.framework. Replacing corrupted *.framework file fixed my issue.

DareDevil
  • 902
  • 8
  • 21
0

http://www.developersalley.com/blog/post/2015/11/13/How-To-Fix-App-installation-failed-Could-not-inspect-application-package-Error-When-Installing-App-In-XCode.aspx

This link saved my life, I use the XUPorter plugin, the added folder has a plist file, which is my SDK provided to me

Liu Hao
  • 472
  • 4
  • 24
0

Change the Display name in Targets > General > Identity

Build your app and switch back to your old name.

It worked for me

Matthew Usdin
  • 1,264
  • 1
  • 19
  • 20
0

In my case, the reason for this error was a corrupted Info.plist file in one of the frameworks. This happened because I used bash scripts to modify a copy of the project. When I started checking the files, I noticed that some Info.plist files are not viewed in Quick look. After packaging in the framework, Info.plist is converted to binary format, but when viewed through Quick look it is displayed as text. Thus it became clear to me what happened and after replacing the corrupted files everything worked like a charm

0

In case someone here is consuming bazel based xcframework in your xcode project, this might solve your issue: https://stackoverflow.com/a/74027282/6709940

ImShrey
  • 380
  • 4
  • 12
0

There are so many answers and each of them addresses a different cause of the error message. Just want to add my solution when it happened to me.

I was using opencv2 framework, once I checked on "Copy only when installing" the error when away, and I was able to install and run my app. The particular setting is in "Build Phases"->Embedded Frameworks section.

halfer
  • 19,824
  • 17
  • 99
  • 186
us_david
  • 4,431
  • 35
  • 29
-1

I had the same issue, and the problem was that I had an alias in the xCode project. I removed it and it works.

Bruce P
  • 19,995
  • 8
  • 63
  • 73
Arnaud
  • 955
  • 1
  • 6
  • 15
-2

You can try following steps: Window->Projects and look for your project and delete 'Derived Data' for all your projects with the same name

Shen Yu
  • 1
  • 1