Fixed
Status Update
Comments
ch...@google.com <ch...@google.com>
jl...@google.com <jl...@google.com> #2
The problem seem to be that an id specified with the wrong resource type is not flagged with lint example: android:id = "@drawable/ic_location"
di...@google.com <di...@google.com>
aa...@google.com <aa...@google.com>
an...@google.com <an...@google.com> #3
To summarize the repro steps:
- Add a layout xml element with a reference to a drawable id, rather than having its own id defined. Example:
<Button
android:id="@drawable/ic_launcher_background"
...
/>
- Note that there is no linter error shown for the ID.
- Build.
Result: There is a build error.
ID reference type must be 'id': ResourceReference(rClassName=R, type=drawable, name=ic_launcher_background)
This appears to be a missing/incorrect lint check, likely similar to WrongIdDetector.
Description
Build: AI-213.7172.25.2113.9123335, 202209300301,
AI-213.7172.25.2113.9123335, JRE 11.0.13+0-b1751.21-8125866x64 JetBrains s.r.o., OS Windows 10(amd64) v10.0 , screens 1920.0x1080.0
AS: Dolphin | 2021.3.1 Patch 1 Kotlin plugin: 213-1.7.20-release-for-android-studio-AS6777.52 Android Gradle Plugin: 7.2.1 Gradle: 7.3.3 Gradle JDK: version 11.0.13 NDK: from local.properties: (not specified), latest from SDK: (not found) CMake: from local.properties: (not specified), latest from SDK: (not found), from PATH: (not found)
IMPORTANT: Please readhttps://developer.android.com/studio/report-bugs.html carefully and supply all required information.
Dear Google one of my employee made a mistake in their code while givving id to a view they give "@drawable/ic_location" the error is showing when we run it not when we write it, was hard to find this error
Thank you for understanding, will be waiting for your reply Regard Askat.