无法在Android Studio和Unity中将libmain.so加载为库

问题描述:

我的毕业项目有问题,我将Unity作为库添加到Android Studio,可以在我的手机上正常工作,但是当我尝试在其他Android手机上时,我遇到了一些奇怪的错误(无法加载 libmain .so ),我进行了很多搜索,但没有找到答案.

I have a problem in my graduation project, I add Unity as a library to Android Studio it works fine with my mobile, but when I try on the other Android mobile I got some weird error (unable to load libmain.so), I search a lot but I didn't find the answer.

注意:只有当我单击按钮(在android项目上)转到Unity项目时,才没有编译或生成错误.

Note: there is no compile or build error, only when I click on the button(on android project) to go to Unity project.

请在您的string.xml中添加以下行

Please add following line into your string.xml

<string name="game_view_content_description">Game view</string>

之后,将以下代码段添加到应用程序级别的gradle文件中

After that add below snippet into your app level's gradle file

defaultConfig {
        ndk {
            abiFilters 'armeabi-v7a', 'x86'
        }
    }