使用IL2CPP的Firebase Unity3D Android构建:libApp.so,错误:无法加载库

问题描述 投票:1回答:1

我查看了消息传递示例应用程序(https://github.com/firebase/quickstart-unity/tree/master/messaging/testapp),并尝试为Android平台构建。使用脚本后端选项是Mono2x,一切都在设备上运行正常,但是使用选项IL2CPP,Android logcat在Firebase初始化方法上显示以下错误:

11-14 10:31:17.233: E/Unity(5088): Couldn't open /data/app-lib/com.firebase.testfcm-1/libApp.so, error: Cannot load library:
11-14 10:31:17.233: E/Unity(5088): System.Threading.Tasks.<Post>c__AnonStorey0:<>m__0(Object)
11-14 10:31:17.233: E/Unity(5088): [ line 125]
11-14 10:31:17.233: E/Unity(5088): (Filename:  Line: 125)
11-14 10:31:17.253: I/Unity(5088): DllNotFoundException: Unable to load DLL 'App': The specified module could not be found.
11-14 10:31:17.253: I/Unity(5088):   at Firebase.AppUtilPINVOKE+SWIGExceptionHelper.SWIGRegisterExceptionCallbacks_AppUtil (Firebase.ExceptionDelegate applicationDelegate, Firebase.ExceptionDelegate arithmeticDelegate, Firebase.ExceptionDelegate divideByZeroDelegate, Firebase.ExceptionDelegate indexOutOfRangeDelegate, Firebase.ExceptionDelegate invalidCastDelegate, Firebase.ExceptionDelegate invalidOperationDelegate, Firebase.ExceptionDelegate ioDelegate, Firebase.ExceptionDelegate nullReferenceDelegate, Firebase.ExceptionDelegate outOfMemoryDelegate, Firebase.ExceptionDelegate overflowDelegate, Firebase.ExceptionDelegate systemExceptionDelegate) [0x00000] in <filename unknown>:0
11-14 10:31:17.253: I/Unity(5088):   at Firebase.AppUtilPINVOKE+SWIGExceptionHelper..cctor () [0x00000] in <filename unknown>:0
11-14 10:31:17.253: I/Unity(5088):   at System.Collections.Generic.Dictionary`2+Transform`1[TKey,TValue,TRet].EndInvoke (IAsyncResult result) [0x00000] in <filename unknown>:0
11-14 10:31:17.253: I/Unity(5088):   at System.Threading.Tasks.TaskScheduler+<

有没有人有同样的问题?

谢谢。

unity3d firebase
1个回答
0
投票

我遇到了同样的问题。

解压缩apk,发现libApp.so不在apk文件中。

我用unity来导出gradle项目。

最后,我发现导出的gradle项目不包含lib文件夹中的aars。我添加在build.gradle中包含aar并解决此问题。

© www.soinside.com 2019 - 2024. All rights reserved.