Search Unity

Android Build Fails With il2cpp, Armv7 and Arm64

Discussion in 'Editor & General Support' started by bekiryanik, Nov 22, 2019.

  1. bekiryanik

    bekiryanik

    Joined:
    Jul 6, 2014
    Posts:
    191
    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.
     

    Attached Files:

    • Pic.png
      Pic.png
      File size:
      32.2 KB
      Views:
      447
  2. bekiryanik

    bekiryanik

    Joined:
    Jul 6, 2014
    Posts:
    191
    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?
     
  3. JoshPeterson

    JoshPeterson

    Unity Technologies

    Joined:
    Jul 21, 2014
    Posts:
    6,936
    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: https://docs.unity3d.com/Manual/NativePlugins.html

    2. Remove the C# code which defines this extern method. You can do that with platform dependent compilation: https://docs.unity3d.com/Manual/PlatformDependentCompilation.html
     
  4. bekiryanik

    bekiryanik

    Joined:
    Jul 6, 2014
    Posts:
    191
    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.
     
    JoshPeterson likes this.