JavaShuo
栏目
标签
Resource IDs cannot be used in a switch statement in Android library modules
时间 2021-07-11
标签
errors
android
android studio
栏目
Android
繁體版
原文
原文链接
在组件化开发中,当我们使用switch来进行判断操作时,会报这个错误,原因是R.id.XXX这类资源id在主application中是final,是常量,而在library中,是没有final的。这里盗个图: 所以我们需要将switch转变为if else,直接选中switch,alt+enter,选择replace switch with if ———————————————— 版权声明:本文
>>阅读原文<<
相关文章
1.
【Android 报错】Resource IDs cannot be used in a switch statement in Android library modules
2.
Resource IDs cannot be used in a switch statement in Android library modules
3.
Resource IDs cannot be used in a switch statement in Android library modules.
4.
Android开发问题之--Validates using resource IDs in a switch statement in Android library module
5.
require function is used in a way in which dependencies cannot be statically extracted
6.
Constructor call must be the first statement in a constructor
7.
Cannot execute statement in a READ ONLY transaction.
8.
[django] Exception Value: DatabaseWrapper objects created in a thread can only be used in that s...
9.
[django] Exception Value: DatabaseWrapper objects created in a thread can only be used in that same
10.
The type OneInterface cannot be a superinterface of OneInterfaceImpl; a superinterface must be an in
更多相关文章...
•
SQL IN 操作符
-
SQL 教程
•
Swift for-in 循环
-
Swift 教程
•
JDK13 GA发布:5大特性解读
•
Kotlin学习(一)基本语法
相关标签/搜索
method...in
in+exists
in&&exists
for...in
for..in
for.....in
In PHP
between+in
modules
ids
Android
Visual Studio
0
分享到微博
分享到微信
分享到QQ
每日一句
每一个你不满意的现在,都有一个你没有努力的曾经。
最新文章
1.
「插件」Runner更新Pro版,帮助设计师远离996
2.
错误 707 Could not load file or assembly ‘Newtonsoft.Json, Version=12.0.0.0, Culture=neutral, PublicKe
3.
Jenkins 2018 报告速览,Kubernetes使用率跃升235%!
4.
TVI-Android技术篇之注解Annotation
5.
android studio启动项目
6.
Android的ADIL
7.
Android卡顿的检测及优化方法汇总(线下+线上)
8.
登录注册的业务逻辑流程梳理
9.
NDK(1)创建自己的C/C++文件
10.
小菜的系统框架界面设计-你的评估是我的决策
本站公众号
欢迎关注本站公众号,获取更多信息
相关文章
1.
【Android 报错】Resource IDs cannot be used in a switch statement in Android library modules
2.
Resource IDs cannot be used in a switch statement in Android library modules
3.
Resource IDs cannot be used in a switch statement in Android library modules.
4.
Android开发问题之--Validates using resource IDs in a switch statement in Android library module
5.
require function is used in a way in which dependencies cannot be statically extracted
6.
Constructor call must be the first statement in a constructor
7.
Cannot execute statement in a READ ONLY transaction.
8.
[django] Exception Value: DatabaseWrapper objects created in a thread can only be used in that s...
9.
[django] Exception Value: DatabaseWrapper objects created in a thread can only be used in that same
10.
The type OneInterface cannot be a superinterface of OneInterfaceImpl; a superinterface must be an in
>>更多相关文章<<