简体   繁体   English

Unity Firebase插件在Android logcat中抛出“DllNotFoundException:App”并且此时卡住了

[英]Unity Firebase Plugin throws “DllNotFoundException: App” in Android logcat and stucks at this point

Currently I'm trying to implement the Unity FirebaseAnalytics Plugin for my android game. 目前我正在尝试为我的Android游戏实施Unity FirebaseAnalytics插件。 I implement this firebase code into the start function: 我将这个firebase代码实现到start函数中:

DependencyStatus dependencyStatus = DependencyStatus.UnavailableOther;

    FirebaseApp.CheckAndFixDependenciesAsync().ContinueWith(task =>
    {

        dependencyStatus = task.Result;
        if (dependencyStatus == DependencyStatus.Available)
        {

            FirebaseAnalytics.SetAnalyticsCollectionEnabled(true);

        }
        else
        {

            Debug.LogError(
              "Could not resolve all Firebase dependencies: " + dependencyStatus);
        }

    });

So when I test my app on Android I use the android Logcat to check if there is any error. 因此,当我在Android上测试我的应用程序时,我使用android Logcat来检查是否有任何错误。 And logcat throws this error below and then the game stucks: 并且logcat在下面抛出此错误然后游戏卡住了:

DllNotFoundException: App 03-16 20:57:56.768 1564 1584 E Unity : at (wrapper managed-to-native) Firebase.AppUtilPINVOKE/SWIGExceptionHelper:SWIGRegisterExceptionCallbacks_AppUtil (Firebase.AppUtilPINVOKE/SWIGExceptionHelper/ExceptionDelegate,Firebase.AppUtilPINVOKE/SWIGExceptionHelper/ExceptionDelegate,Firebase.AppUtilPINVOKE/SWIGExceptionHelper/ExceptionDelegate,Firebase.AppUtilPINVOKE/SWIGExceptionHelper/ExceptionDelegate,Firebase.AppUtilPINVOKE/SWIGExceptionHelper/ExceptionDelegate,Firebase.AppUtilPINVOKE/SWIGExceptionHelper/ExceptionDelegate,Firebase.AppUtilPINVOKE/SWIGExceptionHelper/ExceptionDelegate,Firebase.AppUtilPINVOKE/SWIGExceptionHelper/ExceptionDelegate,Firebase.AppUtilPINVOKE/SWIGExceptionHelper/ExceptionDelegate,Firebase.AppUtilPINVOKE/SWIGExceptionHelper/ExceptionDelegate,Firebase.AppUtilPINVOKE/SWIGExceptionHelper/ExceptionDelegat DllNotFoundException:App 03-16 20:57:56.768 1564 1584 E Unity:at(包装器托管到本机)Firebase.AppUtilPINVOKE / SWIGExceptionHelper:SWIGRegisterExceptionCallbacks_AppUtil(Firebase.AppUtilPINVOKE / SWIGExceptionHelper / ExceptionDelegate,Firebase.AppUtilPINVOKE / SWIGExceptionHelper / ExceptionDelegate,Firebase .AppUtilPINVOKE / SWIGExceptionHelper / ExceptionDelegate,Firebase.AppUtilPINVOKE / SWIGExceptionHelper / ExceptionDelegate,Firebase.AppUtilPINVOKE / SWIGExceptionHelper / ExceptionDelegate,Firebase.AppUtilPINVOKE / SWIGExceptionHelper / ExceptionDelegate,Firebase.AppUtilPINVOKE / SWIGExceptionHelper / ExceptionDelegate,Firebase.AppUtilPINVOKE / SWIGExceptionHelper / ExceptionDelegate,Firebase.AppUtilPINVOKE /SWIGExceptionHelper/ExceptionDelegate,Firebase.AppUtilPINVOKE/SWIGExceptionHelper/ExceptionDelegate,Firebase.AppUtilPINVOKE/SWIGExceptionHelper/ExceptionDelegat

I found some threads about this error but nothing helps. 我发现了一些关于这个错误的线索但没有任何帮助 I guess that the plugin is missing some files or while importing something gone wrong. 我猜这个插件缺少一些文件或导入错误的东西。 Because in another project of me there are more files in the Plugin/Android directory. 因为在我的另一个项目中,Plugin / Android目录中有更多文件。

This is my current Plugin Folder enter image description here 这是我当前的插件文件夹在这里输入图像描述

This is my Plugin folder of an another project enter image description here 这是我的另一个项目的插件文件夹, 在这里输入图像描述

So in the older project there are more folders and .aars and .jars. 所以在旧项目中有更多文件夹和.aars和.jars。 I thought my android sdk is broken but after I installed again the same issue appears. 我以为我的android sdk坏了但是在我再次安装后出现同样的问题。 I currently use the newest Android SDK and all required libarys and components for android development. 我目前使用最新的Android SDK和所有必需的libarys和组件进行android开发。 My Firebase Version is Version 4.4.3. 我的Firebase版本是4.4.3版。 I use the JDK Version 8u162. 我使用的是JDK Version 8u162。 Working with Unity 2017.3.1f1. 使用Unity 2017.3.1f1。

So is this that normal? 这是正常的吗? Because I guess the Dll Exceptions depends on this problem because some files are missing. 因为我猜Dll Exceptions取决于这个问题,因为缺少一些文件。

I know that this post is already closed, but I would like to pass on my experience, I had the same problem, and I was able to solve it as follows. 我知道这篇文章已经关闭,但我想传递一下我的经验,我遇到了同样的问题,我能够解决它如下。 After you export the Unity3d project to Android Studio, convert it to module 将Unity3d项目导出到Android Studio后,将其转换为模块

" Removing the project's applicationId in build.gradle Changing com.android.application to com.android.library in build.gradle " “在build.gradle中删除项目的applicationId将com.android.application更改为build.gradle中的com.android.library”

1 - Copy the .aar files from the .libs folder of the module project, if the master project does not already have them 2 - include the .aar files in build.gradle 1 - 如果主项目还没有它们,则从模块项目的.libs文件夹中复制.aar文件2 - 在build.gradle中包含.aar文件

dependencies { implementation fileTree (include: ['* .jar', '* .aar'], dir: 'libs') implementation project (': ModuleApp') } 依赖项{implementation fileTree(include:['* .jar','* .aar'],dir:'libs')实现项目(':ModuleApp')}

3 - Copy the file "google-services.xml" to the res / values / google-services.xml folder of the master project 4 - Ready, Firebase will work with the sources of the module exported from Unity 3 - 将文件“google-services.xml”复制到主项目的res / values / google-services.xml文件夹4 - Ready,Firebase将使用从Unity导出的模块的源

Sorry for my bad english 对不起,我的英语不好

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

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