我正在尝试为 Android 构建我的应用程序并以 Android API 28 为目标。 但是由于我更新了库依赖项,我的应用程序构建失败并出现以下错误:
AAPT: error: attribute android:foregroundServiceType not found.
我已经读到,对于 Android Q(API 29) 上的某些服务(例如位置服务),用户必须指定前台服务的类型才能使权限正常工作,但我的目标是 API 28 和我的 AndroidManifest .xml 不包含该代码。
我使用的库是 Shake( https://shakebugs.com/ ):
implementation 'com.shakebugs.android:shake:13.0.1'
我使用了旧版本 (12.0.3) 的库,没有这个问题。
如有任何帮助,我们将不胜感激。
最佳答案
我解决了改变:
compileSdkVersion 29
我希望它对你有用,美好的一天,快乐的编码。
关于android-studio - 安卓工作室 4.0 安卓 :foregroundServiceType not found when targetSdkVersion 28,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/62910456/