Skip to content

编译OK,但是跑起来的时候,会报错,提示 > Could not resolve com.google.code.gson:gson:2.10. #17

@aheadlcx

Description

@aheadlcx

测试中,用了这个库 com.google.code.gson:gson:2.10

  1. 本地提前include 一个 group = com.google.code.gson, moduleName = gson 的模块,
  2. 不过这个库仅仅有一个 Gson 类,而且也只有一个函数, toJson()
  3. 使用的地方,也仅仅使用了 Gson.toJson() 函数。
  4. 看了下插件,是调用了 depend.useTarget 的了。

error msg:

Could not resolve com.google.code.gson:gson:2.10.
Required by:
project :app
> No matching configuration of project :gson was found. The consumer was configured to find a runtime of a component, preferably optimized for Android, as well as attribute 'com.android.build.api.attributes.BuildTypeAttr' with value 'debug', attribute 'com.android.build.api.attributes.AgpVersionAttr' with value '7.2.2', attribute 'org.jetbrains.kotlin.platform.type' with value 'androidJvm' but:
- None of the consumable configurations have attributes.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions