Android @ string / appbar_scrolling_view_behavior被标记为未解析的引用

问题描述 投票:1回答:2

我正在使用androidx依赖项,一切正常。但是linter假设@ string / appbar_scrolling_view_behavior是一个未解析的引用。见下图:

enter image description here

代码本身完全正常,没有问题。我只是想摆脱linter /检查以使错误消失。我已经尝试过这些东西似乎很奇怪:

  • 清洁,重建
  • 使缓存无效并重新启动
  • 对coordinatorlayout,constraints / androidx的依赖性检查

如果你想知道我在使用

androidx.appcompat:appcompat:1.0.2
androidx.constraintlayout:constraintlayout:2.0.0-alpha5
android xml android-coordinatorlayout androidx coordinator-layout
2个回答
0
投票

布局行为,如@string/appbar_scrolling_view_behaviorcoordinatorlayout的一部分和As Migration Docs coordinatorlayoutis现在是一个单独的库,不是appcpmpat的一部分。 添加gradle: -

androidx.coordinatorlayout:coordinatorlayout:1.0.0


0
投票

更新:现在已经在the release notes中描述的Android Studio 3.4.1中修复了它。


这是工具中的某个错误,可能是布局编辑器。你不能禁用检查,除了盯着问题https://issuetracker.google.com/issues/131403371你无法做任何事情来解决它

暂时忽略检查,因为你说它工作正常没有任何问题!

© www.soinside.com 2019 - 2024. All rights reserved.