wrong native method signature called.
还没有人认领这个 Issue。
评估
- 难度
- 4/5
- 预计耗时
- 3-5 天
- 新手友好度
- 35/100
- Issue 类型
- 缺陷
- 描述清晰度
- 基本清楚
- 活跃度
- 停滞
- 技术栈
- android, cpp
- 领域
- mobile-dev
调研方向
从 gps.android.ts 中引用的位置开始,尤其是第 83 行和第 456 行,以复现 runtime 调用 LocationManager.addNmeaListener 的方式。然后跟踪 Android 原生的方法选择代码,并验证 pre-24 和 24+ 使用适当的签名且不会发生崩溃。
由索引模型根据 Issue 内容生成。
描述
I found an issue with runtime which actually calls the wrong method on android.
this the method
https://developer.android.com/reference/android/location/LocationManager#addNmeaListener(android.location.GpsStatus.NmeaListener)
That method changed in 24 and now use that signature https://developer.android.com/reference/android/location/LocationManager#addNmeaListener(android.location.OnNmeaMessageListener)
The issue is that in both cases the parameter is actually a java.lang.Object. And the runtime actually always chooses this one even on pre 24 => crash.
We discovered that issue in my gps plugin here and the actual crash happens here https://github.com/nativescript-community/gps/blob/b3fe1d032cb3e5b6f7b76f1cf62926fdab6d0baa/src/gps.android.ts#L456
- 主要语言
- C++
- 星标
- 563
- 派生
- 144
- 平均合并
- 10 小时 46 分钟
- 30 天内合并 PR
- 14
贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
NativeScript/android 的其他 Issue
-
难度 5/5 一周以上 新手友好度 38/100
NativeScript/android#2039 · 1 条评论 ·
-
难度 4/5 3-5 天 新手友好度 48/100
NativeScript/android#2024 ·
-
难度 5/5 一周以上 新手友好度 20/100
NativeScript/android#2020 ·
-
难度 5/5 一周以上 新手友好度 42/100
NativeScript/android#2019 ·
-
难度 4/5 3-5 天 新手友好度 55/100
NativeScript/android#1986 ·
查看 NativeScript/android 的全部 Issue
相似的 Issue
-
难度 1/5 1-3 小时 新手友好度 92/100
autowarefoundation/autoware_universe#13413 ·
-
难度 2/5 1-3 小时 新手友好度 88/100
-
automated-analysis bug memory-safety
难度 2/5 1-3 小时 新手友好度 68/100
-
难度 2/5 1-3 小时 新手友好度 86/100
-
Sensor initialization takes very long when `--initial-sim-time` is set to current UNIX timestamp 未关闭
难度 2/5 1-3 小时 新手友好度 78/100
gazebosim/gz-sensors#662 · 1 条评论 ·