Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Uploading archive with xcode: Invalid prefix or suffix

Good morning,

I am trying to upload my first app through Xcode. Everything looks fine. I create the archive and if I run Validate App, result is valid.

But whenever I try to upload it it fails with the following message:

There was a general exception while executing. An exception has ocurred: Invalid prefix or suffix.

I haven't found anything similar or any tip of what maybe happening.

Any help would be appreciated.

Update: Using transporter got this log

[2020-02-26 13:19:30 GMT-03:00] <main> DBG-X:   parameter Success = true
[2020-02-26 13:19:30 GMT-03:00] <main> ERROR: There was a general exception while executing
[2020-02-26 13:19:30 GMT-03:00] <main> ERROR: An exception has occurred: Invalid prefix or suffix
[2020-02-26 13:19:30 GMT-03:00] <main> DEBUG: java.lang.IllegalArgumentException: Invalid prefix or suffix
    at java.nio.file.TempFileHelper.generatePath(TempFileHelper.java:63)
    at java.nio.file.TempFileHelper.create(TempFileHelper.java:127)
    at java.nio.file.TempFileHelper.createTempFile(TempFileHelper.java:161)
    at java.nio.file.Files.createTempFile(Files.java:897)
    at com.apple.transporter.transport.http.impl.ObjectStoreTransport.transmitFilesForRequest(ObjectStoreTransport.java:455)
    at com.apple.transporter.transport.http.impl.ObjectStoreTransport.performDiagnostic(ObjectStoreTransport.java:435)
    at com.apple.transporter.transport.TransportByPodPolicy.performDiagnostic(TransportByPodPolicy.java:205)
    at com.apple.transporter.operation.Upload.performDiagnosticForTransport(Upload.java:474)
    at com.apple.transporter.operation.Upload.performUploadRequest(Upload.java:283)
    at com.apple.transporter.operation.Upload.performUploadRequest(Upload.java:129)
    at com.apple.transporter.operation.Upload.performRequest(Upload.java:1268)
    at com.apple.transporter.operation.Verify.execute(Verify.java:120)
    at com.apple.transporter.Application.reallyBegin(Application.java:224)
    at com.apple.transporter.Application.begin(Application.java:114)
    at com.apple.transporter.osgi.TransporterService.start(TransporterService.java:87)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:498)
    at com.apple.transporter.starter.TransporterStarter.runService(TransporterStarter.java:476)
    at com.apple.transporter.starter.TransporterStarter.runTransporterService(TransporterStarter.java:450)
    at com.apple.transporter.starter.TransporterStarter.start(TransporterStarter.java:188)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:498)
    at com.apple.transporter.bootstrap.BootstrapperPhase2.runStartable(BootstrapperPhase2.java:355)
    at com.apple.transporter.bootstrap.BootstrapperPhase2.runStarter(BootstrapperPhase2.java:317)
    at com.apple.transporter.bootstrap.BootstrapperPhase2.start(BootstrapperPhase2.java:130)
    at com.apple.transporter.bootstrap.BootstrapperPhase1.startOSGiFramework(BootstrapperPhase1.java:321)
    at com.apple.transporter.bootstrap.BootstrapperPhase1.bootstrap(BootstrapperPhase1.java:99)
    at com.apple.transporter.bootstrap.BootstrapperPhase1.bootstrap(BootstrapperPhase1.java:59)
    at com.apple.transporter.launcher.Launcher.launchBootstrapper(Launcher.java:37)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:498)
    at com.apple.transporter.launcher.Application.start(Application.java:220)
    at com.apple.transporter.launcher.Application.main(Application.java:658)

[2020-02-26 13:19:30 GMT-03:00] <main> DBG-X: Returning 1

Not related to generated IPA maybe?

like image 516
Guillermo Gefaell Avatar asked Feb 26 '20 15:02

Guillermo Gefaell


2 Answers

tl;dr;

1) change your timezone to UTC or

2) add line DEFAULT_JVM_OPTIONS="-Duser.timezone=UTC${DEFAULT_JVM_OPTIONS:+ $DEFAULT_JVM_OPTIONS}" into file iTMSTransporter just before JAVA_EXECUTABLE=${JVM_EXECUTABLE}. file located at /Applications/Xcode.app/Contents/SharedFrameworks/ContentDeliveryServices.framework/Versions/A/itms/bin for XCode or /Applications/Transporter.app/Contents/itms/bin for Transporter. At the time of this answer. In future versions that can change.

Details:

I've got same issue and after spending a whole bunch of time googling for a solution, I've ended up with debugging transporter jar file. Turned out it uses user timezone to generate some temporary file, and if timezone contains "/" it will fail as it is not allowed in file name, since it is folder separator. Such a silly bug and shame on transporter developers!

I am not a Java developer, and have zero knowledge on how Java programs run and work with all those tmp files and time zones, so have no idea if there are other ways to workaround that issue. If someone will end up with a better solution, please share. Anyway I am going to report a bug.

like image 96
Karabur Avatar answered Oct 19 '22 21:10

Karabur


Just when I started decompiling .jar files to try to reverse engineer them, my co-worker told me how he resolved this problem. This is pure insanity.

First of all, use Transporter app (get it from the appstore). Open it up and go to preferences. Uncheck "Signiant" transfer protocol, so it looks like this:

preferences

Now export .ipa or .pkg package from your built archive, drop it in Transporter and start uploading.

How to export a package:

Go to Organizer (Window -> Organizer), select your bundle and press "Distribute App". Choose App Store Connect -> Export -> ...

like image 28
Igor Kharakhordin Avatar answered Oct 19 '22 22:10

Igor Kharakhordin