如何在功能模块上设置Target Sdk (Gradle 7.0.2)
我想将以前的库
(com.android.library
)更改为功能模块
(com.android.dynamic -特征
)。但是,当我这样做时,我无法设置 targetSdk
或 targetSdkVersion
:
plugins {
id("com.android.dynamic-feature")
kotlin("kapt")
kotlin("android")
}
android { // this = DynamicFeatureExtension
compileSdk = BuildConfig.SdkVersion.COMPILE
defaultConfig {
minSdk = BuildConfig.SdkVersion.MIN
targetSdk = BuildConfig.SdkVersion.TARGET // targetSdk is not found
targetSdkVersion(BuildConfig.SdkVersion.TARGET) // targetSdkVersion is not found
...
}
gradle 版本是 7.0.2: distributionUrl=https\://services.gradle.org/distributions/gradle-7.0.2-bin.zip
我注意到当我将它与 格子应用程序,它不会遇到同样的问题,他们的 gradle 版本是5.6.4.
I want to change what was previously a library
(com.android.library
) to a feature module
(com.android.dynamic-feature
). However, when I do so, I am unable to set the targetSdk
or targetSdkVersion
:
plugins {
id("com.android.dynamic-feature")
kotlin("kapt")
kotlin("android")
}
android { // this = DynamicFeatureExtension
compileSdk = BuildConfig.SdkVersion.COMPILE
defaultConfig {
minSdk = BuildConfig.SdkVersion.MIN
targetSdk = BuildConfig.SdkVersion.TARGET // targetSdk is not found
targetSdkVersion(BuildConfig.SdkVersion.TARGET) // targetSdkVersion is not found
...
}
The gradle version is 7.0.2:distributionUrl=https\://services.gradle.org/distributions/gradle-7.0.2-bin.zip
I notice that when I compare it with the Plaid App, which doesn't suffer the same problems, that their gradle version is 5.6.4.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
你能试试这个吗?
Can you try this?