摇篮为Android AAR根据AAR,无论是在同一个远程存储库?是在、摇篮、根据、AAR

2023-09-03 22:51:56 作者:作业太彪悍我征服不了

有几个问题漂浮关于传递依赖与AAR文件在摇篮:

There are a few questions floating around regarding transitive dependencies with AAR files in Gradle:

Android工作室0.2.3无法解析传递AAR依赖 Android摇篮库的依赖与依赖库使用的Nexus Aar在库中。外部的依赖和NoClassDefFoundError的 Android Studio 0.2.3 cannot resolve transitive aar dependencies Android Gradle library dependency with library dependency using Nexus Aar in repository. External dependency and NoClassDefFoundError

我也遇到了试图建立在AAR文件传递依赖于远程仓库类似的问题。我有一个应用程序,这取决于图书馆B,而这又取决于 在图书馆C.库C是一个Maven回购。库B是在相同的回购,具有一个POM 包含在图书馆C.应用程序中的相关性有图书馆中的B的依赖。但是,运行 摇篮干净assembleDebug 的结果:模块版本[图书馆B]依赖库,但不是库本身

I too have run into similar problems trying to set up transitive dependencies upon AAR files in a remote repository. I have App A, depending upon Library B, which in turn depends upon Library C. Library C is in a Maven repo. Library B is in the same repo, with a POM that contains the dependency upon Library C. App A has Library B in its dependencies. However, running gradle clean assembleDebug results in: "Module version [Library B] depends on libraries but is not a library itself".

我试图把对这些问题的一个赏金,希望能为清楚起见,没有运气。

I tried putting a bounty on one of those questions, hoping for clarity, with no luck.

我的猜测是,有我和那些与前面提到的SO问题,看到困难的两个可能的来源:

My guess is that there are two possible sources of the difficulty that I and those with the aforementioned SO question are seeing:

从远程仓库传递AAR的依赖只是破

Transitive AAR dependencies from a remote repository are simply broken

传递AAR从远程仓库工作的相关性,但也有一些是关闭在我们的POM文件, build.gradle 文件或东西是打破了依赖

Transitive AAR dependencies from a remote repository work, but there is something off in our POM files, build.gradle files, or something that is breaking the dependencies

问题:有谁知道一个AAR神器在一些公共库(例如,Maven的中央),这取决于另一个AAR神器,也是在同样的公共信息库

The Question: Does anyone know of an AAR artifact in some public repository (e.g., Maven Central), that depends upon another AAR artifact, also in the same public repository?

我不感兴趣的AAR这取决于一些在本地存储库中,像AAR在Maven中环这取决于 com.android.support:support-v4 。在我的情况下,如果库B和库C都在我的本地仓库(〜/ .m2目录),一切工作正常。

I am not interested in an AAR that depends upon something in a local repository, like an AAR in Maven Central that depends upon com.android.support:support-v4. In my case, if Library B and Library C are both in my local Maven repository (~/.m2), everything works fine.

据XAV,我在做什么应该工作。因此,我希望有人能指出我工作的例子,这样我可以用它来确定我们其余的人可能是想错了。

According to Xav, what I am doing should work. Hence, I am hoping that somebody can point me to a working example, so that I can use it to determine where the rest of us may be going wrong.

注意:我知道,要求异地资源是禁止的。在这种情况下,我不是在寻找自己的权利的资源,但作为工作结构的一个例子,以帮助调试非工作配置。如果你有写了一个答案呈现出工作配置的另一种方式,那简直是真棒!

NOTE: I know that asking for off-site resources is verboten. In this case, I am not looking for the resource in its own right, but as an example of a working configuration, to help debug a non-working configuration. If you have another way of writing up an answer showing a working configuration, that'd be awesome!

谢谢!

推荐答案

看来,我的问题已经清除了1.9摇篮和 com.android.tools.build:gradle:0.7。+ 。至少 - 我是再也不能重现该问题。

It appears that my problem has cleared up with Gradle 1.9 and com.android.tools.build:gradle:0.7.+. Leastways, I can no longer reproduce the problem.