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

[FEATURE] Export automatically for iOS mono version #25

Closed
gumaciel opened this issue Nov 15, 2020 · 35 comments
Closed

[FEATURE] Export automatically for iOS mono version #25

gumaciel opened this issue Nov 15, 2020 · 35 comments
Assignees
Labels
enhancement New feature or request

Comments

@gumaciel
Copy link
Contributor

No description provided.

@gumaciel gumaciel added enhancement New feature or request iOS labels Nov 15, 2020
@gumaciel gumaciel self-assigned this Nov 15, 2020
@gumaciel
Copy link
Contributor Author

@brendonion call you tell to me how configure the MacOS for build with mono?

@gumaciel
Copy link
Contributor Author

gumaciel commented Nov 15, 2020

@brendonion

Is giving me this error:

Found Mono root directory: /Library/Frameworks/Mono.framework/Versions/Current
Found Mono JIT compiler version: 6.12.0.93
AssertionError: :
File "/Users/runner/work/Godot-AdMob-Android-iOS/Godot-AdMob-Android-iOS/godot-3.1.2-stable/SConstruct", line 422:
config.configure(env)
File "./modules/mono/config.py", line 250:
make_template_dir(env, mono_root)
File "./modules/mono/config.py", line 273:
assert False

And here are the command line: i didnt used mono before
https://github.com/Poing-Studios/Godot-AdMob-Android-iOS/actions/runs/363802048/workflow#L90

@brendonion
Copy link

Hey I just followed the official Godot tutorial: https://docs.godotengine.org/en/stable/development/compiling/compiling_with_mono.html

You have to clone the specific mono version repo you have https://www.mono-project.com/docs/about-mono/versioning/#mono-source-versioning

You have to clone this repo and run the scripts https://github.com/godotengine/godot-mono-builds

@gumaciel
Copy link
Contributor Author

I really need this godot-mono-builds repository? Because i didnt saw in the official Godot tutorial

And this godot-mono-build will be inside of Godot Source Code?

@brendonion
Copy link

Oh sorry, that's for the ios/android build templates. If you want to build godot mono for osx, you do the following:
scons p=osx tools=yes module_mono_enabled=yes mono_glue=no (generates a <godot_binary>)
<godot_binary> --generate-mono-glue modules/mono/glue

and then

scons p=osx tools=yes module_mono_enabled=yes mono_glue=yes
scons p=osx tools=no module_mono_enabled=yes mono_glue=yes

But for the ios/android templates, you need to clone the godot-mono-builds repo outside of the godot repo, and run the commands from inside godot-mono-builds. But make sure you also clone the specific mono version repo as well.

@gumaciel
Copy link
Contributor Author

Oh, ok, i will try here but it will may take some time, because i dont have a Mac and iam using the GitHub Actions for that.

In this mid-time you can try to compile by yourself:

https://github.com/Poing-Studios/Godot-AdMob-Android-iOS/blob/e74ad4f668b8f058ffef5cafa6db0dbdbb9c6c42/README.md#ios-v300

@gumaciel
Copy link
Contributor Author

@brendonion
Copy link

Okay I'll give it a shot!

@gumaciel
Copy link
Contributor Author

Hey @brendonion im having this error:

Making all in arch
make[4]: Nothing to be done for `all-am'.
Making all in utils
/Applications/Xcode_12.app/Contents/Developer/usr/bin/make all-recursive
CC libmonomath_la-mono-math-c.lo
CCLD libmonomath.la
CC libmonoutils_la-dlmalloc.lo
CC libmonoutils_la-os-event-unix.lo
CC libmonoutils_la-mono-md5.lo
CC libmonoutils_la-mono-sha1.lo
CC libmonoutils_la-mono-logger.lo
CC libmonoutils_la-mono-codeman.lo
/Users/runner/work/Godot-AdMob-Android-iOS/Godot-AdMob-Android-iOS/mono/mono/utils/mono-codeman.c:669:3: error: implicit declaration of function 'pthread_jit_write_protect_np' is invalid in C99 [-Werror,-Wimplicit-function-declaration]
pthread_jit_write_protect_np (0);
^
/Users/runner/work/Godot-AdMob-Android-iOS/Godot-AdMob-Android-iOS/mono/mono/utils/mono-codeman.c:690:4: error: implicit declaration of function 'pthread_jit_write_protect_np' is invalid in C99 [-Werror,-Wimplicit-function-declaration]
pthread_jit_write_protect_np (1);
^
2 errors generated.
make[5]: *** [libmonoutils_la-mono-codeman.lo] Error 1
make[4]: *** [all-recursive] Error 1
make[3]: *** [all] Error 2
make[2]: *** [all-recursive] Error 1
make[1]: *** [all-recursive] Error 1
make: *** [all] Error 2
Running command 'make': make -j1 -C /Users/runner/mono-configs/ios-arm64-release
'make' exited with error code: 2

Please check the code if is missing something:

https://github.com/Poing-Studios/Godot-AdMob-Android-iOS/actions/runs/364531974/workflow

@brendonion
Copy link

What command are you running? I believe you have to change the mono repo branch to the specific mono version you are using before running:

python3 ./ios.py configure --target=arm64
python3 ./ios.py make --target=arm64

Check this table https://www.mono-project.com/docs/about-mono/versioning/#mono-source-versioning.

@brendonion
Copy link

brendonion commented Nov 15, 2020

Yeah I'm just getting so many issues now. I've compiled everything, exported the ios templates, and followed the ios admob steps, but now the game buttons just don't even work. (I also had to change MobileCoreServices -> CoreServices and add PromisesObjc). I'm wondering if it's a mono version mismatch, but essentially the error is:

**ERROR**: Method failed. Returning: __null
2020-11-15 10:19:31.994256-0800 app_name[17583:5262887]    At: modules/mono/csharp_script.cpp:2939:can_instance() - Method failed. Returning: __null

Probably due to it not able to even run the C# scripts.

@gumaciel
Copy link
Contributor Author

did you manage to compile? try to compile without the admob module to see the result

@brendonion
Copy link

brendonion commented Nov 15, 2020

Hmm, yeah I re-compiled the ios templates without the admob module, and same thing. So it must've been a messed up build in the first place. Probably going to take a breather from this for a bit. Please let me know if you get it working!

@gumaciel
Copy link
Contributor Author

@brendonion
Copy link

Oh man, I have no idea on that one. Maybe due to this issue godotengine/godot-mono-builds#11 ? Maybe try a different mono version? They recommend their CI version here godotengine/godot-mono-builds#9 (comment) (6.8.0.123)

@gumaciel
Copy link
Contributor Author

I created a issue here: godotengine/godot-mono-builds#17, i guess this is something missing in godot-mono-builds repository

@brendonion
Copy link

Ok great, let's see where it leads!

@gumaciel
Copy link
Contributor Author

For Android is perfectly working, you can try here:

https://github.com/Poing-Studios/Godot-AdMob-Android-iOS/releases/tag/Android_mono_v3.2.2%2B

(just versions 3.2.2+)

@brendonion
Copy link

Excellent, I'll give that a shot soon 🙌

@brendonion
Copy link

brendonion commented Nov 16, 2020

Also, if you're still working on the iOS builds, make sure you add mono_glue=yes. I noticed it wasn't there in the workflows.

scons p=iphone tools=no target=release arch=arm module_mono_enabled=true mono_glue=yes mono_prefix="$HOME/mono-installs/ios-arm64-release"
scons p=iphone tools=no target=release arch=arm64 module_mono_enabled=true mono_glue=yes mono_prefix="$HOME/mono-installs/ios-arm64-release"

@brendonion
Copy link

Also worth noting, iOS Plugins are in the works 💯
godotengine/godot#41340

@gumaciel
Copy link
Contributor Author

gumaciel commented Nov 17, 2020

Nice, I think the iOS Plugin will be only available for 3.2.5 or 4.0 version.

I'm still with problems with godot-mono-builds, this is the latest problem:

godotengine/godot-mono-builds#17 (comment)

@gumaciel
Copy link
Contributor Author

Hey @brendonion , i found this on official documentation: https://docs.godotengine.org/en/stable/development/compiling/compiling_with_mono.html#notes

Do not build your final binaries with mono_glue=no. This disables C# scripting. This option must be used only for the temporary binary that will generate the glue. Godot will print a warning at startup if it was built without the glue sources.

@brendonion
Copy link

Oh did you get it working btw? I see the release tag but not the template ❓

@gumaciel
Copy link
Contributor Author

Try to download here: https://github.com/Poing-Studios/Godot-AdMob-Android-iOS/suites/1515992304/artifacts/26683307

i`m having some troubles about upload to release tag

@brendonion
Copy link

brendonion commented Nov 17, 2020

Hmm so close! Getting this error now..

Run this binary with '--generate-mono-glue path/to/modules/mono/glue'
2020-11-17 08:47:44.142427-0800 godot_app[1049:190092] **ERROR**: Method failed. Returning: __null
2020-11-17 08:47:44.142524-0800 godot_app[1049:190092]    At: modules/mono/csharp_script.cpp:2939:can_instance() - Method failed. Returning: __null

@gumaciel
Copy link
Contributor Author

This is the same error of this?

Yeah I'm just getting so many issues now. I've compiled everything, exported the ios templates, and followed the ios admob steps, but now the game buttons just don't even work. (I also had to change MobileCoreServices -> CoreServices and add PromisesObjc). I'm wondering if it's a mono version mismatch, but essentially the error is:

**ERROR**: Method failed. Returning: __null
2020-11-15 10:19:31.994256-0800 app_name[17583:5262887]    At: modules/mono/csharp_script.cpp:2939:can_instance() - Method failed. Returning: __null

Probably due to it not able to even run the C# scripts.

@brendonion
Copy link

brendonion commented Nov 17, 2020

Very similar, this time it's saying: Run this binary with '--generate-mono-glue path/to/modules/mono/glue' specifically.
I don't believe I saw that before.

@gumaciel
Copy link
Contributor Author

Do you have Discord? Will be better for chating, i think this error is out of scope of this module but i can help you with it

@brendonion
Copy link

I'm at work now, but we could chat later today for sure. I'm on PST time btw

@brendonion
Copy link

But I really think we need that mono_glue=yes when running scons, it is what enables C# scripting.

@gumaciel
Copy link
Contributor Author

Yes, you're right: https://docs.godotengine.org/en/stable/development/compiling/compiling_with_mono.html#generate-the-glue

"you must build a temporary Godot binary with the options tools=yes and mono_glue=no:

scons p=<platform> tools=yes module_mono_enabled=yes mono_glue=no
After the build finishes, you need to run the compiled executable with the parameter --generate-mono-glue followed by the 
path to an output directory. This path must be modules/mono/glue in the Godot directory:

<godot_binary> --generate-mono-glue modules/mono/glue"

But i dont know what will be generated after that, and what files will be needed to run on XCode, at night we can see this (i'm GMT-3 time)

My Discord ID: Gustavo Maciel / gustavottc#5069

@brendonion
Copy link

For sure, I'll add you on Discord right now. You are 11 hours ahead of me, so I hope you won't be sleeping when we chat 😬

@brendonion
Copy link

brendonion commented Nov 17, 2020

Oh man nothing is working :(

Screen Shot 2020-11-17 at 11 27 22 AM

try adding me shmimbus#4786

@gumaciel
Copy link
Contributor Author

Closing the issue here due the exporting is working: https://github.com/Poing-Studios/Godot-AdMob-Android-iOS/actions/runs/371305010

Currently strill have this error:

2020-11-17 08:47:44.142427-0800 godot_app[1049:190092] **ERROR**: Method failed. Returning: __null
2020-11-17 08:47:44.142524-0800 godot_app[1049:190092]    At: modules/mono/csharp_script.cpp:2939:can_instance() - Method failed. Returning: __null

But this error is not part of this module, is part of Godot itself, my recommend is create a issue in Godot's Github repository

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants