react / react/react-native

can not trigger Kotlin code suggestions

未关闭
#55,814 6 条评论 1 个 reaction 已指派 0 人 在 GitHub 查看

还没有人认领这个 Issue。

Needs: Attention Needs: Repro
主要语言
C++
星标
127k
派生
25.3k
平均合并
1 天 23 小时
30 天内合并 PR
4

描述

Description

In MainActivity,can not trigger Kotlin code suggestions.
But Comment out the code then can trigger code suggestions
import com.facebook.react.ReactActivity
import com.facebook.react.ReactActivityDelegate
import com.facebook.react.defaults.DefaultNewArchitectureEntryPoint.fabricEnabled
import com.facebook.react.defaults.DefaultReactActivityDelegate

Steps to reproduce

1、create project
2、open Android Studio
3、open MainActivity
4、print code

React Native Version

0.83.2

Affected Platforms

Runtime - Android

Output of npx @react-native-community/cli info
System:
  OS: Windows 11 10.0.26200
  CPU: (8) x64 Intel(R) Core(TM) i3-10100 CPU @ 3.60GHz
  Memory: 9.24 GB / 31.75 GB
Binaries:
  Node:
    version: 24.12.0
    path: C:\Users\zhumi\AppData\Local\Volta\tools\image\node\24.12.0\node.EXE
  Yarn:
    version: 4.10.3
    path: C:\Users\zhumi\AppData\Local\Volta\tools\image\yarn\4.10.3\bin\yarn.CMD
  npm:
    version: 11.6.2
    path: C:\Users\zhumi\AppData\Local\Volta\tools\image\node\24.12.0\npm.CMD
  Watchman: Not Found
SDKs:
  Android SDK:
    API Levels:
      - "28"
      - "29"
      - "30"
      - "31"
      - "32"
      - "33"
      - "34"
      - "35"
      - "36"
      - "36"
    Build Tools:
      - 28.0.3
      - 29.0.2
      - 29.0.3
      - 30.0.0
      - 30.0.3
      - 31.0.0
      - 33.0.0
      - 33.0.1
      - 34.0.0
      - 35.0.0
      - 36.0.0
      - 36.1.0
    System Images:
      - android-23 | Android TV Intel x86 Atom
      - android-29 | Google Play Intel x86 Atom
      - android-31 | Google APIs Intel x86 Atom_64
      - android-35 | Google APIs Intel x86_64 Atom
    Android NDK: Not Found
  Windows SDK:
    AllowDevelopmentWithoutDevLicense: Enabled
    AllowAllTrustedApps: Enabled
IDEs:
  Android Studio: Not Found
  Visual Studio: Not Found
Languages:
  Java:
    version: 18.0.2.1
    path: C:\Program Files\Common Files\Oracle\Java\javapath\javac.EXE
  Ruby: Not Found
npmPackages:
  "@react-native-community/cli":
    installed: 20.0.0
    wanted: 20.0.0
  react:
    installed: 19.2.0
    wanted: 19.2.0
  react-native:
    installed: 0.83.2
    wanted: 0.83.2
  react-native-windows: Not Found
npmGlobalPackages:
  "*react-native*": Not Found
Android:
  hermesEnabled: true
  newArchEnabled: true
iOS:
  hermesEnabled: Not found
  newArchEnabled: Not found
Stacktrace or Logs
none
MANDATORY Reproducer

none

Screenshots and Videos

贡献指南

打开贡献指南

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

调研方向

首先,在 Android Studio 中使用 MainActivity 里列出的 ReactActivity 和 delegate 导入来复现该问题,然后将这些导入注释掉并比较代码补全行为。除了 MainActivity 之外,没有指定的源文件,也没有测试、日志或强制要求的 reproducer;完成标准是找出原因,并为所报告的 React Native 0.83.2 设置恢复 Kotlin 代码建议。

由索引模型根据 Issue 内容生成。

评估

技术栈
android, kotlin, react-native
领域
developer-experience, mobile-dev
Issue 类型
缺陷
难度
4/5
预计耗时
3-5 天
活跃度
冷清
描述清晰度
需要澄清
新手友好度
35/100

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。