[英]Issue while adding location service in build.gradle in android
I want to add this google play location services in android我想在 android 中添加这个 google play 位置服务
implementation 'com.google.android.gms:play-services-location:17.0.0'
and my support:appcompat library is我的支持:appcompat 库是
implementation 'com.android.support:appcompat-v7:27.1.1'
targetSdkVersion is 27
compileSdkVersion is 27
when try to build getting error尝试构建时出现错误
Android resource linking failed D:\\AndroidStudioProject\\GpsLocationApp\\app\\build\\intermediates\\incremental\\mergeDebugResources\\merged.dir\\values\\values.xml:2015: error: resource android:attr/fontVariationSettings not found.
Android 资源链接失败 D:\\AndroidStudioProject\\GpsLocationApp\\app\\build\\intermediates\\incremental\\mergeDebugResources\\merged.dir\\values\\values.xml:2015: error: resource android:attr/fontVariationSettings not found。
D:\\AndroidStudioProject\\GpsLocationApp\\app\\build\\intermediates\\incremental\\mergeDebugResources\\merged.dir\\values\\values.xml:2015: error: resource android:attr/ttcIndex not found.
D:\\AndroidStudioProject\\GpsLocationApp\\app\\build\\intermediates\\incremental\\mergeDebugResources\\merged.dir\\values\\values.xml:2015: 错误:资源 android:attr/ttcIndex 未找到。 error: failed linking references.
错误:链接引用失败。
Google Play services and Firebase migrated to AndroidX in the latest release. Google Play 服务和 Firebase 在最新版本中迁移到 AndroidX。 It means that you are using both, support libraries and androidx libraries.
这意味着您同时使用支持库和 androidx 库。
You can:你可以:
You can check the official release notes :您可以查看官方发行说明:
Warning: This release is a MAJOR version update and breaking change.
警告:此版本是主要版本更新和重大更改。 The latest update to Google Play services and Firebase includes the following changes:
Google Play 服务和 Firebase 的最新更新包括以下更改:
Migration from Android Support Libraries to Jetpack (AndroidX) Libraries.从 Android 支持库迁移到 Jetpack (AndroidX) 库。 Libraries will not work unless you make the following changes in your app:
除非您在应用程序中进行以下更改,否则库将无法工作:
com.android.tools.build:gradle
to v3.2.1 or later.com.android.tools.build:gradle
升级到 v3.2.1 或更高版本。compileSdkVersion
to 28 or later.compileSdkVersion
升级到 28 或更高版本。 Also about the specific error described in the answer:另外关于答案中描述的特定错误:
The error is:错误是:
AAPT: error: resource android:attr/fontVariationSettings not found.
AAPT:错误:找不到资源 android:attr/fontVariationSettings。
AAPT: error: resource android:attr/ttcIndex not foundAAPT:错误:找不到资源 android:attr/ttcIndex
Change the compileSdkVersion
to:将
compileSdkVersion
更改为:
compileSdkVersion 28
fontVariationSettings
andttcIndex
were added in api level 28 . fontVariationSettings
和ttcIndex
是在 api level 28中添加的。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.