Conversation
| var baseDirectory = ""; | ||
| try | ||
| { | ||
| baseDirectory = appDomain.BaseDirectory; |
There was a problem hiding this comment.
Mono throws error here for some reason.
| messageBuilder.AppendInvariant("\n{0}: {1}", systemPath, MiscHelpers.EnsureNonBlank(GetLoadLibraryErrorMessage(), "Unknown error")); | ||
| } | ||
|
|
||
| if (HostSettings.IsAndroid) |
There was a problem hiding this comment.
As far as I understand, ClearScript works even if we don't call LoadNativeLibrary. And I cannot make LoadNativeLibrary work consistently for Android. So, if it does not work, I decided to ignore the error for Android. It certainly works, although I don't know what effects this may have.
|
Hi @KurtGokhan, Thanks so much for contributing! At the moment we're focused on the next point release, so we'll evaluate Android support a bit later – most likely toward the end of the year. Apparently .NET 6 will support Android and iOS in some capacity; that could eliminate the need for new APIs such as Thanks again! |
|
|
Hi @KurtGokhan so I am now able to build the arm64 version for android. how ever I also want to build x86 from android, so I just start the command like this: make -f Unix/Makefile CPU=x86 ANDROID=1 I checked the "build-android-x86-release.log" and the detail error is this: it seems the libatomic library is missing, but when I try to install it , it says Can you please point me out whats goes wrong here? |
|
@nextfool you are probably missing one of the build dependencies. Try running |
|
Sorry, the correct file name is |
|
Tested with 7.1.7 and works well. |
|
This does not work currently. Can't build the V8 Android library anymore with the current V8 source code. Android NDK removed linkers I used so the build scripts must be changed. I haven't figured how yet. |
|
I didn't have time to update this PR so converting it to draft. PR can be closed if not needed anymore. |




This PR partially adds support for using V8 with ClearScript in Android Mono. It is partial because it requires some manual steps, and it uses some solutions which can be considered as hacks.
The PR may not be up to merging standards but I opened it hoping that I can get some feedback or other people may find it useful.
Summary of what was done:
-aflag toV8Update.sh, andANDROIDsymbol to Makefile to build V8 for Android. It can build forarmandarm64architectures and can only be built in Linux. To be able to build, it is required to installinstall-build-deps-android.shof v8 as far as I can tell.ClearScriptV8.android-arm.soandClearScriptV8.android-arm64.sobut they need to be prefixed withliblikelibClearScriptV8.android-arm.sootherwiseDLLImportcan't find it when built with release configuration for some reason (works with debug though, I guess it is a Mono bug).HostSettings.IsAndroidto tell the ClearScript that current platform is Android. The user must set this setting to true in Android platforms. (For example, I am using#if UNITY_ANDROIDbuild flag to conditionally add it)ArmasX86so I had to add some hacks for that.