Android应用添加启动页时遇资源标识符错误求助
Fixing "No resource identifier found for attribute 'lable' in package 'android'" Error
Hey there! Let's get this splash screen error sorted out quickly.
What's Causing the Error?
The core issue here is a typo: you've written lable instead of the correct attribute name label (notice the missing 'e' at the end). Even though the error points to Splashscreen.java, the problem isn't in your Java code at all—your provided code looks totally fine! The mistake is almost certainly in one of your XML files.
Step-by-Step Fix
- First, open your
AndroidManifest.xmlfile. Look for the<activity>tag that declares yourSplashscreenclass. Check if you have an attribute likeandroid:lable="@string/app_name"(or any other value) — change that toandroid:label. - If the manifest looks correct, open your
activity_splashscreen.xmllayout file. Scan all attributes using theandroid:namespace (likeandroid:id,android:layout_width) and make sure none of them are misspelled aslable. Replace any instances withlabel. - Finally, clean and rebuild your project to clear any cached errors:
- Go to
Build > Clean Projectin Android Studio - Then run
Build > Rebuild Project
- Go to
Once you fix that typo, the error should disappear, and your splash screen should work as expected!
内容的提问来源于stack exchange,提问作者subhasish bose
相关产品推荐
相关产品推荐

