i have an app which works perfectly on the simulator but on the device in is not as expected.
Animations are misplaced and other bugs. But on the simulator it works fine.
My question is how to fix this bug.
Here is list of things I already tried:
Restart Mac.
Restart Xcode.
Clean Project.
Rename Project.
Delete app from iPhone.
Restart iPhone.
Shut down iPhone.
Clean and build in Xcode.
I really don't know where is the problem.
Thank you for your help.
Would be really appreciated.
Notice: App is correctly signed.
Make sure your files typed correctly and are case sensitive. The Simulator is not case sensitive but the iPhone is.
Did you ever move code/xib files into different groups or directories? Sometimes there is a old copy of the file in the original directory after the move. I've had scenarios in which those old files caused the old code to executed when switching between build settings.
If there are duplicate files, make sure you delete those copies at the old location, or those that you don't intend to be used. For instance, if your original directory as ~/Work/App/Resources and the new directory is ~/Work/App/Resources/xibs then delete the duplicated files from ~/Work/App/Resources
Make sense?
Now, after deletions, if files start to show up as red in XCode, that means XCode cannot find them anymore (maybe you deleted one too many, or who knows the state of your workspace). If this happens, use the "File Inspector" to confirm that the location and path XCode is using for the file is correct.
Related
I'm developing a new application for Iphone, using Xcode (Version 4.6 (4H127)) and the iPhone 6.1 simulator (Versión 6.0 (369.2)).
At the beginning everything was great: every time I pressed the "run" button, the application was loaded into the simulator and I was able to test it. But sometimes it is not working: when I press the run button, I only get the message "Finished running on iPhone 6.1 Simulator". The code successfully compiles (only minor warnings).
The main problem is that when I get this message, the only way I can use the simulator again (in this project, the rest of the xcode projects seems to work properly) is by starting a new project and adding every file to it.
I've tried to delete de derived data, restart de simulator, restart de computer, etc. Even I made a snapshot when the simulator was working, but when I go back to the snapshot state, the simulator still don't work.
What can I do? Any idea?
1.Manually launch the iOS Simulator.
2.From the "iOS Simulator" menu, click "Reset content and settings",
3.Close and rebuild your app.
This problem may arise when you have problems with your project's plist's target membership. Select your info plist file from project navigator folder structure's Supporting Files, go to interface builder pane(Utilities Section under View in Top Bar), then look for Target Membership in File Inspector pane, if it is checked, uncheck it. Clean & Build, Hope it helps.
Library > Application Support > iPhone Simulator > 6.1 (or whichever you're using) > Applications > Your Application and delete it.
Rebuild your app and relaunch.
I had the same problem, with the same "failed to attach to process ID 0" (I actually didn't notice that error until I saw that you said you had that error). In one of my projects the 6.0 simulator didn't work, but works in my other projects. Also my 5.1 simulator worked.
What worked for me was based off this other answer for a similar question: https://stackoverflow.com/a/12423912/159758
Go to the Product menu and find the Edit Scheme menu there.
While in Edit Scheme window, select the "Run" option on the left hand side of the screen and then on the right hand side, change the debugger from LLDB to GDB.
Run the project, this worked in the simulator.
Then Go back to the Edit Scheme and set back to LLDB.
I noticed you've tried setting the debugger to GDB and not a debugger, but thought I'd mention what helped me, since you're question helped me get to the bottom of my problem (i.e. seeing the "failed to attach to process ID 0" message).
This problem may arise due to presence of more than one info.plist file.
I also faced a similar problem, and eventually found that while adding some resource file from another project I also added its info.plist file.
Once check your Build phases> Copy Bundle Resources, whether another info.plist file exist there or not. If exists then delete it, clean the project and rebuild it.
Hope it helps.....
I ran into the same issue and somehow was able to fix it and almost immediately it went back to being broken. I can tell what broke it though.
I added a couple of folders (folder references) with files in them to the copy bundle resources section. That broke it. If I recall right, I had removed both of those and was messing around with DeploymentTarget. I might have reset the simulator earlier. Regardless, it started working. So,
there is hope for a fix
this thing is caused by folder resources that need to be copied into the bundle
Updated:
I was able to get it working again. Here is what I did..
- Cleared out the derived data folder
- Shut down the simulator app
- Also cleared the deployment in the simulator folders (Users/XXXXXX/Library/Application Support/iPhone simulator/6.1/Applications)
Since last time adding the folders to the bundle caused it to lock up, I tried it step by step adding one folder to the bundle and trying. Turns out one of my folders was named Resources and it dawned on me that particular name could potentially be colliding with something else the app looks for. So I renamed that folder to Res and tried it. It works now.
So there you have it.. Follow the steps above to get out of the problem.
Avoid copying folders called Resources to your bundle.
I am getting old files in my documents directory and not sure why.
On the simulator it works as expected. I can update the files no problem. I just delete the app. from the springboard and rebuild. I can easily verify the files are the correct ones.
But, when running on the iPhone, old versions of the files show up. I do always delete the app of course. And if I go to the project and delete the files and verify in the build phase that they are not included, they still show up on the iphone.
I have rebooted the mac and the phone, no change.
I even found under organizer how I can download the files from the iPhone and they do show the old files, but I am not sure how they got there as I don't think I am asking for them to be copied...
thx for any suggestions!
After finding the compile output, I saw that xcode was copying from a directory called "DerivedData" and then I found posts about possible issues/bugs.
Here is a link to the fix
I am trying to clean up my app before I submit it for apple approval, but I have an issue. I have delete some unwanted background images but the app seems to think they are still there. I have delete the app completely from the phone but when I build it is still there. The image has been completely remove from the Mac it doesn't exist anywhere not even in the simulator folder
/Users/******/Library/Application Support/iPhone Simulator/5.0/*********/appname.app
I can't seem to figure out whats going wrong.
I have had a look at a few questions like
Xcode- Deleted images appear in simulator
but this doesn't work, I have also tried
Attempting to delete an image from Xcode 4
when it builds it just adds it back in.
Can anyone help? or advice where I can find some help?
Delete it and then, from Xcode, perform that:
Press Shift+Cmd+K
Alt+Shift+Cmd+K
It will empty your cache and clean your build folder.
Product -> Clean or ⌘-Shift-K.
In the project tree click the name of the project name, select targets and build phases tab. There will be a section named "copy bundle resources", if you can see the name of your file, delete it from there. Then follow others' solution to clear the cache and make a clean build.
Edit: Also check Xcode- Deleted images appear in simulator, I guess your question is answered there.
Have you tried cleaning your project and then building it again ? (It might still used the already built .app file when you uploaded it again to your phone)
i think thats happens because of you are deleting the reference of images so that images are still in the folder of your project so do these 3 things.
1. go to your project folder where it is saved and search those images and if you found those images in that folder than delete them.
2. clean your project. from product->clean
3. delete app from simulator
after that try again i think your problem is resolved.
Recently, after upgrading to Lion and Xcode 4.2.1 I am getting this error when trying to run my app on my iPhone 4S:
"The application bundle does not contain a valid identifier."
My identifier is indeed valid, and I have been able to run my app with this identifier earlier.
The problem might appear when I change computers.
I have two computers that I am using to code my app, and I am using Dropbox to keep track of my files.
Restarting XCode, my mac and my iPhone does not work.
Cleaning the target and rebuilding does not work.
The only thing I have been able to do to fix it is to create a completely new project and moving my files. This made things work until I swapped computer. Now I am in the same trouble again.
Any idea? Anyone?
Three suggestions:
Check that your developer key is in both computers
Did you try to update the project? There is a strangly-named key in the middle bottom under the project's properties. Try this.
I had similar issues. I found that some things weren't updated when I updated osx and xcode. To get out of the situation, I would suggest creating a new project and copy paste code, files and build settings. This might seem stupid, but you know apple is not good at creating IDE's. You might just get your self lost in the undocumented settings.
I'm facing a weird problem dealing with Xcode. When I run my project using simulator I got the correct xib showing, but when I select my iPhone as target, it shows an older version of that xib... I'm going crazy with this, I have tried to clean targets, deleting and reinstalling the app on iphone, :^S
Please could anybody help me with this issue?
Thanks a lot and sorry for my english.
When Xcode installs development builds of iOS apps on the simulator and on the device, it copies all files from the .app bundle into the target directory for the app in the simulator or on the device. However, it does not remove old files. This can sometimes cause strange effects.
For example:
You have MyView~ipad.xib and MyView.xib for iPhone, you install the app and run it on the device, now you decide to delete the MyView~ipad.xib so that it will just use the MyView.xib same as iPhone, you test this in the simulator and it works fine but when you put it on the device again it still uses the old iPad xib file, but how when it's not even in the project any more? Well the old file still exists in the filesystem on the device until you actually delete the app off the device.
This can happen when you remove files from the project or rename them to something else, the old files will still be there and especially if you have fall-back beaviour or how iOS can look for other suffixes automatically like #2x or ~ipad - this can easily cause confusion. Check for this whenever you notice strange effects like old versions of files seem to resurrect themselves, or it works on one device but not the other.