Groups keyboard shortcuts have been updated
Dismiss
See shortcuts

"Creating Objective-C Class Pair has failed" error from XcodeCapp

35 views
Skip to first unread message

Luke

unread,
Jan 30, 2024, 10:20:23 PM1/30/24
to Cappuccino & Objective-J
I have a new Mac (Apple ARM chip).
I did manage to get XcodeCapp built after messing with the project settings and it seems to work in the sense of the UI being functional and in general working as I remember it. 

However, when I open a project copied from my older Mac, I get a bunch of "Creating Objective-C Class Pair has failed" notifications and in the "Errors and Warnings" tab, there are a number of "env: node: No such file or directory" warnings and 
 "Unable to parse: env: node: No such file or directory" error messages, which are presumably what the notifications are about. 

I'm pretty sure I haven't messed with the project structure:
- My .j files are all in the top level of my cappuccino project
- There's a Resources folder at that level too
- That's where the .xib file resides, and indeed the .cib file(s) from prior conversions
- In the Resources folder is the .XcodeSupport folder, which is where the pairs used to get created in the old installation, but evidently not at the moment. 

Given that 'node' is cited in the error messages, I checked that node is definitely installed and on the system path (it is) and I even added its location to the "Additional Toolchain Paths" in XcodeCapp, but to no avail.

Running nib2cib manually on my .xib file does work fine, creating an updated .cib file in the Resources directory, but I'll need the XcodeCapp working properly I think as Xcode is fussy these days about seeing the objective-c source files for enumerating the allowable outlets etc. that can be set in the xib.  

Any clues?

-- Luke




Michael Bach

unread,
Jan 31, 2024, 3:43:53 AM1/31/24
to objec...@googlegroups.com
Dear Luke:

> I have a new Mac (Apple ARM chip). I did manage to get XcodeCapp built after messing with the project settings and it seems to work in the sense of the UI being functional and in general working as I remember it.
> …
> Running nib2cib manually on my .xib file does work fine, creating an updated .cib file in the Resources directory, but I'll need the XcodeCapp working properly I think as Xcode is fussy these days about seeing the objective-c source files for enumerating the allowable outlets etc. that can be set in the xib.

If I remember correctly, XcodeCapp is not up to snuff yet (though Richard is working on it). When running into this problem nearly 2 years ago, I developed a shell script that for me replaces XcodeCapp. You can take a look here:
https://github.com/michaelbach/FrACT10/blob/main/_make-XcodeCapp.sh

It makes a number of simplifying assumptions, e.g. only one `MainMenu.xib` and the existence of (a largely empty) `XYZ.xcodeproj`. Maybe this helps you. For me that has been working for (literally) over 100 Cappuccino programs. I invoke it with a shortcut in Xcode, where one can call scripts.


Best, Michael
--
https://michaelbach.de

Luke

unread,
Jan 31, 2024, 3:56:39 AM1/31/24
to Cappuccino & Objective-J
Thanks Michael.  I'll give that a go.

I intend to try more of a debugging session on XcodeCapp tomorrow.
 
However, so far I can see it trying to launch objj2objcskeleton correctly:
Task launched: /Users/luke/.npm/bin/objj2objcskeleton
(
    "/Users/luke/Projects/myapp/cappclient/Constants.j",
    "/Users/luke/Projects/myapp/cappclient/.XcodeSupport",
    "-n",
    Constants
)

Indeed, if I run objj2objcskeleton manually with exactly these arguments, then it works perfectly, with the .m and .h files appearing in the .XcodeSupport directory. 
However, under the auspices of the NSTask (and I note a lot of concurrency... so maybe even a race of some sort, and I'm now on a very fast Mac!) the command always seems to fail with this "env: node: No such file or directory" result. 

Anyway, thanks for your help. 

Martin Carlberg

unread,
Jan 31, 2024, 4:42:28 AM1/31/24
to Cappuccino & Objective-J
Hi Luke,

Using Michael's script works really good. I can recommend it.

The problem is that there are some Python2 scripts in XcodeCapp and MacOS has moved to only install Pyhton3...

The XcodeCapp application is patched in the node version to run with all functions except those using the Python scripts. This allows nib2cib and objj2objcskeleton to run on changed files. Functions like creating Xcode project file and some other things does not work. When using this patched version it is important to set the Additional Toolchain Paths in XcodeCapp to where the tools are after installing the node version.

This was just a temporary fix and the real solution is to rewrite the Python scripts to Python3 or other language. 

- Martin

-- 
You received this message because you are subscribed to the Google Groups "Cappuccino & Objective-J" group.
To unsubscribe from this group and stop receiving emails from it, send an email to objectivej+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/objectivej/1a65eab2-0e2e-4c32-9142-a30c46be9c0fn%40googlegroups.com.

Luke Evans

unread,
Jan 31, 2024, 4:54:02 AM1/31/24
to objec...@googlegroups.com
Thanks Martin.

I actually checked out the node version of the cappuccino tree and built the XcodeCapp from that tree, but evidently it still has problems,
However, I was running this (node) version on a much older (Intel) MacBook only about 6-9 months ago, and XcodeCapp was working fine in all its functions.

 


You received this message because you are subscribed to a topic in the Google Groups "Cappuccino & Objective-J" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/objectivej/UDeIGLIoXPY/unsubscribe.
To unsubscribe from this group and all its topics, send an email to objectivej+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/objectivej/88F60468-2705-4B78-9C95-49DFF405567A%40oops.se.

Michael Bach

unread,
Jan 31, 2024, 4:58:22 AM1/31/24
to objec...@googlegroups.com
> …However, I was running this (node) version on a much older (Intel) MacBook only about 6-9 months ago, and XcodeCapp was working fine in all its functions.

Maybe that was on pre-pre-Sonoma?

Martin Carlberg

unread,
Jan 31, 2024, 5:54:01 AM1/31/24
to Cappuccino & Objective-J
Yes, the problem is the Mac OS version. Earlier Mac OS versions had Python 2 installed but that has changed and the latest couple of versions has Python 3. XcodeCapp will not run with Python 3.

I'm running the node version of XcodeCapp myself on Sonoma on a M1 MacBook Pro and it works well with the limitations and needs I described above.

- Martin
> --
> You received this message because you are subscribed to the Google Groups "Cappuccino & Objective-J" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to objectivej+...@googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/msgid/objectivej/D5FDCCD3-DA9B-4F86-ACEC-8B947CF6B39B%40gmail.com.

Luke Evans

unread,
Jan 31, 2024, 3:40:55 PM1/31/24
to objec...@googlegroups.com
Got it. Thanks again.
> You received this message because you are subscribed to a topic in the Google Groups "Cappuccino & Objective-J" group.
> To unsubscribe from this topic, visit https://groups.google.com/d/topic/objectivej/UDeIGLIoXPY/unsubscribe.
> To unsubscribe from this group and all its topics, send an email to objectivej+...@googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/msgid/objectivej/24ED7A63-542F-4C4C-9865-9698413A925D%40oops.se.

Reply all
Reply to author
Forward
0 new messages