我的图书馆项目有一个定位服务,根据 Android Q 要求,它设置了 android:foregroundServiceType="location"
list 中的属性。当应用程序模块使用我的库并针对 API 级别 28 进行编译时,它会失败并出现以下错误:
AndroidManifest.xml:57: AAPT: error: attribute android:foregroundServiceType not found.
我的库如何保持与旧版本的兼容性,同时确保该功能适用于 Android Q?
最佳答案
在迁移到 Androidx
后,我遇到了同样的错误和更新compileSdkVersion
从 28 日到 29 日,我的问题得到了解决。所以请做这些改变,你可以得到你的解决方案
关于android - 如何在保持向后兼容性的同时将 foregroundServiceType 添加到库 list ?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/56579320/