gradle Android Azure Communication聊天UI库导入?

qybjjes1  于 2023-10-19  发布在  Android
关注(0)|答案(1)|浏览(114)

我想将Azure Communication UI移动的库用于Android -聊天。https://github.com/Azure/communication-ui-library-android/tree/main/azure-communication-ui/chat#installation
我遵循了每一步(pickFirst,implementation,maven url),但当我试图启动我的应用程序时,我得到了以下错误:

Configuration cache state could not be cached: field `__librarySourceSets__`of task`:app:mapDebugSourceSetPaths`of type`com.android.build.gradle.tasks.MapSourceSetPathsTask\`: error writing value of type 'org.gradle.api.internal.file.collections.DefaultConfigurableFileCollection'

> Could not resolve all files for configuration ':app:debugRuntimeClasspath'.
> Could not find com.microsoft.device:dualscreen-layout:1.0.0-alpha01.
> Searched in the following locations:
> \- https://dl.google.com/dl/android/maven2/com/microsoft/device/dualscreen-layout/1.0.0-alpha01/dualscreen-layout-1.0.0-alpha01.pom
> \- https://repo.maven.apache.org/maven2/com/microsoft/device/dualscreen-layout/1.0.0-alpha01/dualscreen-layout-1.0.0-alpha01.pom
> \- https://plugins.gradle.org/m2/com/microsoft/device/dualscreen-layout/1.0.0-alpha01/dualscreen-layout-1.0.0-alpha01.pom
> Required by:
> project :app \> com.azure.android:azure-communication-ui-chat:1.0.0-beta.2 \> com.microsoft.fluentui:fluentui_others:0.1.2
> project :app \> com.azure.android:azure-communication-ui-chat:1.0.0-beta.2 \> com.microsoft.fluentui:fluentui_others:0.1.2 \> com.microsoft.fluentui:fluentui_core:0.1.7\`

看起来gradle没有使用我在前面的步骤中提供的maven url.
我什么都试过了:

  • 清洁工程,
  • 重建
  • 将项目与Gradle文件同步,
  • 使缓存无效并重新启动..
ajsxfq5m

ajsxfq5m1#

当Gradle无法解析必需的依赖项时,会发生上述错误。找不到com.microsoft.device:dualscreen-layout:1.0.0-alpha01
已将Azure Maven存储库URL正确添加到allprojects存储库下的项目级build.gradle文件。它应该看起来像这样:

allprojects {
    repositories {
        // ...
        maven {
            url 'https://pkgs.dev.azure.com/azure-telephony/public/_packaging/azure-sdk-for-android/maven/v1'
        }
    }
}

试试这个不同的版本:

implementation 'com.azure.android:azure-communication-ui-chat:1.0.0-beta.2'
implementation 'com.microsoft.fluentui:fluentui_others:0.1.3' // or a different version

您可以使用Gradle的可传递依赖项排除来可传递地排除有问题的依赖项。

implementation ('com.azure.android:azure-communication-ui-chat:1.0.0-beta.2') {
    exclude group: 'com.microsoft.device', module: 'dualscreen-layout'
}

相关问题