Android Build Fails With il2cpp, Armv7 and Arm64

Hello everyone,

I needed to upgrade one of my older games on store but i am getting two errors while building. Actually Unity Editor says build succeeded but the output is not seeming in the output directory and in the console i see this error:

and this error:


I am using Unity Version 2018.3.14.f1 version. I downloaded the newest version of SDK and i am using Android NDK r16b. You can find the settings of Build Settings > Other Settings part in picture attached.

I’ve searched a lot about this topic and i tried many things on my project but none of them worked for me. I will be waiting for your reply. Thanks in advance.

5202395--517373--Pic.png

Today I tried Unity Cloud Build but it also failed because of the il2cpp. I tried many things to have a successful build, but none of them worked for me. Any suggestion?

This failure occurs because the code in the project has extern methods in C#. Methods marked as extern with a the [Dllimport(“__Internal”)] attribute must be present in a native library that is linked with the Unity player when building with the IL2CPP scripting backend.

For example, this in this project one function which causes this issue is named: _initCloud

You have two options:

  1. Build a native library with all of the methods marked as extern with the [Dllimport(“__Internal”)] attribute for the target platform and architecture of the player. See this documentation for details about native plugins: Unity - Manual: Native plug-ins

  2. Remove the C# code which defines this extern method. You can do that with platform dependent compilation: Unity - Manual: Conditional compilation

Thank you so much for your answer. I’ve figured out that one the asset that i am using, causes this error. I deleted that asset and the problem is solved. But i need that asset in my project for admob and analytics. I am going to implement admob and anaytics seperately. I hope i reach the success by this way. I am going to use the solutions that you give after i impletement the thing i need with the project. Thank you so much again. I will keep posted if i reach success or not.

1 Like