question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[Android] [0.68.0] Cannot find symbols for new architecture upgrade

See original GitHub issue

New Version

0.68.0

Old Version

0.65.1

Build Target(s)

Android - Pixel 4 (API 32)

Output of react-native info

System: OS: Windows 10 10.0.19042 CPU: (6) x64 Intel® Core™ i5-9400F CPU @ 2.90GHz Memory: 18.33 GB / 31.94 GB Binaries: Node: 16.14.0 - C:\Program Files\nodejs\node.EXE Yarn: 3.1.1 - ~\AppData\Roaming\npm\yarn.CMD npm: 8.3.1 - C:\Program Files\nodejs\npm.CMD Watchman: Not Found SDKs: Android SDK: Not Found Windows SDK: AllowAllTrustedApps: Disabled IDEs: Android Studio: Version 2021.1.0.0 AI-211.7628.21.2111.8193401 Visual Studio: 17.0.31912.275 (Visual Studio Community 2022) Languages: Java: 1.8.0_312 npmPackages: @react-native-community/cli: Not Found react: 17.0.2 => 17.0.2 react-native: 0.68.0 => 0.68.0 react-native-windows: Not Found npmGlobalPackages: react-native: Not Found

Issue and Reproduction Steps

Issue: Cannot find symbol BuildConfig Places issues detected: File android\app\src\main\java\com\rndiffapp\MainApplication.java

  1. import com.rndiffapp.newarchitecture.components.MainComponentsRegistry;
  2. return BuildConfig.DEBUG;
  3. if (BuildConfig.IS_NEW_ARCHITECTURE_ENABLED)

Steps tried to debug:

  1. Adding import com.rndiffapp.BuildConfig; for this file

Issue: Cannot find symbol MainComponentsRegistry File android\app\src\main\java\com\rndiffapp\newarchitecture\MainApplicationReactNativeHost.java

  1. return new MainApplicationTurboModuleManagerDelegate.Builder();
  2. MainComponentsRegistry.register(componentFactory);

Steps tried to debug:

  1. Adding import com.rndiffapp.newarchitecture.components.MainComponentsRegistry; to top of file
  2. Addeding import com.rndiffapp.newarchitecture.modules.MainApplicationTurboModuleManagerDelegate; to top of file

Steps to reproduce:

  1. Follow upgrade guide on https://react-native-community.github.io/upgrade-helper/?from=0.65.1&to=0.68.0
  2. Keep updating files from the top all the way till android/app/src/main/java/com/rndiffapp/MainApplication.java
  3. Open Android studio
  4. Start running any virtual device
  5. run yarn android or npm run react-native

Issue Analytics

  • State:closed
  • Created a year ago
  • Reactions:5
  • Comments:11 (4 by maintainers)

github_iconTop GitHub Comments

18reactions
marlonschlosshauercommented, Jul 19, 2022

I had a similar issue, but unrelated to upgrading. Nonetheless I had a similar fix. Instead of import com.facebook.react.BuildConfig; I had to use import com.projectname.BuildConfig;, where projectname is the name of my project. Hope this helps someone out there.

11reactions
leotmcommented, May 5, 2022

the diff can b a bit… iffy at times 😅 here’s what we want

https://react-native-community.github.io/upgrade-helper/?from=0.65.1&to=0.69.0-rc.0

Capture

to enable

  • TurboModules (via MainApplication.java)
  • Fabric (via MainActivity.java)

from gradle.properties when

  • newArchEnabled=true

if that helps clarify @swrobel

Read more comments on GitHub >

github_iconTop Results From Across the Web

cannot find symbol reactRootView.setIsFabric(BuildConfig ...
through react-native CLI, and now every time I'm trying to build for android I get this error: error: cannot find symbol reactRootView. ...
Read more >
Bundled Hermes - React Native
This aligns the build mechanism of React Native and Hermes for users on the New Architecture (they will build both framework from source)....
Read more >
How to Resolve The Cannot Find Symbol Error in Java - Rollbar
The cannot find symbol error refers to a situation where the Java compiler is unable to find the symbol associated with a given...
Read more >
execution failed for task ':react-native-reanimated ... - You.com
When i try to run "react-native run-android" command i get build failed with ... cannot find symbol private final ReactNativeHost mReactNativeHost = new...
Read more >
React Native App - Automatic Setup - Flipper
To create your own plugins and integrate with Flipper using JavaScript, see the Building a React Native Plugin tutorial. Using the latest Flipper...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found