在 Android Native App 的模块中使用 WebRTC

问题描述

我想将 webRTC 添加到我的 Android 原生应用程序 (Kotlin)。 当我用作整体模块时没有问题,但是当我决定创建模块化应用程序并将每个部分拆分为其模块时,我在添加 webRTc 库 (libwebrtc.aar) 时遇到了问题。 添加核心模块 New>> Module>>Android Library Module>> 将 core 设置为 module and...

将 libwebrtc.aar 移动到核心模块中的“libs”文件夹,并将这一行添加到核心模块 build.gradle 文件

api files('libs/libwebrtc.aar')

为了

flatDir {
            dirs 'libs'
        }

我收到了不使用这个标签的警告,然后我从项目的 build.gradle 文件中注释(删除)它

image of I get Error when running app and show project structure

Execution Failed for task ':app:checkDebugDuplicateClasses'.
> Could not resolve all files for configuration ':app:debugRuntimeClasspath'.
   > Failed to transform libwebrtc.aar to match attributes {artifactType=enumerated-runtime-classes,org.gradle.usage=java-runtime}.
      > Execution Failed for AarToClasstransform: C:\Users\SAEed\.gradle\caches\transforms-2\files-2.1\2de79c22a87212ae21503ef7176b8107\jetified-libwebrtc.aar.
         > zip file is empty

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)