英文:
Cannot build Android project with preview compile and target sdk version
问题
我尝试测试我的Android应用如何与SDK版本UpsideDownCake一起工作,该版本目前是预览版本。我将此版本应用于我的app
模块,如下所示:
android {
compileSdkPreview = "UpsideDownCake";
buildToolsVersion = "34.0.0-rc2";
defaultConfig {
minSdk = 23
targetSdkPreview = "UpsideDownCake";
}
}
dependencies {
implementation("com.onesignal:OneSignal:4.8.5")
// 其他依赖项
}
以及其他(库)模块:
android {
compileSdkPreview = "UpsideDownCake";
buildToolsVersion = "34.0.0-rc2";
defaultConfig {
minSdk = 23
}
}
dependencies {
// 库依赖项
}
当我开始同步Android Studio与gradle文件时,我收到一些依赖项的警告。它们看起来如下:
无法解析:com.onesignal:OneSignal:4.8.5。受影响的模块:app。
我无法构建这个项目。对于这个错误,我该怎么办?
英文:
I am trying to test how my Android app would work with SDK version UpsideDownCake which is now is a preview version. I apply this version to my app
module as following:
android {
compileSdkPreview = "UpsideDownCake"
buildToolsVersion = "34.0.0-rc2"
defaultConfig {
minSdk = 23
targetSdkPreview = "UpsideDownCake"
}
}
dependencies {
implementation("com.onesignal:OneSignal:4.8.5")
// Other dependecies
}
and in other (library) modules:
android {
compileSdkPreview = "UpsideDownCake"
buildToolsVersion = "34.0.0-rc2"
defaultConfig {
minSdk = 23
}
}
dependencies {
// Library dependencies
}
When I start to sync Android Studio with gradle files I get warnings for some of dependencies I use. They look as following:
> Failed to resolve: com.onesignal:OneSignal:4.8.5. Affected Modules: app.
I can't build this project. What can I do about this error?
答案1
得分: 1
在你的 build.gradle (Module: app)
中,你没有正确指定 OneSignal 的依赖项。根据文档,应该是这样的:
dependencies {
implementation 'com.onesignal:OneSignal:[4.0.0, 4.99.99]'
}
你应该查看 android-sdk-setup 文档了解更多信息。
英文:
In your build.gradle (Module: app)
, you didn’t specify the OneSignal dependence properly
According to the documentation it should be this way
dependencies {
implementation 'com.onesignal:OneSignal:[4.0.0, 4.99.99]'
}
you should look through the docs for the android-sdk-setup
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论