[Android] [0.68.0] Cannot find symbols for new architecture upgrade
See original GitHub issueNew 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
import com.rndiffapp.newarchitecture.components.MainComponentsRegistry;
return BuildConfig.DEBUG;
if (BuildConfig.IS_NEW_ARCHITECTURE_ENABLED)
Steps tried to debug:
- Adding
import com.rndiffapp.BuildConfig;
for this file
Issue: Cannot find symbol MainComponentsRegistry
File android\app\src\main\java\com\rndiffapp\newarchitecture\MainApplicationReactNativeHost.java
return new MainApplicationTurboModuleManagerDelegate.Builder();
MainComponentsRegistry.register(componentFactory);
Steps tried to debug:
- Adding
import com.rndiffapp.newarchitecture.components.MainComponentsRegistry;
to top of file - Addeding
import com.rndiffapp.newarchitecture.modules.MainApplicationTurboModuleManagerDelegate;
to top of file
Steps to reproduce:
- Follow upgrade guide on https://react-native-community.github.io/upgrade-helper/?from=0.65.1&to=0.68.0
- Keep updating files from the top all the way till
android/app/src/main/java/com/rndiffapp/MainApplication.java
- Open Android studio
- Start running any virtual device
- run
yarn android
ornpm run react-native
Issue Analytics
- State:
- Created a year ago
- Reactions:5
- Comments:11 (4 by maintainers)
Top GitHub Comments
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 useimport com.projectname.BuildConfig;
, whereprojectname
is the name of my project. Hope this helps someone out there.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
to enable
MainApplication.java
)MainActivity.java
)from
gradle.properties
whennewArchEnabled=true
if that helps clarify @swrobel