fyne-io / fyne

Cross platform GUI toolkit in Go inspired by Material Design
https://fyne.io/
Other
25.1k stars 1.4k forks source link

xcodebuild: error: Unable to read project 'main.xcodeproj' from folder #4452

Closed gptlang closed 10 months ago

gptlang commented 11 months ago

Checklist

Describe the bug

xcrun xcodebuild -configuration Release -project /tmp/fyne-work-3356407224/main.xcodeproj -allowProvisioningUpdates DEVELOPMENT_TEAM=Apple Worldwide Developer Relations failed: exit status 74
Command line invocation:
    /Applications/Xcode.app/Contents/Developer/usr/bin/xcodebuild -configuration Release -project /tmp/fyne-work-3356407224/main.xcodeproj -allowProvisioningUpdates "DEVELOPMENT_TEAM=Apple Worldwide Developer Relations"

User defaults from command line:
    IDEPackageSupportUseBuiltinSCM = YES

Build settings from command line:
    DEVELOPMENT_TEAM = Apple Worldwide Developer Relations

2023-12-11 13:59:40.124 xcodebuild[86872:6973698] CFPropertyListCreateFromXMLData(): Old-style plist parser: missing semicolon in dictionary on line 89. Parsing will be abandoned. Break on _CFPropertyListMissingSemicolon to debug.
2023-12-11 13:59:40.125 xcodebuild[86872:6973698] Error Domain=NSCocoaErrorDomain Code=3840 "JSON text did not start with array or object and option to allow fragments not set. around line 1, column 0." UserInfo={NSDebugDescription=JSON text did not start with array or object and option to allow fragments not set. around line 1, column 0., NSJSONSerializationErrorIndex=0}
2023-12-11 13:59:40.127 xcodebuild[86872:6973698] Writing error result bundle to /var/folders/zz/zyxvpxvq6csfxvn_n0000000000000/T/ResultBundle_2023-11-12_13-59-0040.xcresult
xcodebuild: error: Unable to read project 'main.xcodeproj' from folder '/tmp/fyne-work-3356407224'.
    Reason: The project ‘main’ is damaged and cannot be opened due to a parse error. Examine the project file for invalid edits or unresolved source control conflicts.

Path: /tmp/fyne-work-3356407224/main.xcodeproj

How to reproduce

  1. git clone https://github.com/fyne-io/calculator
  2. cd calculator
  3. Obtain profile from ~/Library/MobileDevice/Provisioning\ Profiles
  4. Obtain certificate by exporting from Xcode and running openssl pkcs12 -info -in DeveloperCert.p12 -nodes -legacy, then saving the certificate into a file
  5. Run the release command
    fyne release -os ios  -appID "com.example.myapp" -appVersion "0.0.1" -profile self.mobileprovision -certificate cert

Screenshots

No response

Example code

See https://github.com/fyne-io/calculator

Fyne version

2.4.2

Go compiler version

go1.21.4

Operating system and version

MacOS Sonoma 14.1.2

Additional Information

fyne package -os ios -appID com.example.myapp works and produces Calculator.app. The issue is exclusively with release.

The path specified does not exist (/tmp/fyne-work-3356407224/main.xcodeproj: cannot open/tmp/fyne-work-3356407224/main.xcodeproj' (No such file or directory)`)

gptlang commented 11 months ago

My is to be able to get my own app onto my phone via AltStore.

What I did instead was:

  1. Build the app with fyne package
  2. Download a random app via ipatool
  3. Replace the App.app in Payload after unzipping the IPA
  4. Zip the contents again and rename as app.ipa
  5. Download from a local file server
  6. Open with AltStore.

Would still be nice if this could work though

andydotxyz commented 11 months ago

You are passing a filename instead of the name of the provisioning profile. You need to have double clicked it to install, then pass the name that you gave the profile which is stored inside the file.

In addition do not export the certificate but simply pass its name on the parameter, it will be looked up through your keychain.

gptlang commented 11 months ago

For some reason, I can only open the provisioning profiles in XCode.

Am I looking at the right ones? ~/Library/MobileDevice/Provisioning\ Profiles/08f8feac-9ab3-420c-ab7d-7f41a5546fd7.mobileprovision

Note: My paid developer account expired. I don't have access to "Certificates, Identifiers & Profiles"

andydotxyz commented 11 months ago

That is the right directory. Quickview will show you the name of the profile if you press spacebar in Finder.

If your account has expired then the certificates may no longer work.

gptlang commented 11 months ago

Success with new error:

/var/folders/2l/zhsxm4ks3tb7c9pd981t_nsm0000gn/T/fyne-work-3829971956/main.xcodeproj: warning: The iOS deployment target 'IPHONEOS_DEPLOYMENT_TARGET' is set to 9.0, but the range of supported deployment target versions is 12.0 to 17.0.99. (in target 'main' from project 'main')
/var/folders/2l/zhsxm4ks3tb7c9pd981t_nsm0000gn/T/fyne-work-3829971956/main.xcodeproj: error: Provisioning profile "iOS Team Provisioning Profile: dev.duti.Testing" is Xcode managed, but signing settings require a manually managed profile. (in target 'main' from project 'main')
** BUILD FAILED **

Xcode says that the certificate is valid for 6 more days

andydotxyz commented 11 months ago

How did you create that profile? It sounds like you didn't do so using their provisioning and certification service online?

gptlang commented 10 months ago

It was made via xcode. Looks like this requires an actual paid developer account. My workflow works for me so I'll close this issue.

Workaround: Build app, put in "Payload" folder, zip it, rename to ipa, send it off to AltStore for provisioning. Stuff can be unsigned and missing, it doesn't matter.

andydotxyz commented 10 months ago

I hope your app got published ok. Is there a doc you could share that shows how no signing is ok for this type of upload?