Repository navigation
Closed as not planned
Closed as not planned
Copy link
Labels
Needs: Triage 🔍Platform: AndroidAndroid applications.StaleThere has been a lack of activity on this issue and it may be closed soon.
Description
Description
Code completion does not work since React Native version 0.81.0
- Tested against few version of Android Studio:
Narwhal,Otter,Panda - Tested against few version of React Native:
0.81.x,0.82.x,0.83.x,0.84.x
- Noticed that
gradle-plugin [gradle-plugin-root]is missing from project hierarchy on the left in Android Studio, not sure whether it's due to change of recent AGP version
Steps to reproduce
- Run React Native CLI to initiate project, e.g:
npx @react-native-community/cli@latest init AwesomeProject0803 --version 0.81.0 - Run
yarn && yarn start - Run
yarn androidat least once - Open Android Studio & allow it to for gradle sync & indexing... etc
- In
MainActivityorMainApplication, try either of following
a. Try to access React Native source code viaCommand + clickinMacOS
b. type on code to trigger code completion, e.g:override func onCreateto see whether anything happen
React Native Version
0.83.1
Affected Platforms
Build - MacOS, Runtime - Android
Output of npx @react-native-community/cli info
System:
OS: macOS 26.2
CPU: (12) arm64 Apple M2 Pro
Memory: 134.20 MB / 16.00 GB
Shell:
version: "5.9"
path: /bin/zsh
Binaries:
Node:
version: 22.14.0
path: /Users/userA/Library/pnpm/node
Yarn:
version: 1.22.22
path: /Users/userA/.yarn/bin/yarn
npm:
version: 10.9.2
path: /Users/userA/Library/pnpm/npm
Watchman: Not Found
Managers:
CocoaPods: Not Found
SDKs:
iOS SDK:
Platforms:
- DriverKit 25.2
- iOS 26.2
- macOS 26.2
- tvOS 26.2
- visionOS 26.2
- watchOS 26.2
Android SDK:
API Levels:
- "30"
- "35"
- "36"
Build Tools:
- 35.0.0
- 36.0.0
- 36.1.0
System Images:
- android-36 | Google Play ARM 64 v8a
Android NDK: Not Found
IDEs:
Android Studio: 2025.3 AI-253.29346.138.2531.14850935
Xcode:
version: 26.2/17C52
path: /usr/bin/xcodebuild
Languages:
Java:
version: 17.0.10
path: /usr/bin/javac
Ruby:
version: 2.6.10
path: /usr/bin/ruby
npmPackages:
"@react-native-community/cli":
installed: 20.1.0
wanted: 20.1.0
react:
installed: 19.2.3
wanted: 19.2.3
react-native:
installed: 0.84.0-rc.4
wanted: 0.84.0-rc.4
react-native-macos: Not Found
npmGlobalPackages:
"*react-native*": Not Found
Android:
hermesEnabled: true
newArchEnabled: true
iOS:
hermesEnabled: Not found
newArchEnabled: false
Stacktrace or Logs
-
MANDATORY Reproducer
https://github.com/JunPG/AwesomeProject0831
Screenshots and Videos
React Native 0.80.3
React Native 0.83.1 (ReproducerApp)
React Native 0.84.0-rc

Reacted by ForceTower, Stephen, Andres Lamont, Pooria, Jesper Johansson, Qdafengzi, webbin, FuriousBoar and 🌮 Memo Martinez
Metadata
Metadata
Assignees
Labels
Needs: Triage 🔍Platform: AndroidAndroid applications.StaleThere has been a lack of activity on this issue and it may be closed soon.

Activity
lukechen-ct commentedon Feb 12, 2026
+1
GODueol commentedon Feb 26, 2026
In previous versions of AndroidStudio, disabling k2 mode temporarily solved the problem, but now that option is no longer available, there is no workaround.
kading commentedon Mar 9, 2026
You can still use
-Didea.kotlin.plugin.use.k1=truein newer versions. I have the same problem in my project that uses react-native native turbomodules.kading commentedon Mar 9, 2026
I get this error in my Android log:
felipesaggion commentedon Mar 11, 2026
@kading's answer worked for me. Just put
-Didea.kotlin.plugin.use.k1=trueinsidestudio64.exe.vmoptionsand you're good to go. Yet we're still waiting for a correction on k2.jsjeon commentedon Mar 30, 2026
Yeah, this aligned with: https://developer.android.com/studio/releases/past-releases/as-narwhal-feature-drop-release-notes#k2-mode-default
Not sure which versions we're talking about, but in the upcoming version (Panda 3 and onward), Android Studio no longer supports K1 mode, and will unset this system property. (FYI, IntelliJ will do so too.)
and this is the point. K2 mode uses a new / stricter project structure. More discussion will be found at https://issuetracker.google.com/issues/494294075
jsjeon commentedon Mar 31, 2026
Please take a look at https://issuetracker.google.com/issues/494294075#comment3
My debugging so far indicates that there is indeed a problem about the project structure. While analyzing
MainApplicationunderapp, its super type,ReactApplicationunder../node-modules/react-native/ReactAndroidneeds to be analyzed, but FIR can't find the enclosing module for that. If it's a regular*Applicationfrom Android SDK, it would be a library module. But, somehow, the entire../node-modulesappears as part of source roots of the mainapp, leading the retrieval ofReactApplicationto the source file, while that file doesn't belong to any module.Qdafengzi commentedon Mar 31, 2026
This issue is a lifesaver. We haven't found a solution for several days. Upgrading to the new architecture version of react native has too many problems
elijahsanders152-stack commentedon Mar 31, 2026
DHRUV-1000101 commentedon Mar 31, 2026
There is another workaround but its very annoying. You can mark node modules as excluded, this fixes the issue for me but this exclusion needs to be done after every gradle resync. Just right click on node modules (if not visible switch to project files view mode) folder and mark as excluded, with this method we dont need to disable k2 mode. If there is some way to permanently exclude node modules until it's officially resolved please let me know.
jsjeon commentedon Mar 31, 2026
Oh, the OP of https://issuetracker.google.com/issues/494294075 refers to this issue as a similar issue, not their exact issue. Then, I left investigations in the wrong place. 🤦🏼
^ Exactly. All sources under
.../node-modulesappear as source roots of the mainappmodule, which causes all the resolutions to declarations inside that, includingReactApplicationfor example, goes to source resolution, while it's supposed to be other means, like dependency/binary resolution.To that end,
I think so. Somewhere a module structure or gradle configuration is generated, we shouldn't add the entire
.../node-modules.jsjeon commentedon Apr 17, 2026
FYI, filed https://youtrack.jetbrains.com/issue/KTIJ-38436
Also, from the internal version of Android Studio, I can dump the project structure, and the culprit matches what I described at that YT ticket:
That is, that
NativeSource(pointing to../../node_modules) is regarded as source entry, and thenReactApplicationinsidenode_modulesis used to resolve the usage of that declaration.webbin commentedon Apr 22, 2026
You can try using Android Studio Otter 3 Feature Drop | 2025.2.3. This version supports disabling K2 mode, which allows you to view Kotlin code normally without any errors and should fix the code completion issue.
To disable it:
Go to Settings/Preferences > Languages & Frameworks > Kotlin and uncheck "Enable K2 Kotlin Mode".
Vikmanatus commentedon May 16, 2026
Thanks @larafmina2-beep, to automate this workaround you can update your
android/app/build.gradlewith the following :This regenerates the IDE module file marking node_modules as excluded on every Sync Project with Gradle Files, so code completion comes back without you having to right-click → Mark as Excluded each time.
Notes:
The
$MODULE_DIR$/../../../../node_modulespath assumes the standard RN layout (node_modules one level above android/). Monorepo users will need to adjust the path.Tested and working on
Android Studio Panda 4 | 2025.3.4 Patch 1withreact-native0.85.3Best regards
jsjeon commentedon May 19, 2026
This is fixed in the next canary of Android Studio: https://issuetracker.google.com/issues/494294075#comment17
react-native-bot commentedon Nov 16, 2026
This issue is stale because it has been open 180 days with no activity. Remove stale label or comment or this will be closed in 7 days.
react-native-bot commentedon Nov 23, 2026
This issue was closed because it has been stalled for 7 days with no activity.