Skip to content

Commit

Permalink
fixed the issue of the Flipper class failing to initialize
Browse files Browse the repository at this point in the history
  • Loading branch information
tortuvshin committed Dec 21, 2023
1 parent c0d0203 commit a9ff574
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 98 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -7,41 +7,37 @@
import com.facebook.react.ReactPackage;
import com.facebook.react.defaults.DefaultNewArchitectureEntryPoint;
import com.facebook.react.defaults.DefaultReactNativeHost;
import com.facebook.react.shell.MainReactPackage;
import com.facebook.soloader.SoLoader;
import com.horcrux.svg.SvgPackage;
import com.reactnativecommunity.webview.RNCWebViewPackage;
import com.swmansion.gesturehandler.react.RNGestureHandlerPackage;

import java.util.List;
import java.util.Arrays;

public class MainApplication extends Application implements ReactApplication {

private final ReactNativeHost mReactNativeHost = new DefaultReactNativeHost(this) {
private final ReactNativeHost mReactNativeHost = new ReactNativeHost(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
// packages.add(new ReactNativeConfigPackage());
return packages;
return Arrays.<ReactPackage>asList(
new MainReactPackage(),
new RNCWebViewPackage(),
new SvgPackage(),
new RNGestureHandlerPackage()
);
}

@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
Expand All @@ -53,11 +49,5 @@ public ReactNativeHost getReactNativeHost() {
public void onCreate() {
super.onCreate();
SoLoader.init(this, /* native exopackage */ false);
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());
}
}

This file was deleted.

0 comments on commit a9ff574

Please sign in to comment.