问题描述

Android 的 Java代码通过Android Studio自动化转换Kotlin报错

java.lang.NullPointerException: Parameter specified as non-null is null: method kotlin.jvm.internal.Intrinsics.checkNotNullParameter, parameter convertView

出现的地方

在编写ListVIew的适配器时,覆写BaseAdapter的 getView() 出现问题


修改之后

override fun getView(position: Int, convertView: View?, parent: ViewGroup): View { }

类似的问题

activity从Java转成Kotlin之后,发生以下错误,目标指向不明:

java.lang.IllegalArgumentException: Parameter specified as non-null is null: method kotlin.jvm.internal.Intrinsics.checkParameterIsNotNull, parameter savedInstanceState

问题原因:activity的onCreate方法中savedInstanceState为非null元素。

 @Overrideprotected void onCreate(@NonNull Bundle savedInstanceState) {super.onCreate(savedInstanceState);}

解决问题:用kotlin重写的时候,也要是非null元素。

override fun onCreate(savedInstanceState: Bundle?) {super.onCreate(savedInstanceState)
}

Parameter specified as non-null is null method kotlin.jvm.internal.Intrinsics.checkNotNullParameter相关推荐

  1. Parameter specified as non-null is null: method kotlin.jvm.internal.Intrinsics.checkNotNullParameter

    Java自动转换Kotlin代码之后,编译出现的问题 原因在于有的函数的传参没有做允许空值处理,找到那个函数参数后加入?即可 eg. override fun bind(data: Any?) {do ...

  2. n-null is null: method kotlin.jvm.internal.Intrinsics.checkParameterIsNotNull, parameter convertView

    我这是把java转kotlin,报错提示: java.lang.IllegalArgumentException: Parameter specified as non-null is null: m ...

  3. Mybatis中的attempted to return null from a method with a primitive return type (int).异常

    错误截图: org.apache.ibatis.binding.BindingException: Mapper method 'com.shop_demo.dao.AdminDAO.getAdmin ...

  4. attempted to return null from a method with a primitive return type (int).

    错误产生的场景 dao层接口如下 int getResourceDataNumsByTitle(String title); mapper.xml 中sql语句如下 <select id=&qu ...

  5. MyBatis异常报告: Mapper method ‘com.dao.UserMapper.insert attempted to return null from a method with ……

    错误名称:Mapper method 'com.dao.UserMapper.insert attempted to return null from a method with a primitiv ...

  6. Mybatis:Mapper method attempted to return null from a method with a primitive return type (int)

    Mybatis中 Mapper method attempted to return null from a method with a primitive return type (int)错误 本 ...

  7. sql报错解决方案:attempted to return null from a method with a primitive return type (int)

    问题现象 idea执行查询数量语句控制台报错:attempted to return null from a method with a primitive return type (int). 解决 ...

  8. Mapper method ‘com.xxx.dao.ActivityDao.update attempted to return null from a method with a primiti

    500异常报告: Mapper method 'com.xxx.dao.ActivityDao.update attempted to return null from a method with a ...

  9. 关于mybatis的报错 attempted to return null from a method with a primitive return type (int)

    https://blog.csdn.net/kisscatforever/article/details/77801060 一.前言       在往常敲代码的时候没有留意过int和Integer的区 ...

最新文章

  1. Asp.Net Core WebAPI使用Swagger时API隐藏与分组
  2. 【转】SharePoint 编程指南
  3. 【图像处理】直方图均衡化(附带Matlab及OpenCV3自编程实现代码)
  4. MySQL 8数据导入 MySQL 5.7
  5. 使用递归方法 删除文件夹及文件夹内文件
  6. 第十一讲 在ASP.NET中使用用户控件
  7. idea里查找maven的jar包冲突
  8. Atitit 登录票据安全法 目录 1.1. cookie对象规范 1 1.2. Cookie加解密 1 1.3. Cookie密文动态更换,根据一个时间3天比如 1 1.4. 服务端撤销key 1
  9. STC学习:导航按键与数字按键综合控制数码管
  10. 计算机电源的瓦数是什么,电脑的电源功率大小有区别吗?对电脑有什么影响吗?...
  11. 用matlab音频欠采样率时域采样,matlab时域采样定理.doc
  12. 基于token的多平台身份认证架构设计
  13. scara机器人dh参数表_scara机器人技术参数
  14. Opencv 16位深度图片显示并保存
  15. 【iOS】苹果登录Sign in with Apple
  16. Java毕业设计_基于javaweb的网上预约实验室管理系统的设计与实现
  17. JSON文件的读取操作详解
  18. es6 arry fill
  19. 利用python和tushare,统计股市每天上涨的概率
  20. javascript对输入框的字数限制(转自愚人码头)

热门文章

  1. usaco3.2.7香甜的奶油
  2. 从头开始构建一台8位计算机 - 完整的零件清单
  3. 网络编程:网络协议简介
  4. RAW和QCOW2 两种存储设备格式区别
  5. Eclipese快捷键
  6. 1011: 【基础】空心六边形
  7. 如何从YouTube历史记录中暂停,清除和删除视频
  8. 计算机B和D的转换,模数转换
  9. 哪个品牌的触控笔质量好?ipad好用的触控笔
  10. 2022 年最佳开源软件出炉