Closed athulantony95 closed 7 months ago
:warning: | Missing Reproducible Example |
---|---|
:information_source: | We could not detect a reproducible example in your issue report. Please provide either:
|
@athulantony95 Could you share your MainApplication.kt
and MainActivity.kt
?
Do you have any other custom native code, specifically code related to initialization of the app?
Hi @cortinico Here is the snippet
MainActivity.java
public class MainActivity extends ReactActivity {
/**
* Returns the name of the main component registered from JavaScript.
* This is used to schedule rendering of the component.
*/
@Override
protected String getMainComponentName() {
return "APPNAME";
}
/**
* Returns the instance of the {@link ReactActivityDelegate}. Here we use a util class {@link
* DefaultReactActivityDelegate} which allows you to easily enable Fabric and Concurrent React
* (aka React 18) with two boolean flags.
*/
@Override
protected ReactActivityDelegate createReactActivityDelegate() {
return new DefaultReactActivityDelegate(
this,
getMainComponentName(),
// If you opted-in for the New Architecture, we enable the Fabric Renderer.
DefaultNewArchitectureEntryPoint.getFabricEnabled());
}
}
MainApplication.java
public class MainApplication extends Application implements ReactApplication {
private final ReactNativeHost mReactNativeHost = new DefaultReactNativeHost(this) {
@Override
public boolean getUseDeveloperSupport() {
return BuildConfig.DEBUG;
}
@Override
protected List<ReactPackage> getPackages() {
@SuppressWarnings("UnnecessaryLocalVariable")
List<ReactPackage> packages = new PackageList(this).getPackages();
// Packages that cannot be autolinked yet can be added manually here, for example:
packages.add(new RNThreadPackage(mReactNativeHost, new RNPrinterPackage()));
return packages;
}
@Override
protected String getJSMainModuleName() {
return "index";
}
@Override
protected boolean isNewArchEnabled() {
return BuildConfig.IS_NEW_ARCHITECTURE_ENABLED;
}
@Override
protected Boolean isHermesEnabled() {
return BuildConfig.IS_HERMES_ENABLED;
}
};
@Override
public ReactNativeHost getReactNativeHost() {
return mReactNativeHost;
}
@Override
public void onCreate() {
super.onCreate();
SoLoader.init(this, /* native exopackage */ false);
IntercomModule.initialize(this, BuildConfig.INTERCOM_API_KEY, BuildConfig.INTERCOM_APP_ID);
if (BuildConfig.IS_NEW_ARCHITECTURE_ENABLED) {
// If you opted-in for the New Architecture, we load the native entry point for this app.
DefaultNewArchitectureEntryPoint.load();
}
ReactNativeFlipper.initializeFlipper(this, getReactNativeHost().getReactInstanceManager());
}
}
@athulantony95 would you be able to share your project somehow?
@cortinico not possible atm. Its a private project. Do you have any guesses or theories on why i am getting this error?
@cortinico not possible atm. Its a private project. Do you have any guesses or theories on why i am getting this error?
Nope not really. Without a reproducer we can't help further. Are you able to use https://github.com/react-native-community/reproducer-react-native to create a reproduce that would fail in the same way?
Okay. I will try to reproduce in the template you've given. Thanks @cortinico
Hi @cortinico i was able to get rid of the error while i tried to remove the multi-threading package we are using.I believe the maintainers of that library can help me. I will be closing this thread and moving the conversation to respective repo. Thanks again!
Great thank you very much 👍 Could you link the issue you opened on the other repo?
Description
Hi team, I tried to enable new architecture in my RN project for android. App is building ,But i am getting this error when the app opens.
TurboModules are enabled, but mTurboModuleRegistry hasn't been set.
Steps to reproduce
gradle.properties
file.React Native Version
0.72.10
Affected Platforms
Runtime - Android
Areas
Fabric - The New Renderer, TurboModule - The New Native Module System
Output of
npx react-native info
Stacktrace or Logs
Reproducer
none
Screenshots and Videos