Skip to content

Add IL2CPP support for Android, iOS, Linux #143

New issue

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

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

Already on GitHub? # to your account

Closed
RDeluxe opened this issue Aug 26, 2020 · 16 comments
Closed

Add IL2CPP support for Android, iOS, Linux #143

RDeluxe opened this issue Aug 26, 2020 · 16 comments

Comments

@RDeluxe
Copy link

RDeluxe commented Aug 26, 2020

Context

Seems that linux docker images with IL2CPP are ready => https://gitlab.com/gableroux/unity3d/-/issues/66
It would be nice to be able to use them.

Suggested solution

Considering IL2CPP + Windows target is not possible ATM, an action parameter could be tricky. However I don't see any better solution.

@RDeluxe RDeluxe changed the title Add IL2CPP support for Android, iOS, etc. Add IL2CPP support for Android, iOS, Linux Aug 26, 2020
@webbertakken
Copy link
Member

Hi @RDeluxe thank you for your input.

I agree with the suggested solution. Accepting PRs for the suggested changes.

Please note though that is currently blocked by https://gitlab.com/gableroux/unity3d/-/issues/85.

@RDeluxe
Copy link
Author

RDeluxe commented Aug 26, 2020

Hi !

Yes I'm currently using a fork to use a working Android image. I'm not quite sure how things are going to evolve without changing the images name though. I'll keep an eye on that.

I realized that https://gitlab.com/gableroux/unity3d/-/issues/66 did not include IL2CPP images for iOS nor Android, but only for linux.

That means a first MR would be required to add android-il2cpp and ios-il2cpp before creating a PR here. Am I right ?

@webbertakken
Copy link
Member

Yes, as we are using gableroux/unity3d images, so we would need to see the images (#il2cpp) in dockerhub before we can use them.

@davidmfinol
Copy link
Member

davidmfinol commented Aug 26, 2020

I think the Android and iOS images include il2cpp by default.
I've been using il2cpp for Android and iOS builds through unity actions without problem.

I would really like to see il2cpp for linux added, though.

@RDeluxe
Copy link
Author

RDeluxe commented Aug 27, 2020

That's weird, the previous issue mentioned a new naming scheme for il2cpp images, because of the added "weight". Maybe @GabLeRoux can confirm ? It's not clear digging in the sources.

I'll test that as soon as I can find a working Android image 😅

@GabLeRoux
Copy link
Member

GabLeRoux commented Aug 27, 2020

I don't know if latest images have IL2CPP support by default for ios and android, I'd have to confirm this too. Here's a summary of what I know and from where:

Linux IL2CPP support in docker images was added here:

Available -linux-il2cpp images and versions as of today
2019.3.0f1-linux-il2cpp
2019.3.0f6-linux-il2cpp
2019.3.1f1-linux-il2cpp
2019.3.2f1-linux-il2cpp
2019.3.3f1-linux-il2cpp
2019.3.5f1-linux-il2cpp
2019.3.6f1-linux-il2cpp
2019.3.7f1-linux-il2cpp
2019.3.8f1-linux-il2cpp
2019.3.9f1-linux-il2cpp
2019.3.11f1-linux-il2cpp
2019.3.12f1-linux-il2cpp
2019.3.13f1-linux-il2cpp
2019.3.14f1-linux-il2cpp
2019.3.15f1-linux-il2cpp
2019.4.0f1-linux-il2cpp
2019.4.1f1-linux-il2cpp
2019.4.2f1-linux-il2cpp
2019.4.3f1-linux-il2cpp
2019.4.4f1-linux-il2cpp
2019.4.5f1-linux-il2cpp
2019.4.6f1-linux-il2cpp
2019.4.7f1-linux-il2cpp
2019.4.8f1-linux-il2cpp
2020.1.0b2-linux-il2cpp
2020.1.0b3-linux-il2cpp
2020.1.0b4-linux-il2cpp
2020.1.0b5-linux-il2cpp
2020.1.0b6-linux-il2cpp
2020.1.0b7-linux-il2cpp
2020.1.0b8-linux-il2cpp
2020.1.0b9-linux-il2cpp
2020.1.0b11-linux-il2cpp
2020.1.0b12-linux-il2cpp
2020.1.0b14-linux-il2cpp
2020.1.0b15-linux-il2cpp
2020.1.0b16-linux-il2cpp
2020.1.0f1-linux-il2cpp
2020.1.1f1-linux-il2cpp
2020.1.2f1-linux-il2cpp

Windows IL2CPP support was requested here:

But as described in the discussion, last time I checked (4 months ago), Unity doesn't have support for installing IL2CPP windows component when unity is running on Linux (and docker images are based on Ubuntu so we can only do what unity on Ubuntu can do).

Android IL2CPP was discussed in the following comment:

From the screenshot, android-il2cpp doesn't seem to be available (yet)

A quick way to confirm this would be to run Ubuntu locally, install unity with android build support and see if it's possible to build a project with IL2CPP and arm64 checked as shown how to here.

iOS IL2CPP support:

  • I don't think I've seen a discussion on this so far.

I'll test that as soon as I can find a working Android image 😅

This is definitely related to https://gitlab.com/gableroux/unity3d/-/issues/85

@davidmfinol
Copy link
Member

I don't think there's much discussion to be had about iOS. Unity requires IL2CPP for 64-bit iOS builds, Apple now requires 64-bit for new iOS apps, so IL2CPP is now the only option for building to iOS.

@webbertakken
Copy link
Member

webbertakken commented Nov 9, 2020

Could anyone confirm that this works now?

@davidmfinol
Copy link
Member

I tried using unity-builder@v2.0-alpha-2, but my Linux Il2CPP build fails (Android and iOS are good, though!).

Maybe there is some additional step required to get IL2CPP working on Linux?

@webbertakken
Copy link
Member

I think this will fix it #177

@davidmfinol
Copy link
Member

Looks like its still using the base image instead of IL2CPP:

/usr/bin/docker build /home/runner/work/_actions/webbertakken/unity-builder/v2.0-alpha-4/action --file /home/runner/work/_actions/webbertakken/unity-builder/v2.0-alpha-4/action/Dockerfile --build-arg IMAGE=unityci/editor:2019.4.9f1-base-0 --tag unity-builder:2019.4.9f1-base-0

I can run a snippet similar to the logic we've got:

function imageSuffixes() {
    return {
      generic: '',
      webgl: 'webgl',
      mac: 'mac-mono',
      windows: 'windows-mono',
      linux: 'base',
      linuxIl2cpp: 'linux-il2cpp',
      android: 'android',
      ios: 'ios',
      facebook: 'facebook',
    };
}
const {
      generic,
      webgl,
      mac,
      windows,
      linux,
      linuxIl2cpp,
      android,
      ios,
      facebook,
    } = imageSuffixes();
const version = '2019.4.9f1';
const [major, minor] = version.split('.').map((digit) => Number(digit));
if(major >= 2020 || (major === 2019 && minor >= 3)) 
  console.log(linuxIl2cpp);
else
  console.log(linux);

Running this snippet returns "linux-il2cpp" instead of "base", so I'm not sure what's wrong now.
I might try looking into it some more tomorrow.

@davidmfinol
Copy link
Member

I forgot to run yarn build for index.js with the last PR. I think it should be fixed with #181

@davidmfinol
Copy link
Member

Ok, it's using the correct image now, but now I'm getting this error:
Error: FATAL UNHANDLED EXCEPTION: System.InvalidOperationException: C++ code builder is unable to build C++ code for Linux: Could not find valid clang executable at clang

@GabLeRoux started looking into this at https://gitlab.com/gableroux/unity3d-gitlab-ci-example/-/issues/139

@webbertakken
Copy link
Member

That's good news. So we're 1 step closer again 👍🏼

@davidmfinol
Copy link
Member

Linking to game-ci/docker#53 for visibility.

@webbertakken
Copy link
Member

Images have been reported to work with Android and iOS as build targets. Their default backend is set to IL2CPP, at least for newer versions of Unity editor.

Closing this unless there is indeed reason to believe we need to further investigate any missing dependencies.

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants