我试图从Agora.IO中导入这里模块,以实现屏幕共享功能。在克隆了提供的链接上的存储库并将其添加为我的项目的Module之后,我能够正确地获得所有的imports。我所需要的唯一导入是import io.agora.api.*,但是构建失败了,出现了以下消息。
Execution failed for task ':lib-switch-external-video:compileDebugAidl'.
> Could not resolve all files for configuration ':lib-switch-external-video:debugCompileClasspath'.
> Could not find com.github.agorabuilder:native-full-sdk:3.4.2.
Required by:
project :lib-switch-external-video > project :lib-component
Possible solution:
- Declare repository providing the artifact, see the documentation at
https://docs.gradle.org/current/userguide/declaring_repositories.html在导入模块之后,我的项目结构就是这样的:

虽然我对multi-module应用程序还不太熟悉,但我已经将这些添加到了我的settings.gradle文件中:
settings.gradle
rootProject.name = "dummy"
include ':app'
include ':lib-push-externalvideo'
include ':lib-screensharing'
include ':lib-player-helper'
include ':lib-stream-encrypt'
include ':lib-component'
include ':lib-raw-data'
include ':lib-switch-external-video'在默认的build.gradle of lib-component模块中找到
api 'com.github.agorabuilder:native-full-sdk:3.4.2'
api 'io.agora:agoraplayer:1.2.4'在每个模块的build.gradle中,已经添加了以下任何一个模块:
implementation project(path: ':lib-component')
or
api project(path: ':lib-component')我之所以选择导入这些模块,是因为我无法找到支持这些导入的gradle依赖项。如果有这样的依赖,请告诉我!
发布于 2021-05-30 19:51:16
这一问题在信息中得到了准确的提及。Gradle无法在添加到模块中的任何存储库中解析com.github.agorabuilder:native-full-sdk:3.4.2依赖。
你在那里定义了jitpack回购吗?
repositories {
maven { url 'https://www.jitpack.io' }
// Other repositories you need
}另外,与您的问题不同,您的settings.gradle文件似乎有点不同。我假设您已将所有源代码复制到项目中。
相反,我选择链接它们,而不是在本例中复制源。为此,你可以用
include ':lib-component'
project(':lib-component').projectDir = new File('/path/to/cloned/repo/lib-component/')当您正在调试一个库时,更喜欢这样做,因为您看起来是这样的。通过这种方式,您可以在此构建中添加确切的模块,并且在此进行任何更改都将在该项目中实际发生。允许您简单地提交或更改该回购中的分支。
https://stackoverflow.com/questions/67764906
复制相似问题