godotengine / godot

Godot Engine – Multi-platform 2D and 3D game engine
https://godotengine.org
MIT License
86.84k stars 19.44k forks source link

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

Open JMedina90 opened 2 years ago

JMedina90 commented 2 years ago

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

Minimal reproduction project

No response

Sc4pego4t commented 2 years ago

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?

Calinou commented 2 years ago

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

vlyahovich commented 2 years ago

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

vlyahovich commented 2 years ago

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

krupitskas commented 2 years ago

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

lawrnce commented 1 year ago

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;
...
bruvzg commented 1 year ago

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

mhilbrunner commented 1 year ago

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

bruvzg commented 1 year ago

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.

jreusser commented 5 months ago

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