1.问题

Kotlin版本升级导致编译报错:'when' expression must be exhaustive, add necessary 'xxx', 'null' branches or 'else' branch instead

2.原因

Kotlin1.7之后when强制封闭问题,1.6及之前的版本只做Waring提示,1.7之后变成了Error导致无法编译通过,

3.解决

所以我们在写when时尽可能的加上else,或者穷举所有可能出现的情况。

‘when‘ expression must be exhaustive, add necessary ‘xxx‘, ‘null‘ branches or ‘else‘ branch instead相关推荐

  1. git remote add origin xxx.git 的问题解决

    在输入git remote add origin xxx.git 后,系统提示远程origin已经存在.可以采用以下方式进行解决: 输入命令: git remote rm origin git rem ...

  2. AlertDialog显示错误 Unable to add window token null is not for an application

    在listView的onItemClick函数中显示一个AlertDialog,出现如下错误 08-07 21:26:43.506: ERROR/AndroidRuntime(9390): andro ...

  3. Android --- 刚刚进入 Activity 页面的时候无法打开对话框,报错 Unable to add window -- token null is not valid; is your

    报错如下: E/AndroidRuntime: FATAL EXCEPTION: mainProcess: com.gxuwz.yixin, PID: 29723java.lang.RuntimeEx ...

  4. Android之运行PopupWindow提示Unable to add window -- token null is not valid; is your activity running?

    1.问题 在使用PopupWindow的时候,我们构建好了直接放在Activity的onCreate函数里面直接运行,提示这个错误 Unable to add window -- token null ...

  5. 解决MongoDB问题:Due to limitations of the com.mongodb.BasicDocument, you cant add a second null criter

    1.问题描述 Due to limitations of the com.mongodb.BasicDocument, you can t add a second null criteria. Qu ...

  6. VsCode git报错 git add -A -- xxx is outside repository

    问题: VsCode  "暂存更改"失败,报错"fatal  git add -A -- e:\x\...\xxx is outside repository" ...

  7. Cannot add property xxx, object is not extensible

    1.Composition API 创建的对象必须经过初始化,如果对已经创建的对象添加新的属性,就对出现标中的错误. const state = reactive({foo: 'bar'}); Ref ...

  8. Composition API TypeError: Cannot add property xxx, object is not extensible

    Composition API 创建的对象必须经过初始化,如果对已经创建的对象添加新的属性,就对出现标题中的错误. const state = reactive({foo: 'bar'}); Refl ...

  9. android Unable to add window -- token null is n...

    2019独角兽企业重金招聘Python工程师标准>>> 问题的原因:调用了getApplicationContext()复制给你的context 解决方法:将activity赋值co ...

最新文章

  1. 《数据竞赛入门讲义》下载,北航计算机硕士两年经验总结
  2. spark中各种数量的确定和查询(持续更新中)
  3. hash表、java中的hashMap/hashSet
  4. Javascript的基础语法(标识符/变量)
  5. php的数组操作,PHP的数组操作
  6. wp7检测网络是否可用以及网络开启简单代码段
  7. 苹果Mac测试及维护工具:​​​​​​​​Techtool Pro
  8. 【数据预测】基于matlab BP+ELM+LSTM+BiLSTM+SAELSTM数据预测【含Matlab源码 1825期】
  9. java报表查询_数据查询 | 快逸报表工具 java报表软件
  10. linux实训4文件系统管理,实训项目4 文件系统管理.docx
  11. 360极速浏览器html手机版,360极速浏览器模拟手机
  12. 华为od德科面试数据算法真题解析-专栏必看-
  13. 易懂 | 手把手教你编写你的第一个上位机
  14. php fpm 测试,php-fpm – 配置详解(转)
  15. 梦想就是一种让你感到坚持就是幸福的东西
  16. 软件测试和软件开发哪个发展更好
  17. 跨境电商-shopline
  18. Python.Extracting Data from JSON
  19. uniappAndroid离线打包 小米审核不通过
  20. 如何使用OpenAi的ChatGPT咨询AI有关于Baumer工业相机的品牌国际知名度

热门文章

  1. 自学python在家赚钱-自学python后,可以自己独立做什么事情来挣钱吗?
  2. 未能加载文件或程序集“”或它的某一个依赖项。试图加载格式不正确的程序。
  3. GNUGK 作为Gatekeeper穿透防火墙和NAT(转)
  4. git 怎么将分支合并到master分支上
  5. 《炬丰科技-半导体工艺》光电子器件及其应用
  6. 使用Process运行程序提示error: incompatible types: java.lang.Process cannot be converted to android.os.Proces
  7. 神经网络的人脸识别方法,神经网络图像识别技术
  8. C++ string常用函数(翻转字符串、获得字符串子串)(更新中)
  9. 连连看算法js实现解析(降维改进版)--附自制小程序「五十音连连看」助记平假名/片假名
  10. linux系统么播放音乐,在linux环境下播放MP3