我在Android项目中得到了由以下依赖引起的构建错误:
implementation "com.algolia:instantsearch-android:2.5.1"
它有助于升级到2.8.0,但我不喜欢,因为它需要minSdk 21。
第6.5级
Android Gradle插件: 4.0.2
科特林1.3.72
Could not determine the dependencies of task ':app:compileReleaseJavaWithJavac'.
> Could not resolve all task dependencies for configuration ':app:releaseCompileClasspath'.
> Could not resolve com.algolia:algoliasearch-client-kotlin-common:1.4.0.
Required by:
project :app > com.algolia:instantsearch-android:2.5.1
> No matching variant of com.algolia:algoliasearch-client-kotlin-common:1.4.0 was found. The consumer was configured to find an API of a component, as well as attribute 'com.android.build.api.attributes.BuildTypeAttr' with value 'release', attribute 'org.jetbrains.kotlin.platform.type' with value 'androidJvm' but:
- Variant 'metadata-api' capability com.algolia:algoliasearch-client-kotlin-common:1.4.0:
- Incompatible because this component declares a usage of 'kotlin-api' of a component, as well as attribute 'org.jetbrains.kotlin.platform.type' with value 'common' and the consumer needed an API of a component, as well as attribute 'org.jetbrains.kotlin.platform.type' with value 'androidJvm'
- Other compatible attribute:
- Doesn't say anything about com.android.build.api.attributes.BuildTypeAttr (required 'release')发布于 2022-06-17 00:13:15
我的情况有点相似,但我的情况和你的略有不同。我将解释我和你的情况之间的区别,以及我为纠正这种情况所做的一切。这可能是你的问题的一个线索,但我会留给你看看它是否适用或有用。
在我的例子中,关于不兼容性的错误说,使用者有一个属性'org.jetbrains.kotlin.platform.type‘和值'androidJvm’,并且它发现我的依赖关系和值'jvm‘属性'org.jetbrains.kotlin.platform.type’。请注意,我没有关于其他属性和组件的确切文本和消息。但是当我分析这个消息时,明显的区别是'androidJvm‘和'jvm’。
我做错的是,我试图在java库中添加一个android库依赖项,当然,这是不允许的。我已经将‘java库’插件应用于该依赖项,而不是将'com.android.plugin‘应用于该库。我纠正了那个问题,当我离开的时候。
在你的例子中,你看起来有‘公共’和'androidJvm‘的区别。不幸的是,我不知道平台类型“公共”指的是什么。这可能是因为你所应用的插件类型。希望这能帮到你!
https://stackoverflow.com/questions/66241227
复制相似问题