Build and run Disabled in xcode - iphone

There are some applications which shows Build and run icon disabled which stops me from running the application.It does not happen to all applications but on a few . It mainly occurs to me in facebook applications and a few more applications.Can anybody have an idea what could be the problem ? I have tried everything from changing the build settings etc. but it does not work.

Need to fix the executable, it happens after renaming project.
Product > Scheme > Edit scheme..
Select
Run > Info
Set Executable is your app name, if selected None.

Try this, It's work for me.
Follow below steps to unable Build and Run in xcode
1) Go to
Product => Scheme => Edit scheme.
2) Select Run option and select info
3) In Executable if option is selected to None then change it to your app name
Hope this is help for some one.

That project appears to be the Sparrow audio project. It's not a stand-alone project you can run; it's a library, you need to be using it in another project to have anything to actually run.
The sparrow project includes a sample app called Scaffold which demonstrates the use of Sparrow. More info:
http://www.sparrow-framework.org/help/gettingstarted/
Also see:
http://www.sparrow-framework.org/help/documentation/
Note that you can still 'build'; it's just 'build and run' that can't be clicked.

I think those may be frameworks,static libraries. So the build and run option is disabled.

I think you might be creating plugin or frameworks or libraries (not an Application).
So the "Build & Run" icon is DISABLED.(as answered by Chandan Shetty SP)
In order to enable the icon you need to specify the Application which use this plugin or framework or library whatever you are building.
To specify such application:
Rt. Click on "Executables" (in Xcode's Groups and Files panel)
Select Add > New Custom Executable
Then specify the name of application (just for display purpose) and specify the path of the application.

Go to the Project menu in the menubar and change the Active Target to the target of the actual app.

Related

iOS Crashlytics not logged in firebase dashboard

I have configured it for firebase in app delegate.
Change Debug Information Format to DWARF with dSYM
I write the necessary run scripts.
"${PODS_ROOT}/FirebaseCrashlytics/run"
${DWARF_DSYM_FOLDER_PATH}/${DWARF_DSYM_FILE_NAME}/Contents/Resources/DWARF/${TARGET_NAME}
$(SRCROOT)/$(BUILT_PRODUCTS_DIR)/$(INFOPLIST_PATH)
But test crashes not showing in crashlytics dashboard
Finally, when I run Crashlytics/run manually, it gives an Could not get GOOGLE_APP_ID in Google Services file from build environment error, but GoogleService-Info.plist is attached to the project and I’m sure. I deleted the GoogleService-Info.plist and added it again. Could it be related to
Could you please tell me why or idea?
Thanks in advance
I assume it's "GoogleService-Info.plist" problem
because it's the only file that has GOOGLE_APP_ID property.
first, check google plist path. put it under your project folder, and then update your script with a specific path of file:
Xcode path: build phases -> Run Script
"${PODS_ROOT}/FirebaseCrashlytics/run" -gsp "${PROJECT_DIR}/[project folder name]/GoogleService-Info.plist" -p ios
second: make sure Xcode used your script succeesfully. to check that navigate to:
Xcode path : report navigator
then select a recent ended build and from center log scroll to the end and find this:
image link
as you see in image the validation should be succesfull
if you didn't find any related log to shell in the build log make sure you unchecked this
image link
Script succeeds in report navigator but still doesn't show my test crashes in crashlytics. imageLink
And I followed these steps of firebase
In Xcode, select Product > Scheme > Edit scheme.
Select Run from the left menu, then select the Arguments tab.
In the Arguments Passed on Launch section, add -FIRDebugEnabled.
But Completed report submission did not print logs
I had a very silly problem.I solved my problem. After you build with Xcode, you have to stop xcode and open the app manually.
I was missing a most important step mentioned in the documentation
While testing for crash please build and detach the Xcode's debugger using square button right before the run button in Xcode
Please refer to this part in documentation

Cannot load underlying module for XCTest

I'm working in swift on Xcode and by default it creates a test file that references XCTest.
When I set the target membership to my main project it causes this error
Cannot load underlying module for XCTest
If this target membership is not set the tests runs properly and everything works fine.
Double check that the file in question is not in the main target but instead only the test target. Only the test target will have that framework to import.
The main project does not link with the XCUnit framework. You should create a separate testing target for your project, if one does not already exist, and add your test source files to that target.
Select your project in the Project Navigator. This will open the project's settings in the editor.
Click the "+" button at the bottom of the column listing your Targets.
If you are working on an iOS project template, select iOS > Test > iOS Unit Testing Bundle.
If you are working on an OS X project template, select OS X > Test > OS X Unit Testing Bundle.
You've just added your tests file/class into main target and not into test target by mistake. Simple as that.
Solution:
1) Remove test file from "Compile Sources" list on "Build Phases" tab for main target
2) Add same file into "Compile Sources" on "Build Phases" tab for test target
It must resolve the issue
I get this error if I create a macOS dynamic framework target, which links to XCTest.framework (the target is a framework target, not a testing target!).
In this case the problem is solved by adding
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/Library/Frameworks
to project's "Build Settings / Framework Search Paths".
After lots of troubleshooting and bouncing around Stack Overflow pages such as this one, I managed to find one detail that was not mentioned on the other iOS Unit Test troubleshooting pages.
If your project uses CocoaPods, make sure to include your test target nested inside your main application's target. Your podfile might not include it if you created your test target after running pod init. Your podfile should look something like this:
target 'YourApp' do
target 'YourAppTests' do
inherit! :search_paths
# Pods for testing
end
end
Remember to save your podfile and run pod install after doing so.
Hope it helps!
This maybe a little late but what you have to do is:
Click on File > New > Target > iOS Unit Testing Bundle.
And then add your tests in there. This worked for me. The problem was that I didn't select create unit tests when I created my project.
Hope this helps someone.
While the accepted answer solves this problem for majority of times, there is one more way you can come across this error.
If you have already ensured that:
As pointed out by #pwc #nick-n and others
The ClassTest.swift file for target membership by ensuring that it is only attached to the Testing target.
The ClassTest.swift is not visible under you main app target > Build Sources > Compile Sources
Here is what else you can check:
in your .podspecs file
Ensure that your source_files does not directly or indirectly includes the testing directory.
for example :
s.source_files = ["Classes/**/*.{swift}", "Classes/**/*.{xib}"]
s.exclude_files = ["Classes/Exclude", "Classes/MyPodProjTests/"]
Note that Classes/**/*.{swift} includes everything overriding the fact that the directory MyPodProjTests must be excluded.
Solution:
s.source_files = ["Classes/MyPodProj/**/*.{swift}", "Classes/**/*.{xib}"]
Note:
This is extremely edge case and completely human error but I thought it will be worth point out.
This problem occur two times in your project.
When you Don't Add UnitTestingBundle in your project when create a New Project.
When you install CocoaPods in Your Project sometime not every time.
1:Answer:
Go to the File Click on File.
Then You see First option New Click on it.
After Clicking on it you see Some Option Click on Target.
And then in the Searchbar Search IOS Unit Testing Bundle and Add Problem is solved.
if Compiler can't give you a permission to add this then try Second Method when is given Below.
2. Answer CocoaPod Problem:
Go to the Product Click on the Product.
Click on clean or press cmd+k.
Problem is solved.
Make sure the Target Membership is checked off for all the modules when the test framework is selected. You can view the Target Membership option by selecting View->Utilities->Show File Inspector
In my case, I was making the tests for a private pod, so in the podspec was like:
s.test_spec 'Tests' do |test_spec|
test_spec.source_files = 'Tests/*.swift' end
But in the Podfile I forgot to bring the test specification, as such:
target 'MyApp' do
use_frameworks!
pod 'CoconutLib', '~> 1.0', :testspecs => ['Tests'] end
I did all the above, but still I was not allowed to access the methods I wanted to test. But before I wrote any test case built the project once and then the methods were accessible to test. So do try it and let me know if it solved any ones problem.
I had the same problem and the solution for me was to:
Select my scheme
Edit Scheme...
Then when Scheme configuration window is opened select left tab named "Test" to be redirected here:
Like you can see my UITests are not added here but exist in my project so I had just to tap plus button and select my UITests target like this:
Then tap "Add" button and close configuration view
Finish with a clean of project and try again it should work
And don't forget to verify that too: https://developer.apple.com/library/archive/qa/qa1954/_index.html
Hope this answer will help.
PS: one last think in my Test target in build settings I had to check these property that was not configured correctly:
DEBUG_INFORMATION_FORMAT = dwarf;
ONLY_ACTIVE_ARCH = YES;
VALIDATE_PRODUCT = NO;
Just as #Alfishe mentioned above:
You have to remove the test files from Compiler Sources under Build Phases
As shown below
Check Target Membership of your Test class.
The problem is that Unit Testing Bundle as a target should be created beforehand
[How to add it]

how to fix the issue "Command /bin/sh failed with exit code 1" in iphone

I used a cocoa static library in my application. When I compile my library I got the following error:
Shell Script invocation error:can't open input file:
/Users/sijuthomas/Library/Developer/Xcode/DerivedData/SCXML2-
bbttehupryhijphhjdiemcytkvgy/Build/Products/Debug-iphonesimulator/
libSCXMLParser.a (No such file or directory)
Command /bin/sh failed with exit code 1
How can I fix this?
Click On Run checkbox if not selected.
I had this issue because i denied keychain access and in order to solve it you need to open keychain,
Then click on the lock on top right of the screen to lock it again,
after that you can archive and it will work
Deleting "Derived Data" worked for me.
In Xcode go to File > Workspace Settings > Click the arrow next to the Derived Data file path > move the "Derived Data" folder to the trash.
Seems you are running a shell script and it can't find your specific file. Look at Target -> Build-Phases -> RunScript if you are running a script.
You can check if a script is running in your build output (in the navigator panel). If your script does something wrong, the build-phase will stop.
I had same issue got it fixed. Use below steps to resolve issue in Xcode 6.4.
Click on Show project navigator in Navigator window
Now Select project immediately below navigator window
Select Targets
Select Build Phases tab
Open Run Script drop-down option
Select Run script only when installing checkbox
Now, clean your project (cmd+shift+k) and build your project.
Cleaning the build folder (Cmd + Shift + Alt + K) worked for me
1) Delete the pod folder and .xcworkspace file
2) Open the folder in terminal
3) Type "pod install"
Did you add the .a library to the xcode projet ? (project -> build phases -> Link binary with libraries -> click on the '+' -> click 'add other' -> choose your library)
And maybe the library is not compatible with the simulator, did you try to compile for iDevice (not simulator) ?
(I've already fight with the second problem, I got a library that was not working with the simulator but with a real device it compiles...)
In My case there was space in the path that was failing the script.If you are using variables like $PROJECT_DIR or $TARGET_BUILD_DIR then replace them "$PROJECT_DIR" or "$TARGET_BUILD_DIR" respectively.After adding quotes my script ran successfully.
For me, my certificate is expired. I have created a new certificate.
I did all above and spent an hour on the issue.
Tried everything above as well as restarted Xcode.
Finally, restarted computer and everything working normally again!
I tried restarting Xcode (7) and nothing (the have you tried switching it off and on again of iOS development for me :-)). I then tried by restarting my box and that worked.
In my case the script was failing when copying a file from a location to another one. I think it could have been related to Finder screwing with writing rights over certain folders.
For me this error was occuring because I changed the version number from 1 to 1.0 and build number from 6 to 1.1 as I pulled the code from source tree. I just changed it back and changed the build number from 6 to 7and it worked fine.
just put your script in a file and run that file with 2>/dev/null at the end of command line!
This way, if there is a problem with the command whatsoever, it will not halt your xcode build
in my case I was running just a command to uninstall my previous copy of the app from a connected iphone, so it could give an error if the iphone is not there. To solve it:
$mobiledevice uninstall_app com.my.app 2>/dev/null
The only thing worked for me:
1) Delete Derived Data with CleanMyMac: System Junk -> Xcode Junk -> Xcode Derived Data
Deleting Derived Data with CleanMyMac
2) Then in Xcode: Product -> Clean
I'll list things I did that did not work for me and finally what did
First, the accepted answer of Run script only when installing did not work.
Deleting derived data did not work.
What did work:
I added a new build phase in Build Phases
New Copy Files Phase
Drag & Drop the chosen framework into the drop target
Set the 'Destination' to Frameworks
Credit due to Kevin Le's Medium post
For those who doesn't want to uncheck that option (using cocoapods for example), the problem might be with the certificate/key.
Xcode (or whatever tool you are using, like a command line tool) needs to be able to use the certificate/key from the keychain. For this open the Keychain, locate the certificate that you want to use (Usually on login keychain, My Certificates), right click on the key, select Get Info, click on Access Control tab and add the app to the list.
If this doesn't work, try unlocking the keychain.
Another option can be select Allow all applications to access this item instead of specific apps and/or move the certificate/key to System keychain which is shared between all the user accounts on that Mac.
Also check that the certificate is not expired.
1) option :
2) option : pod update, clean derive data,
In my case, one of the script (related to SwiftGen) was failing during compilation.
I fixed the issue by removing the Pods and then updating them again.
Remove the problematic pod under Pods directory or use pod deintegrate
Install / Update the pods using pod install or pod update
P.S. It is possible your dependency is Global and is not in pods. In that case you can also try to reinstall that dependency.
READ THIS IF YOU USE Crashlytics AND ARE HAVING THIS ISSUE...
I was having the same issue as above Command /bin/sh failed with exit code 1 more specifically [31merror: Could not fetch upload-symbols settings: An unknown error occurred fetching settings.[0m
The first solution (enabling the run script only when installing) allowed me to build my target in the simulator, but I could not archive my build.
I solved this Archive issue by enabling Crashlytics on firebase. I am still used to Fabric where Crashlytics is automatically enabled. Once I enabled Crashlytics in the firebase console for the corresponding GoogleService-Info.plist I was able to Archive without this error.
Remove all pods and install again.
Steps:
comment all pods and run pod install
uncomment all pods and run pod install

Xcode 4 hangs at "Attaching to (app name)"

I just upgraded to Xcode 4 and for some reason my app won't run in the simulator or iOS device. It was working perfectly in Xcode 3, but all of a sudden now when I press run the program stops at "Attaching to...". There doesn't seem to be any other info to help with this problem either.
For summary you can try following things to tackle the issue:
Restart the simulator.
Make sure that you haven't included the Info.plist file in your Building Phases -> Copy Bundle Resources.
Resources folder added to the project as a folder reference (the blue folder icon). That caused the trouble, after adding the folder as a group the problem went away.
Fixed it!! Hopefully this helps some people avoid a very frustrating couple hours. I solved this by:
Clicking on the project name in the left pane (at the very top). This will bring up a new menu to the right, something like the project/ target editors in XCode 3.
Click on Build Settings up at the top.
Under Packaging make sure your product name is the same for every build, and equal to whatever it says it's attaching to. Eg if XCode is Hanging at "Attaching to myLCBO" but your product name is "LCBO Finder" then it won't build. That was exactly my problem because I renamed my app half way through development.
Here was our fix:
In Project > Edit Schemes > Run.
Change the Debugger from GDB to None (directly above the green circle in the image above).
A tip I found at the Apple Developer Forums:
Go into your ProjectName.xcodeproj/
directory and delete anything named
with your userid. Re-open the
project in xcode and all that will get
recreated and it should work. At least
it did for me.
Another tip is to manually delete the build directory.
Yet another tip is to navigate to the Organizer (Shift ⇧ Command ⌘ 2 in xcode 4), select Projects, select you application in the left hand side and then the Delete...-button to the right of Derived Data.
And never forget the universally useful tip: restart your computer and try again.
Good luck!
Solution provided didn't fix the problem in my case.
In order to solve it (XCode 4 only), I had to go to Product -> Edit Scheme. Then select the "Run " scheme, and marked "Automatically" which wasn't enabled.
Hope it helps someone.
For everyone still trying to resolve this after everything you tried from above, try reseting the iPhone Simulator.
Simulator > Device > Erase All Content and Settings...
This will erase all apps from simulator, but now you can finally use simulator!
Also: make sure that you haven't included the Info.plst file in your Building Phases -> Copy Bundle Resources. If so, remove it from that list! I small mistake which could happen, but something that messes things up quite nasty :S
Restarting simulator works for me :)
One more possible solution: I had my Resources folder added to the project as a folder reference (the blue folder icon). That caused the trouble, after adding the folder as a group the problem went away.
I really find the answer for me :)
for me,
project setting -> your target -> build phases -> validate setting -> perform
and now the problem is gone.
:)
I hope someone it help
I solved this problem how:
1) iOS Simulator->Reset Contents and Settings...
2) Sure project name, scheme name and target name is identical. "AppName" and "Appname" is not true. Must be "AppName" and "AppName", or "Appname" and "Appname".
3) Restart XCode and Quit Simulator.
Project name at Build Settings->Product Name.
Scheme name at Product->Manage Schemes. Click on current scheme once for rename.
Target name at Column of Project with Targets. Click once on current target for rename.
Good luck =)
Like Rob said, but also check the "identifier" should read by default "com.yourcompany.YourAppName" I had changed the "yourcompany" by mistake and this caused the same issue noted above.
This also seemed to happen to me when the info.plist file was in the copy build phase. It appears that sometimes Xcode will warn you about this, and other times it won't. Very strange. But if you are experiencing this issue, make sure that info.plist is NOT in your copy build phase.
My problem was also a folder named "resources" on the root source folder. Looks like it conflicts with some internal build naming.
Renaming the folder to "res" solved the problem for me.
I tried everything in this page, and the "new" solution that worked for me was to go into the simulator, and "Reset Content and Settings" in the iOS simulator main menu.
This solution is not technical but it worked for me.
When Attaching to Process shows up in xcode and it hangs for a while, just quite the iOS simulator and re-launch the app by pressing Command + R.
It will launch the app without any issues :)
I tried everything and nothing worked. I have an old project from XCode 3. I simply renamed info.plist in the project to another name, restarted the simulator and everything is working fine since.
I frequently encountered this problem after renaming a project in Xcode 4.
I was able to fix it by editing the Bundle Identifier in the .plist file.
After I renamed the project, the Bundle Identifier would change to something like this:
com.yourcompany.${PRODUCT_NAME:rfc1034identifier}
changing it back to this:
com.yourcompany.${PRODUCT_NAME}
will stop Xcode from hanging and allow the App to run.
For me, none of these has worked. I realized that my project had 2 info.plist files (with two different names, like info.plist and Project-info.plist), so XCode got confused. I just removed the incorrect plist file, and it worked!
Under Product > Edit Scheme > Run > Info, changed the Debugger from LLDB to GDB worked perfect for me!
I had the same problem. The issue was there was one more user who was logged in and had the simulator running. Think there can be only one instance of iphone simulator running on a machine even for different users. Hope this info would be useful for somebody :)
What worked for me is the following:
In XCode:
Click on project name
Click on target name
Click on "Build Settings"
Reveal "Product Name" contents (click on triangle)
Make sure the name of all items matches that of project name
Example
Product Name myapp
Debug myapp
Release myapp
Reveal "Deployment" contents (click on triangle)
Make sure there is a "IOS Deployment Target" item
Example
IOS Deployment Target IOS 3.0
Debug IOS 3.0
Release IOS 3.0
Then clean and run.
This is what worked for me:
In Xcode navigate to the Product menu and choose EDIT SCHEMES.
In the list on the left choose Run YourAppName.app. From the Executable menu choose OTHER.
Navigate and choose your .app file in your project directory.
Now run and it works :)
I noticed it happened to me when I edited the scheme from Build Release to Build Debug.
I changed back, and it worked :)
What worked for me:
Launch "Monitor" and kill gdb-i386-apple-darwin which was supposedly hung
Restart iOS simulator
My solution is correcting the nib name. (I changed my nib name before for an iPad version but then I deleted the iPad nib file). Then it works well again.
All of the above suggestion didn't resolve my problem.
After I added the Resources folder and and compile, it hangs on attaching to app-name.
I removed Resources folder, still hang.
I removed the project and recreate a new one ( with the same name ) but still having problem.
If it was different name then it's ok. I restarted the OS but still doesn't help.
To solve the issue, I did the following:
1. ps -ef | grep Xcode, and kill all the "Xcode" processes.
2. Reset the content of Simulator, and quit the Simulator.
3. Product > Clean to clean up the build.
4. Compile and run the product. It should work at this point.
Hope it helps some else having this similar issue.
I encountered this error after incorporating another project inside my new one. Make sure you delete the project that you have added's info.plist and .app
Just came across the same problem: restarting the simulator and Xcode didn't work for me, while restarting my mac worked out pretty well!
After all said and done. I had to stop the simulator. Then the message change to downloading Mac OS X 10.6 core library.
Create a new user account, switch to account, open XCode and try running the project. After trying all of the other suggestions with no success, not only was I again able to run on sim, but the original account now works.

Receive message "A signed resource has been added, modified, or deleted" when trying to debug an App on iPhone

While attempting to debug a build created using the 3.2 SDK on an iPhone device I receive the message "A signed resource has been added, modified, or deleted.".
I can clean, rebuild, then install with no error, but if I try to install without cleaning the error shows.
Anyone have an idea as to what might be causing this?
I found a workaround for the bug.
If you delete the .app file in build/Debug-iphoneos/ before building for the device, the app gets installed without errors.
And there is a simple way to do that before every build.
Make sure you have selected "Device" in the dropdown overview menu.
In XCode go to Project > New target...
Then find "Shell Script target" under MacOSX/Other
Name it and add it to the current project
Now, in the left navigation panel, under targets, expand your newly created target and double-click on Run Script.
In the window that opens replace "# shell script goes here" with "rm -fr build/Debug-iphoneos/*.app" (without the quotes).
Now open your main target preferences and under Direct Dependencies add your newly created target.
Build and Go! :)
This error occurs when there is a special character in the Product Name. In my case it was a "?"
If you change the Product Name it automatically updates the "Bundle Name" and "Bundle Display Name" so it is often the best choice to rename an app.
If you want to include special characters in the app name you have to manually rename the "Bundle Name" and "Bundle Display Name"
Bundle Name: This is the actual app bundle name in the file system such as "Awesome App.app". It is generally not visible to the user.
Bundle Display Name: This is a short name displayed under the app icon on the device. Since the bundle name would be truncated to "Awes…tion" you have the option to have a shorter name which fits better such as "Awesome App". It should be similar to the App Store name (set in iTunes Connect)
This is pretty clearly a bug in the 3.2 SDK, but I don't want to downgrade. I've found that doing a Clean by pushing Command+Shift+K, then Return is pretty fast before pushing Command+R to build.
Xcode 8, reason of the "A signed resource has been added, modified, or deleted." was that target was signed with an enterprise provision profile.
In my case, it happened when no changes were made. Make a change to any file and run again.
This can have several causes. The fastest way to figure out what is causing it is to go into Xcode, Window menu, Devices, then click the reveal button at the bottom of the pane to show the Console. Now attempt to run. You should see log output that names the specific files it is complaining about.
Most of the solutions previously posted are just artificial ways of getting Xcode to regenerate the contents of the build folder and/or re-sign the files.
In my case, my WatchKit extension was somehow acquiring references to Cocoapods frameworks that were only targeted toward the main app so they got signed during the build, then pruned later (as they were not used). Then on device, iOS complained that they were missing from the .appex folder for the extension. I ended up not needing any pods in the extension so I just removed them all and removed the extension as a target, then did some minor cleanup to remove the pod-related debris left in the build steps. Now everything works perfectly.
(SOLVED) This is a weird one. I tried everything I could find. Eventually I changed the product name from "Unit Tests (device)" to "Device Unit Tests" - removing the brackets. Now everything works. The spaces in it appear to be fine.
Previously on stackoverflow:
I've just run into this bug with two static library projects. One builds and tests using the GHUnit test runner on the device without a problem. The other projects will not install and gets this error. That means it's something thats different between these two projects. I've so far tried wiping the build directory, taking spaces out of the executable name, and various clean and builds as suggested here.
Same for me, thought it has something to do with multiple targets etc. because I changed a lot there. But it's highly possible that it's a Bug in the 3.2.2 release since I did not test extensively in this sdk version before the massive target changes in my project.
solved my issue!!!
I found out by accident that somehow a space " " found it's way into the Product Name of my app so it was called "First Second.app" instead of "FirstSecond.app". After deleting the space the issue was gone!
I changed it here:
right click on target
Get Info
Build Tab
Packaging Section
Product Name <- The name here will be used for the bundle (.app) name
Hope this helps, let me know!
Cheers,
nils
I could solved by changing project name.
[project]-[Rename] menu. "phase1 (new)" -> "pahse1"
I was getting this same error, but intermittently. I tried all the above and it still didn't work. Today I found what was causing it.
The error seems to occur when editing a xib in interface builder. If you try to run while the interface builder is open in xcode it will cause the above error. To solve just close the interface builder editor. i.e. just select a code file from your project so you are in the Source Editor.
The simplest (and probably most common cause) appears to be rebuilding without any changes.
So the simplest thing to cure it is to make a trivial change to a source file (such as adding a space, then deleting it), and then rebuilding.
If this doesn't work, feel free to try all the other answers here.
For months, I'd get this error without realizing it was due to such a simple cause. I'd usually do a Clean Build to get rid of it.
When I created ipa through terminal using xcodebuild commands, ipa created but while installing it I was getting same error. exportOptionsPlist solved my issue.
xcodebuild -exportArchive -archivePath projectPath/myapp.xcarchive -exportPath projectPath/myApp.ipa -exportOptionsPlist ProjectFolder/exportPlist.plist
In my case, Quit and restarting XCode worked.
For me the issue was related to the provisioning profile settings. The clue to this was that debug builds were installing ok, but release builds were not. I wanted to test a release build, so I ran the scheme with that build configuration.
I fixed it by duplicating the Release Configuration, then modifying those fields in the Build Settings to have the same provisioning stuff as if I am debugging it.
(Adding another build configuration will give you headaches if you are using Cocoapods however, then you'll have to modify your Podfile)
I'm getting the same thing, when installing on a iPod Touch. I can't link for the simulator (for other reasons), so can't say whether the problem occurs there.
Yes, rebuilding clean or deleting the app from the device allows me to install again. Neither are desirable, iterative solutions!
The minimal "cleaning" I've come across as a work around is manually deleting the Foo.app in the build/Debug-iphoneos directory.
it seems this is a bug in xcode 3.2.2:
iphonedevsdk
I had the same problem in Xcode 3.2.1 when I put a + in my app name. Specifically the "product name" in the build settings. It is fine to have a + in the bundle name in your Info.plist. The same probably applies to other punctuation characters.
Go to Window > Organizer > Projects > Find your project and delete derived data
I got this error intermittently while installing app using iPhone config utility on Windows7. Following solution works - Go to C:\Users\{lanusername}\AppData\Local\Temp and delete app specific folders (e.g. abc.app) and try installing app again.
I reported this bug on ICU (Windows versions) to Apple in June 2011. With the following workarounds:
The workaround is this ....
Win XP
1) Close ICU
2) Delete the temp folder: c:\Documents and Settings\[username]\Local Settings\Temp\[AppName].app
3) Delete the deploy folder: c:\Documents and Settings\[username]\Application Data\AppleComputer\MobileDevice
4) Restart ICU. Drag in the App and install normally.
============================
Win 7
1) Close ICU
2) Delete the temp folder: c:\Users\[username]\AppData\Local\Temp\[AppName].app
3) Delete the deploy folder: c:\Users\[username]\AppData\Local\Apple Computer\MobileDevice\Applications\[AppName].app
4) Restart ICU. Drag in the App and install normally.
=========================================================
I simply rebuilt my app, and that solved the issue.
I also faced the same issue. After wasting lot of time I realized that my product name has a special character "?" which cased the problem
Having the DerivedData folder at a network location caused this problem for me.
After trying everything else, I found out my workstation couldn't agree with the University server about what the time was. (It thought everything was always modified). I also had to clean for every rebuild to avoid that frustrating message.
In the end I gave up and built locally, changing Xcode > Preferences > Locations ... feeling altogether pretty dumb for having ever built over the network.
We ran into this issues on XCode_6.3.1. We were building a AppleWatch app, with an extension. We do have a bunch of Pods.. After debugging the issue for almost a bunch of hours, what we found was that there was an issue with the way a file was adde to the project..
It seems like some references to a unused file was sitting in the iPhone App, though it was used in the Watch App.. It turns out that the error XCode was showing was totally useless.
After removing this file and re adding it back to the project the project started working fine & was able to install to the device. To make it even harder to debug the issues, the debug version was installed without an issue, but was unable to install the norman version..
Make sure you add your files to the right target and, look at git history and see if there are lingering fragments that are added to the wrong target.
This is a very general error message indicating something is wrong during the validation process of the code signature. To find out the specific error, you can go to Xcode->Window->Devices and check your device log.
In my case, I have following console spew
Feb 1 18:53:07 iPod-touch installd[40] : 0x1001f8000 -[MICodeSigningVerifier performValidationWithError:]: 192: Failed to verify code signature of : 0xe8008017 (Signed resources have been added, removed, or modified)
Check on this 3rd party framework again, I found an extra CodeResources file under the framework root. Remove that file fixed the problem.