测试中,用了这个库 com.google.code.gson:gson:2.10
- 本地提前include 一个 group = com.google.code.gson, moduleName = gson 的模块,
- 不过这个库仅仅有一个 Gson 类,而且也只有一个函数, toJson()
- 使用的地方,也仅仅使用了 Gson.toJson() 函数。
- 看了下插件,是调用了 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.