Josh Kahane
Josh Kahane

Reputation: 17169

Xcode: Could not inspect the application package

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?

Upvotes: 58

Views: 39313

Answers (23)

us_david
us_david

Reputation: 4917

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.

Upvotes: 0

ImShrey
ImShrey

Reputation: 418

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

Upvotes: 0

Alexander Fedoseev
Alexander Fedoseev

Reputation: 11

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

Upvotes: 0

Shebuka
Shebuka

Reputation: 3228

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.

Upvotes: 2

jbart12
jbart12

Reputation: 117

deleting Pods and then calling pod install worked for me

Upvotes: 1

Matthew Usdin
Matthew Usdin

Reputation: 1284

Change the Display name in Targets > General > Identity

Build your app and switch back to your old name.

It worked for me

Upvotes: 0

Dan Field
Dan Field

Reputation: 21641

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

Upvotes: 6

Daniel Molina
Daniel Molina

Reputation: 296

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.

Upvotes: 9

Liu Hao
Liu Hao

Reputation: 512

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

Upvotes: 0

Lewis Hotchen
Lewis Hotchen

Reputation: 11

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

Upvotes: 1

Roney Francis
Roney Francis

Reputation: 355

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.

Upvotes: 10

DareDevil
DareDevil

Reputation: 1142

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.

Upvotes: 0

Yannick
Yannick

Reputation: 3278

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.

Upvotes: 3

Arnaud
Arnaud

Reputation: 955

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

Upvotes: -1

Shen Yu
Shen Yu

Reputation: 1

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

Upvotes: -2

aeldron
aeldron

Reputation: 1575

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

Upvotes: 0

Bilal
Bilal

Reputation: 19156

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/>

Upvotes: 1

Marcos Curvello
Marcos Curvello

Reputation: 917

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.

Upvotes: 33

borisgolovnev
borisgolovnev

Reputation: 1800

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.

Upvotes: 31

Ramya Yenduri
Ramya Yenduri

Reputation: 56

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).

Upvotes: 1

Faisal Memon
Faisal Memon

Reputation: 3454

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.

Upvotes: 1

earltedly
earltedly

Reputation: 248

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.

Upvotes: 1

picciano
picciano

Reputation: 22701

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

Upvotes: 4

Related Questions