【发布时间】:2019-09-20 11:25:46
【问题描述】:
实际上,我正在尝试使我现有的应用程序在 Android-10 (Q) 上兼容。下面是我如何在 build.gradle 文件中设置编译和目标 sdk 版本--
android {
compileSdkVersion 29
buildToolsVersion '29.0.0'
defaultConfig {
applicationId "com.xyz.myapp"
minSdkVersion 17
targetSdkVersion 29
versionCode 83
versionName "83.0"
multiDexEnabled true;
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
}
}
以下是我将应用迁移到 Android-X 后使用的支持库依赖项
implementation 'androidx.constraintlayout:constraintlayout:1.1.3'
implementation 'androidx.legacy:legacy-support-v4:1.0.0'
implementation 'androidx.appcompat:appcompat:1.0.0'
implementation 'androidx.recyclerview:recyclerview:1.0.0'
implementation 'androidx.cardview:cardview:1.0.0'
implementation 'androidx.multidex:multidex:2.0.0'
我已将我的项目迁移到 Android-X,还从 sdk 管理器安装了 Android9.+ (Q) API-Level 29,但我仍然收到“无法解析符号 'ACCESS_BACKGROUND_LOCATION'”错误。我请求你指导我解决这个问题。另外,请让我知道我是否可以提供更多详细信息。谢谢。
【问题讨论】:
-
您找到解决方案了吗?我有同样的问题。
-
如何导入
ACCESS_BACKGROUND_LOCATION? -
ACCESS_BACKGROUND_LOCATION 是在 API 级别 29 中添加的,这可能与您的
minSdkVersion 17设置相矛盾。 -
如果将全名指定为
android.permission.ACCESS_BACKGROUND_LOCATION,您可能会获得更好的运气 -
你能贴出产生这个错误的代码吗?
标签: android