Multiple Xcode Installation - objective-c

After a fresh install of Lion and Xcode 4.1 from the Mac App Store, I would like to install another version of Xcode alongside.
I heard that this perfectly safe to install it in another directory (considering the first to be on /Developer). The only thing to remember is that running xcodebuild would result in launching the last one installed.
But I have another issue while installing it, even f I changed the directory it clearly says that it will upgrade Xcode Toolset, System Tools and UNIX Development and that they can only be located is /Developer and for one installation per system, here is a screenshot :
So how to have another clean instance of Xcode and SDKs without screwing up the production one ?
Thanks a lot.

It doesn't seem to be possible to install the System Tools on both versions. I've never had success with that.
One thing to note, if you install an older version of xCode side-by-side with the latest version, the "Build Archive" function in the Organizer will not function. The only remedy I found was to remove both xCodes and reinstall the one I wanted to use for building the archive. It was a painful process.

Actually you can do this (or at least I seem to be able to). At times I have had three separate instances of XCode installed - an older XCode 3.x (which I've subsequently gotten rid of), an XCode 4 production, an XCode 5 beta; all in separate directories.
The key thing for me was calling the command line tool to tell which system is the "primary" xcode for the purposes of running xcodebuild, instruments, agvtool and a bunch of others: xcode-select -switch /Developer (just man xcode-select ftw).
So, I have a 4.0.2 build as primary now, and keep upgrading the iOS5 betas. I try them out, but when I want to cut a production build using 4.0.2, I ensure that my system knows that /Developer is current, switching it if I need to. FWIW, there is risk that the single-set-of-System-tools could be broken when you replace them with the latest set, but that's (so far) never hit me.
Also, for reference there is another discussion along similar lines here: Install xCode 3.2.3 w/ iPhone SDK 4, get "Base SDK missing", can't see other SDKs

Related

My Netbeans 12.2 on Ubuntu only has lightweight & temporary C++ IDE, can't find the real one

In Netbeans 12.2 on Ubuntu 18.04 (using that snap install), for my C++ plugin I have that first image. When I try to create a new project I get that second image. That is some kind of a lightweight version that does not do your makefiles for you. If I try to open an existing C++ project it just never IDs any project file or folder as the right one. And notice that this version does not include a "Create from source code".
Does anyone know how I can install the "real" c++ plugin? I've looked in a lot of tutorials but they all say it should be there under Available Plugins, but it is not there.
This comes very late but it seems that Netbeans 12 lacks some components for this.
Therefore you must enable Netbeans 8.2 Plugin Portal from Plugins Settings.
Then deactivate the C/C++ and then force updates from Updates -> Check for Updates. Restart IDE and install 8.2 C/C++ plugin.
Note: I have lead into this problem now because unpack2000 is no more present.
The validation of downloaded plugins cannot be completed, cause: NBM ../.netbeans/12.4/update/download/org-netbeans-modules-cnd-kit.nbm needs unpack200 to process following entries:
netbeans/modules/locale/org-netbeans-modules-cnd-kit_ja.jar.pack.gz
netbeans/modules/locale/org-netbeans-modules-cnd-kit_pt_BR.jar.pack.gz
netbeans/modules/locale/org-netbeans-modules-cnd-kit_ru.jar.pack.gz
netbeans/modules/locale/org-netbeans-modules-cnd-kit_zh_CN.jar.pack.gz
netbeans/modules/org-netbeans-modules-cnd-kit.jar.pack.gz
This can be resolved by installing jre-11 (if it is not present already. I have it on Opensuse Thubleweed amogst with jre-16).
So then you just start netbeans from terminal with:
$ netbeans --jdkhome "/usr/lib64/jvm/jre-11"
...and then install blugin, and when it is ready close netbeans and start it normally again.
Just wanted to report that the answer from Devspain also works with Netbeans 14, in Ubuntu 22.04.

CocoaPods : cmd-line builds

It seems that in cmd-line builds, Pods don't get built automatically. Even when invoking xcodebuild to reference the workspace that declares how projects link to each other.
Is there a way to fix this, besides manually opening the project in Xcode and building?
I don't have any problem with such configuration: CocoaPods 0.28.0 and Xcode5 (+ Command-Line Tools) here and building using the Command-Line quite often (especially for Continuous Integration) without having any problem.
Neither with the Apple's xcodebuild command, nor with xctool (see also this NSHipster's article) when building my personnal project using Travis-CI either, everything works fine;
At work we have plenty of Xcode workspaces created using CocoaPods / pod install and we use Jenkins-CI to run xcodebuild to build them and no problem either.
Maybe you need to check a bit more about your configuration? Which CocoaPods & Xcode version, Which Command-Line Tools (xcode-select --print-path?), How is you Xcode configured (maybe you changed some of Xcode's default settings that broke it somehow)?
Tell us more about your specific configuration and the error/warning messages you got, because there should not be any problem.
Also make sure you have an up-to-date version of CocoaPods (some stuff were fixed some versions ago regarding Xcode5 and the new arm64 architecture, that broke implicit dependency detection in some cases)

Strange application behavior when building a project with the latest xcode/OSX version

I have an OSX application written in Objective-C/Cocoa using xcode. The application is quite finished, tested and sold on the App Store.
I haven't worked on this application for some time and recently, I rebuilt it using xcode 4.3.3 on my OSX 10.7.4 and I noticed that while it builds just fine, there are some very strange visual glitches when running the application that were never seen before and occasionally, I get EXC_BAD_ACCESS when closing the application. All these seem to be related to the PDFKit framework I am using. I am unable to debug these problems since the glitches are just visual (nothing I can check in code) and EXC_BAD_ACCESS exception comes from internally allocated objects not related to my code.
The code itself haven't changed, I tried previous revisions of the code and they all exhibit the same strange behavior now. I tried running an old binary I have of the application (compiled couple of months ago) and it works just fine. Then I tried building it with previous versions of xcode, down to 4.2.1 (which I know was ok when I submitted the app to the app store) and the problems still occur.
Then I suspected this may be something specific to my environment so I built the project on different machine also with xcode 4.3.2 and OSX 10.7.4. Same results, the problems are still there.
So now I suspect that it has something to do with the OSX 10.7.4 update since this is the last thing that was changed between now and when I was able to produce a good build of the application. I am pretty puzzled to what to do next and how to identify the cause of this problem. I have an old binary that is working fine and I have a newly compiled binary of the same code revision that has problems.
Is there any useful information I can get from the difference of these binaries? What can I do to determine the cause of these problems? What can I try next?
Thanks!
NOTE (update): I stated it above but I want to make sure it is clear. This is a Mac OSX Cocoa application, not iOS.
just reset your simulator then try.
I hope you check the ARC information
go to your project Target set build settings --> Search Paths-->Always Search User Paths Set Yes.
And check your all class variables different from one another.
Xcode--> preferences-->Documentation check installed core Libraries (or) install it
like that
Xcode--> preferences-->Components check required component installed or not
check these things in your project.
Are you sure your customers are not having the same problem? Since you have tested the application on a different machine you probably do not have corrupt libraries installed (unless you did not install from scratch but used some migration tool?), so that is probably not the problem.
Most logical explanation to me would be that your customers also have this problem but they haven't reported it yet. In that case, you probably have a memory problem and there are techniques to attack that.
In any case, eliminate all the parameters that you can eliminate to simplify the problem. Deconstruct the application until the problem does not occur anymore or reconstruct the application in a different project until the problem occurs again.
It sounds like a nasty one, but you'll get there in the end, with patience and perseverance :)
First of all, you need check and verify the build log for suspicious compiler warnings.
For EXC_BAD_ACCESS, XCode analysis will give useful information.
You could try 10.6 or 10.5 (need manual installation) SDK. Or restrict the deployment target to 10.5 or 10.6.
I will answer my own question (since none of the above answers really answer it) so anyone with a similar problem might have a hint. I was not able to understand why exactly this happens but I'm pretty sure this is not a problem with my code but rather some glitch on Apple's side. And there is a workaround.
First, I compiled Apple's sample "PDF Annotation Editor" project on my Lion 10.7.4 and while the functionality is obviously different from my project, it also exhibited similar glitches with the PDFView display that my project does when compiled with 10.7.4
Then I proceeded to building a fresh clean system on new hard disk. Intalled Snow Leopard and upgraded to 10.6.8 and ONLY installed xcode. Compiled my project (the source code always stays exactly the same) and everything works fine. No problems seen in the compiled project.
Updated my OSX to Lion 10.7.4 and xcode 4.3.3, same source code. The problem is there after I compile it. I am pretty sure that if I tried 10.7.3 first, I would not see the problem as I remember it only starts with 10.7.4 but Apple doesn't provide any reasonable way to update to 10.7.3 first or downgrade to it after 10.7.4 is installed (shame on them, not very developer friendly!).
So, the problem appears in 10.7.4.
Then I installed the pre-release version of 10.7.5. This was the only thing that was changed, same source, same xcode. To my surprise, the compiled code works flawlessly now and the problems seen with 10.7.4 are now gone!
So my workaround - wait for 10.7.5 release before working on the project further. Hopefully Apple won't screw it in the future with Mountain Lion. I don't think I am going to try and debug it further or submit a ticket to Apple, going to be a tough case to explain.
Thanks for the responses.

How can I fix a missing mscorelib.dll error that occurs when trying to run a Mono for Android app?

In MonoDevelop when compiling and running an app developed for Android against the simulator, the app compiles then crashes immediately in the simulator with the following application output...
E/mono ( 225): The assembly mscorlib.dll was not found or could not be loaded.
E/mono ( 225): It should have been installed in the `/home/jon/Development/xamarin/mono/BUILD/armeabi/install/lib/mono/2.0/mscorlib.dll' directory.
Keep in mind that I'm not Jon so I don't even know where it's getting the /home/jon path configuration. Though I have found that path in other similar but ultimately unrelated searches on the internet so I imagine it's a path on some other devs machine.
mscorlib.dll is indeed on my machine. located here...
/Developer/MonoTouch/usr/lib/mono/2.1/
and here...
/Developer/MonoAndroid/usr/lib/mono/2.1/
I've tried targetting various Android SDK environments (currently 2.3 and the simulator is currently running under the 2.3 SDK environment as well).
I'm on Mac OSx 10.7.2. Using the latest version of MonoDevelop, Mono and Mono for Android. I've also got the latest MonoTouch installed as well and iPhone apps compile fine if that's worth anything.
The closest thing I can find to a hint at the issue is here...
http://phonicuk.com/Forums/ViewThread.aspx?tid=401
I've tried reinstalling Mono and Mono for Android but admittedly have not tried uninstalling in entirely before a reinstall. I've searched within files for the /home/jon path thinking that it must be a configuration somewhere but haven't been able to find it anywhere.
I found this... Mono return error: mono mscorlib.dll was not found
Along with a few other things that were sort of in the same vein, but ultimately nothing that seems to be a fix.
Any ideas?
Update: From the suggestions in jonp's answer below it indeed seems like the Mono.Android.DebugRuntime package is not installed. So far I've tried a couple of MonoAndroid reinstalls and have tried removing MonoAndroid entirely beforehand. I'm trying to figure out if there is a way to add the package manually, but I'm so new to this.
Another update: Not sure why I didn't try this already, but I created a HelloWorld MonoAndroid app and it works fine. The compilation took a while longer too for that one and I could see if was setting up the required packages, so there has to be an issue with the specific solution.
When you install a Debug build of your app on the device, three .apk files are installed:
Mono.Android.DebugRuntime, which contains libmonosgen-2.0.so, mscorlib.dll, etc.
Mono.Android.Plaltform.ApiLevel_N, which contains Mono.Android.dll for API level N.
Your application.
My guess is that the Mono.Android.DebugRuntime package has not been installed. To check this, run:
adb shell pm list packages | grep Mono.Android
I'm going to guess that it's missing. :-)
Next, why is it missing? When you Run the app within MonoDevelop, all required packages are checked for and installed. It seems rather odd that it wouldn't be. Is your device low on disk space?
adb shell df /data
How are you launching the emulator? If you're launching within MonoDevelop, there should be enough free space to install all of the above packages. However, if you launch it yourself, the default /data size is 64MB, which isn't enough to support a Debug build environment. Please launch the simulator from MonoDevelop and re-Run your app, or launch the emulator so that it has enough free space:
emulator -partition-size 512 -avd YOUR_AVD_NAME

clang Can't find any frameworks

I've been tearing my hair out over this, and Google hasn't yielded much so my problem must be caused by my own specific brand of stupidity.
Basically, having installed Xcode 4 I removed the /Developer-old folder (properly, can't remember the command but I used the uninstall script rather than sticking it in the trash).
Xcode builds projects fine, and the latest version of all the Objective-C frameworks seem to live in /System/Library/Frameworks, but when I compile something (which built fine in the Xcode 3 days) clang complains that it can't find any headers, e.g:
fatal error: 'Cocoa/Cocoa.h' file not found
I've tried forcing the framework search path with -F to no avail- is there a common underlying issue or have I just screwed my machine?
Reinstall the developer tools. It will take a lot less time than tracking down whatever you broke.