Could Not Find or Load Main Class - Unable to Upload Any App Updates...

This all started after I updated Xcode on Oct 21. Since then, I've been unable to upload any app builds to AppStoreConnect. This is Xcode 12.1 (12A7403).

Error Message:
Could not find or load main class HD.Users.username.Library.Java.Extensions:.Library.Java.Extensions:.Network.Library.Java.Extensions:.System.Library.Java.Extensions:.usr.lib.java:.

My main disk is called "Macintosh HD". It looks like however they have the build script setup it's dropped the "Macintosh" part off.

Updating Xcode has become a crapshoot because every time I update, I have to spend hours figuring out and fixing whatever broke. So far I've been unsuccessful with this particular one...

Accepted Reply

Found the issue and have a fix.

Go to:
/Applications/Xcode.app/Contents/SharedFrameworks/ContentDeliveryServices.framework/Versions/A/itms/bin

You'll find:
iTMSTransporter

This is simply a build script so open it up in your favorite text editor (I like TextMate).

Change this line:
JVM_LIB_PATH="-Djava.library.path=${ESCAPED_WOA_TOP_LEVEL}/macOS/lib:${HOME}/Library/Java/Extensions:/Library/Java/Extensions:/Network/Library/Java/Extensions:/System/Library/Java/Extensions:/usr/lib/java:."

To this:
JVM_LIB_PATH="-Djava.library.path=\"${ESCAPED_WOA_TOP_LEVEL}\"/macOS/lib:\"${HOME}\"/Library/Java/Extensions:/Library/Java/Extensions:/Network/Library/Java/Extensions:/System/Library/Java/Extensions:/usr/lib/java:."

Basically just add a few backslash-escaped quotes around ${ESCAPED_WOA_TOP_LEVEL} and ${HOME}.

Enjoy successful Xcode uploads again!!

:)

Add a Comment

Replies

As a temporary workaround I used "Transporter" from the Mac App Store to get the IPA uploaded.
I have the same problem since the beta version of Xcode 12. In the release notes of Xcode 12.2 they said they've fixed this problem (or maybe a similar). But it still doesn't work for me.
Do you see any improvements with Xcode 12.2?
any luck solving this?
im using Xcode 12.4 on BigSur11.2.1 and am having this issue in both Xcode and Transporter. ...can you see something i'm missing

Could not find or load main class 1.Library.Java.Extensions:.Library.Java.Extensions:.Network.Library.Java.Extensions:.System.Library.Java.Extensions:.usr.lib.java:.

Its becoming very embarrassing as my customers can't understand why i can't provide updates and new test versions. ...it appears to me these apps can't find where java is on my system???...i've tried a few things but no luck [im not that MacOS smart and rely on apples tools to work]

thanks
R

Has anyone figured a solution to this problem?
5 months later and I still can't upload apps through Xcode...

Transporter is still working as a backup method for now.

Archive in Xcode -> Distribute -> Export

Then add the IPA to Transporter.

Tried using altool in terminal and it fails as well. I need to be able to send app updates through Xcode, but I guess since Apple won't help out here I'll be diving into this more myself this week. Will report back when I find something.
Found the issue and have a fix.

Go to:
/Applications/Xcode.app/Contents/SharedFrameworks/ContentDeliveryServices.framework/Versions/A/itms/bin

You'll find:
iTMSTransporter

This is simply a build script so open it up in your favorite text editor (I like TextMate).

Change this line:
JVM_LIB_PATH="-Djava.library.path=${ESCAPED_WOA_TOP_LEVEL}/macOS/lib:${HOME}/Library/Java/Extensions:/Library/Java/Extensions:/Network/Library/Java/Extensions:/System/Library/Java/Extensions:/usr/lib/java:."

To this:
JVM_LIB_PATH="-Djava.library.path=\"${ESCAPED_WOA_TOP_LEVEL}\"/macOS/lib:\"${HOME}\"/Library/Java/Extensions:/Library/Java/Extensions:/Network/Library/Java/Extensions:/System/Library/Java/Extensions:/usr/lib/java:."

Basically just add a few backslash-escaped quotes around ${ESCAPED_WOA_TOP_LEVEL} and ${HOME}.

Enjoy successful Xcode uploads again!!

:)

Add a Comment

This worked for me as well 👍.

This bug is still there as of Xcode 12.5.1... Fix still applies.

Would be nice to get this patched into the release builds of Xcode since the default disk name is "Macintosh HD" and the space in that breaks the included build-scripts.