简体   繁体   English

使用Unity内置的x64构建il2cpp后出现UnsatisfiedLinkError

[英]UnsatisfiedLinkError after building with il2cpp for x64 built in Unity

I have an Android Unity Project which i build using Unity 2018.4.2f1 which worked perfectly for Mono Scripting with armv4 architecture, but since the new Google Policy states to give arm64 architecture apk for upload, i shifted to il2cpp with arm64 architecture. 我有一个Android Unity项目,我使用Unity 2018.4.2f1构建,它完美适用于使用armv4架构的Mono Scripting,但由于新的Google Policy声明将arm64架构apk用于上传,我转向使用arm64架构的il2cpp。

The Build succeeded, but after running the project, one of the Plugins which i used seems to throw 构建成功,但在运行项目后,我使用的其中一个插件似乎抛出

AndroidJavaException: java.lang.UnsatisfiedLinkError

I believe this has something to do with either il2cpp or the arm64 architecture change, because everything was working fine before this change, does anyone know how to resolve this. 我相信这与il2cpp或arm64架构更改有关,因为在此更改之前一切正常,有人知道如何解决这个问题。

After doing some research here and there and spending almost a day on the internet for this i finally found a workaround for this problem, apparently i was right on point about the x64 part of the question, this was happening because of x64 architecture 在这里和那里做了一些研究,并在互联网上花了将近一天的时间,我终于找到了解决这个问题的方法,显然我对问题的x64部分是正确的,这是因为x64架构而发生的

to bypass this You need to add the following filters(abiFilters) to your app module's build.gradle files. 绕过这个您需要将以下过滤器(abiFilters)添加到app模块的build.gradle文件中。 So when your device try to run your app, it will check gradle file and understands that it should not generate any folder and use existing native library resources 因此,当您的设备尝试运行您的应用时,它将检查gradle文件,并了解它不应生成任何文件夹并使用现有的本机库资源

defaultConfig {
    ...

    ndk {
        abiFilters "armeabi-v7a", "x86", "armeabi", "mips"
    }

}

Thats it, nothing more was required atleast in my project 多数民众赞成在我的项目中至少不需要了

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM