Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

IOS (Xcode) does not compile #51526

Closed
Difference opened this issue Aug 11, 2021 · 17 comments
Closed

IOS (Xcode) does not compile #51526

Difference opened this issue Aug 11, 2021 · 17 comments

Comments

@Difference
Copy link

Difference commented Aug 11, 2021

Godot version

3.4 Beta 3 [EDIT]: Mono (using c# only)

System information

Mac Mini M1 -> IOS

Issue description

When trying to compile and deploy to a device, Xcode will not compile, and lists 100+ errors.

image

Steps to reproduce

Export a project to iOS from Godot 3,4 beta 3, on Mac M1.
Try to deploy to device ( iPhone or iPad)

image

Minimal reproduction project

No response

@Calinou
Copy link
Member

Calinou commented Aug 11, 2021

Did you export a project with a Mono-enabled editor?

Also, can you reproduce this on 3.3.2 or 3.4beta2?

@Difference
Copy link
Author

Difference commented Aug 14, 2021

Did you export a project with a Mono-enabled editor?

Also, can you reproduce this on 3.3.2 or 3.4beta2?

Beta 2 works, (besides other unrelated errors)
I Export from the Official Godot 3.4 Beta 3, I don't think I understand the editor question.

@Calinou
Copy link
Member

Calinou commented Aug 14, 2021

I Export from the Official Godot 3.4 Beta 3, I don't think I understand the editor question.

Godot has non-Mono and Mono editor builds. Non-Mono builds can only use GDScript and GDNative, whereas Mono builds can use GDScript, C# and GDNative.

If your project doesn't use any C# scripts, you should use a non-Mono build.

@Difference
Copy link
Author

I Export from the Official Godot 3.4 Beta 3, I don't think I understand the editor question.

Godot has non-Mono and Mono editor builds. Non-Mono builds can only use GDScript and GDNative, whereas Mono builds can use GDScript, C# and GDNative.

If your project doesn't use any C# scripts, you should use a non-Mono build.

Sorry for not being clear. It's the mono build, I use only c# scripts.
(I am trying to get on the beta, because of linker errors in the stable 3.3 that creates crashes on Ad Hoc IOS builds)

@Difference
Copy link
Author

Difference commented Aug 14, 2021

It seems to happen for both MsBuild and Dotnet cli
The exports are unusually fast (compared to 3.3 stable and 3.4 beta 2) , maybe indicating that something is not being built/exported?

[EDIT] , yes it seems the
libmono-icall-table.xcframework
libmono-native.xcframework
*.xcframework

are missing in the export folder

@akien-mga akien-mga added this to the 3.4 milestone Aug 14, 2021
@Difference
Copy link
Author

Additional information:
in 3.4 beta 3 mono :
When I choose the build method, I do not see the names of the build tools, I see numbers. (see image)
By trial and error I found that
0 is MsBuild
3 is dotnet cli

I also uninstalled all dotnet sdk's and installed only 5.0.
Dotnet still build and run my Godot projects from the editor in editor, but exports are missing the *.xcframework files.

image

@bruvzg
Copy link
Member

bruvzg commented Aug 14, 2021

When I choose the build method, I do not see the names of the build tools, I see numbers. (see image)

This happens when editor can't load core mono libs (nothing Mono related will work in this case), what's in the editor logs (it should have errors on editor startup).

@Difference
Copy link
Author

Difference commented Aug 14, 2021

When I choose the build method, I do not see the names of the build tools, I see numbers. (see image)

This happens when editor can't load core mono libs (nothing Mono related will work in this case), what's in the editor logs (it should have errors on editor startup).

Ok, but all the c# scripts compile and run fine from the editor, so some parts are working.
[EDIT] Also same setup works with with 3.4 beta 2, is there a config file I can edit/delete?

@bruvzg
Copy link
Member

bruvzg commented Aug 14, 2021

Ok, but all the c# scripts compile and run fine from the editor, so some parts are working.

That's strange, maybe it's only Mono editor plugin fails.

Editor config is in ~/Library/Application Support/Godot/editor-settings-3.tres, also try removing .import and .mono hidden folder from your project, maybe something from the previous beta is causing issues.

Mono logs are in ~/Library/Application Support/Godot/mono/mono_logs, and try running editor from the terminal, instead of using .app (./Godot.app/Contents/MacOS/Godot --path path_to_your_project --editor) it might print something useful.

3.4 beta 3 seems to be running fine on my M1 MacBook Air.

@Difference
Copy link
Author

Difference commented Aug 14, 2021

3.4 beta 3 seems to be running fine on my M1 MacBook Air.

Export and run and device from Xcode too?

[Edit] deleting .mono and .import folders did not change anything , and I don't get errors on startup from console

@bruvzg
Copy link
Member

bruvzg commented Aug 14, 2021

Export and run and device from Xcode too?

I have tested, with official beta 3 editor and templates:

  • Exporting project with C# scripts (I have .NET 6.0.100-preview.5.21302.13 installed and "dotnet CLI" selected in the Godot editor).
  • Building for the iOS device. I don't to have any device on hand to test if it's running.
  • Building and running iOS app on macOS.

All frameworks seem to be in place.

Exported test project contents for the reference.
.
├── MonoTest
│   ├── Images.xcassets
│   │   ├── AppIcon.appiconset
│   │   │   ├── Contents.json
│   │   │   ├── Icon-1024.png
│   │   │   ├── Icon-120.png
│   │   │   ├── Icon-76.png
│   │   │   └── sizes
│   │   └── LaunchImage.launchimage
│   │       ├── Contents.json
│   │       ├── [email protected]
│   │       ├── [email protected]
│   │       ├── [email protected]
│   │       ├── [email protected]
│   │       ├── Default-Landscape-X.png
│   │       ├── Default-Landscape.png
│   │       ├── [email protected]
│   │       ├── [email protected]
│   │       ├── Default-Portrait-X.png
│   │       ├── Default-Portrait.png
│   │       └── [email protected]
│   ├── MonoTest-Info.plist
│   ├── MonoTest.entitlements
│   ├── dummy.cpp
│   ├── dylibs
│   │   └── empty
│   ├── en.lproj
│   │   └── InfoPlist.strings
│   └── export_options.plist
├── MonoTest.pck
├── MonoTest.xcframework
│   ├── Info.plist
│   ├── ios-arm64
│   │   └── libgodot.a
│   └── ios-arm64_x86_64-simulator
│       └── libgodot.a
├── MonoTest.xcodeproj
│   ├── project.pbxproj
│   ├── project.xcworkspace
│   │   ├── contents.xcworkspacedata
│   │   ├── xcshareddata
│   │   │   └── IDEWorkspaceChecks.plist
│   │   └── xcuserdata
│   │       └── bruv.xcuserdatad
│   │           └── UserInterfaceState.xcuserstate
│   └── xcshareddata
│       └── xcschemes
│           └── MonoTest.xcscheme
├── lib-aot-MonoTest.xcframework
│   ├── Info.plist
│   ├── ios-arm64
│   │   └── lib-aot-MonoTest.a
│   └── ios-arm64_x86_64-simulator
│       └── lib-aot-MonoTest.a
├── libmono-ee-interp.xcframework
│   ├── Info.plist
│   ├── ios-arm64
│   │   ├── empty
│   │   └── libmono-ee-interp.a
│   └── ios-arm64_x86_64-simulator
│       ├── empty
│       └── libmono-ee-interp.a
├── libmono-icall-table.xcframework
│   ├── Info.plist
│   ├── ios-arm64
│   │   ├── empty
│   │   └── libmono-icall-table.a
│   └── ios-arm64_x86_64-simulator
│       ├── empty
│       └── libmono-icall-table.a
├── libmono-ilgen.xcframework
│   ├── Info.plist
│   ├── ios-arm64
│   │   ├── empty
│   │   └── libmono-ilgen.a
│   └── ios-arm64_x86_64-simulator
│       ├── empty
│       └── libmono-ilgen.a
├── libmono-native.xcframework
│   ├── Info.plist
│   ├── ios-arm64
│   │   ├── empty
│   │   └── libmono-native.a
│   └── ios-arm64_x86_64-simulator
│       ├── empty
│       └── libmono-native.a
└── libmonosgen-2.0.xcframework
    ├── Info.plist
    ├── ios-arm64
    │   ├── empty
    │   └── libmonosgen.a
    └── ios-arm64_x86_64-simulator
        ├── empty
        └── libmonosgen.a

34 directories, 60 files

@Difference
Copy link
Author

Export and run and device from Xcode too?

I have tested, with official beta 3 editor and templates:

  • Exporting project with C# scripts (I have .NET 6.0.100-preview.5.21302.13 installed and "dotnet CLI" selected in the Godot editor).
  • Building for the iOS device. I don't to have any device on hand to test if it's running.
  • Building and running iOS app on macOS.

All frameworks seem to be in place.

Exported test project contents for the reference.

You obviously get the missing frameworks such as lib-aot-MonoTest.xcframework.

I uninstalled mono and then reinstalled it , but the editor still shows numbers, not names, and export does not include the frameworks ( except the project framework), so I'm unsure of what to try next.

@neikeq
Copy link
Contributor

neikeq commented Aug 14, 2021

Run the Godot editor from the terminal:

... and try running editor from the terminal, instead of using .app (./Godot.app/Contents/MacOS/Godot --path path_to_your_project --editor) it might print something useful.

Export the game and once it's finished, copy and paste the full terminal output here.

@Difference
Copy link
Author

Difference commented Aug 15, 2021

Solved! Thank you very much for guiding me to diagnosing the problem.

The log showed problems with creating directories, so thinking it was a file access problem, I deleted Godot, downloaded again, and got a prompt when starting it to open it even though it was downloaded. Export now works fine.

The problems with the Ad Hoc IOS builds, has not gone away. As far as I can tell, my problem lies with using signals with parameters, but I need to do some more testing.
Stable 3.3 Ad Hoc builds has a bug, that crashes IOS when using certain c# features (Random async etc. ) but Signals (without parameters) was ok. I will dig up the relevant bug report, but I am unsure of witch one I shall pick:

[EDIT] Hunted the Ad Hoc bug down, and made a new bug report here: #51838

Current path: /
ERROR: Could not create directory: user://logs
   at: make_dir_recursive (core/os/dir_access.cpp:176)
Godot Engine v3.4.beta3.mono.official.8db0bd442 - https://godotengine.org
OpenGL ES 3.0 Renderer: Apple M1
OpenGL ES Batching: ON 
ERROR: Could not create directory: res://.mono

@Difference
Copy link
Author

In the Xcode project, I notice some files marked in red, it this important?
App runs on device, but crashes in Ad Hoc mode

image

@akien-mga
Copy link
Member

How was this solved?

@Difference
Copy link
Author

Difference commented Aug 19, 2021

How was this solved?

As described above in #51526 (comment)
I don't know what went wrong with the initial install.
btw: I still have other Ad Hoc build issues, besides ToString(), but I have not found the exact cause yet.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Archived in project
Development

No branches or pull requests

5 participants