godot icon indicating copy to clipboard operation
godot copied to clipboard

iOS export throws the following error: "JSON text did not start with array or object"

Open JMedina90 opened this issue 2 years ago • 7 comments

Godot version

3.4.4

System information

macOs 12.2 Monterrey, M1

Issue description

Exporting to iOs doesn't work. Throws the following error:

2022-04-16 11:09:07.733 xcodebuild[12148:7643367] 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}
xcodebuild: error: Unable to read project 'app.xcodeproj' from folder '/Users/xxx/projects/apks'.
    Reason: The project ‘appproject’ is damaged and cannot be opened due to a parse error. Examine the project file for invalid edits or unresolved source control conflicts.

Path: /Users/xxx/projects/apks/app.xcodeproj

xcodebuild (.ipa):
error: archive not found at path '/Users/xxx/projects/apks/app.xcarchive'
** EXPORT FAILED **

Tried creating a new project and I still get the same error. Other exports work fine (android, html, macos, etc)

Steps to reproduce

  • Download latest export templates
  • Properly fill iOs options requirements (teamid, identifier, icons).
  • Hit Export Project.

Minimal reproduction project

No response

JMedina90 avatar Apr 16 '22 17:04 JMedina90

Have you found any workaround? I've tried to install previous version of engine 3.4.2, 3.3.4 and it does not fixed that problem. Maybe issue is the last Xcode version?

Sc4pego4t avatar May 22 '22 19:05 Sc4pego4t

This was confirmed by cucaido on the Godot Forums: https://godotforums.org/discussion/29990/failed-to-export-ios-project-due-to-reason-the-project-x-is-damaged-and-cannot-be-opened

Calinou avatar May 25 '22 08:05 Calinou

No way to export to ipa in 3.4.4 too unfortunately. Any hints on how to solve it manually?

vlyahovich avatar Jun 13 '22 16:06 vlyahovich

UPD: if I use 3.4.2 iphone template in 3.4.4 it seem to export fine

vlyahovich avatar Jun 13 '22 16:06 vlyahovich

As workaround, App Store Team ID should be not your email but ID like : 4CP59N327WZ

krupitskas avatar Jul 01 '22 12:07 krupitskas

Actually free users do have an App Store Team ID, but it is not displayed in Xcode. For free users, Xcode displays your email whereas or paid users, Xcode will display the App Store Team ID. But, free users still have a proper App Store Team ID. You need to create a Xcode project and open the .xcodeproj in a text editor and search for the key DEVELOPMENT_TEAM.

buildSettings = {
    ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
    ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor;
    CODE_SIGN_STYLE = Automatic;
    CURRENT_PROJECT_VERSION = 1;
    DEVELOPMENT_ASSET_PATHS = "\"Example/Preview Content\"";
****DEVELOPMENT_TEAM = 485FK5P5JK;
    ENABLE_PREVIEWS = YES;
...

lawrnce avatar Aug 06 '22 15:08 lawrnce

You can view Team ID of the free "Apple Development" certificate in the macOS Keychain, open certificate and look for "organisational unit" value.

Screenshot 2022-08-06 at 18 58 50

bruvzg avatar Aug 06 '22 16:08 bruvzg

This issue seems to be mostly a UX issue, maybe we could make this more clear somehow. Until then, we've now documented this on the docs: https://github.com/godotengine/godot-docs/pull/7069

mhilbrunner avatar Mar 28 '23 16:03 mhilbrunner

This issue seems to be mostly a UX issue, maybe we could make this more clear somehow.

https://github.com/godotengine/godot/pull/74644 adds some extra validation and documentation (including instructions how to get Team ID on macOS/iOS to avoid this error) directly to the export dialog property tooltips.

bruvzg avatar Mar 28 '23 17:03 bruvzg

For others who arrive here--you likely need to populate your "TeamID" accessible from https://developer.apple.com/account#membership

jreusser avatar Feb 11 '24 15:02 jreusser