godot
godot copied to clipboard
iOS export throws the following error: "JSON text did not start with array or object"
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
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?
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
No way to export to ipa in 3.4.4 too unfortunately. Any hints on how to solve it manually?
UPD: if I use 3.4.2 iphone template in 3.4.4 it seem to export fine
As workaround, App Store Team ID should be not your email but ID like : 4CP59N327WZ
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;
...
You can view Team ID of the free "Apple Development" certificate in the macOS Keychain, open certificate and look for "organisational unit" value.
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
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.
For others who arrive here--you likely need to populate your "TeamID" accessible from https://developer.apple.com/account#membership