Ejected iOS production app still has dev menu?!

After ejecting from ExpoKitbare I now have the debug menu on my production apps too and I can’t seem to be able to get rid of it. This only happens on iOS, not on android.

Here are my settings in xcode:
image

Many solutions reference a jsCodeLocation option that needs to be customized, but I can’t find it in my AppDelegate.m file (and it’s not present in a brand new bare expo app either):

/**
 * Copyright (c) Facebook, Inc. and its affiliates.
 *
 * This source code is licensed under the MIT license found in the
 * LICENSE file in the root directory of this source tree.
 */
#import "AppDelegate.h"
#import <React/RCTBridge.h>
#import <React/RCTBundleURLProvider.h>
#import <React/RCTRootView.h>
#import <UMCore/UMModuleRegistry.h>
#import <UMReactNativeAdapter/UMNativeModulesProxy.h>
#import <UMReactNativeAdapter/UMModuleRegistryAdapter.h>
#import <FBSDKCoreKit/FBSDKCoreKit.h>
@implementation AppDelegate
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
  self.moduleRegistryAdapter = [[UMModuleRegistryAdapter alloc] initWithModuleRegistryProvider:[[UMModuleRegistryProvider alloc] init]];
  RCTBridge *bridge = [[RCTBridge alloc] initWithDelegate:self launchOptions:launchOptions];
  RCTRootView *rootView = [[RCTRootView alloc] initWithBridge:bridge moduleName:@"xxxxxx" initialProperties:nil];
  if (@available(iOS 13.0, *)) {
  rootView.overrideUserInterfaceStyle = UIUserInterfaceStyleLight;
  }
  rootView.backgroundColor = [[UIColor alloc] initWithRed:1.0f green:1.0f blue:1.0f alpha:1];
  self.window = [[UIWindow alloc] initWithFrame:[UIScreen mainScreen].bounds];
  UIViewController *rootViewController = [UIViewController new];
  rootViewController.view = rootView;
  self.window.rootViewController = rootViewController;
  [self.window makeKeyAndVisible];
  [[FBSDKApplicationDelegate sharedInstance] application:application
    didFinishLaunchingWithOptions:launchOptions];
  return YES;
}
- (NSArray<id<RCTBridgeModule>> *)extraModulesForBridge:(RCTBridge *)bridge
{
  NSArray<id<RCTBridgeModule>> *extraModules = [_moduleRegistryAdapter extraModulesForBridge:bridge];
  // You can inject any extra modules that you would like here, more information at:
  // https://facebook.github.io/react-native/docs/native-modules-ios.html#dependency-injection
  return extraModules;
}
- (NSURL *)sourceURLForBridge:(RCTBridge *)bridge
{
#if DEBUG
  return [[RCTBundleURLProvider sharedSettings] jsBundleURLForBundleRoot:@"index" fallbackResource:nil];
#else
  return [[NSBundle mainBundle] URLForResource:@"main" withExtension:@"jsbundle"];
#endif
}
// Facebook tracking
- (BOOL)application:(UIApplication *)application 
    openURL:(NSURL *)url 
		options:(NSDictionary<UIApplicationOpenURLOptionsKey,id> *)options {
    BOOL handled = [[FBSDKApplicationDelegate sharedInstance] application:application
        openURL:url
		    sourceApplication:options[UIApplicationOpenURLOptionsSourceApplicationKey]
		    annotation:options[UIApplicationOpenURLOptionsAnnotationKey]
    		];
  // Add any custom logic here.
  return handled;
}
- (void)applicationDidBecomeActive:(UIApplication *)application {
    [FBSDKAppEvents activateApp];
}	
@end

I’m building it via fastlane:

build_app(
      workspace: "./ios/xxxxxx.xcworkspace", 
      scheme: "xxxxxx", 
      xcargs: "-allowProvisioningUpdates"
    )

Hi! Sorry you’re running into this. The bare workflow is really just a vanilla react native project, so I’m guessing the menu you are seeing looks similar to this and not this?

Hey @charliecruzan thanks for the prompt answer.
I found the solution to my woes:
Our project.pbxproj file contained duplicate references to Pods-myproject.release.xcconfig and Pods-myproject.debug.xcconfig due to an oversight.

I found the solution after cleaning the whole project and comparing the changes in git.

rm -rf ~/Library/Caches/CocoaPods ./ios/Pods ~/Library/Developer/Xcode/DerivedData/*; 
rm -rf node_modules; 
yarn cache clean; 
yarn; 
cd ios; 
pod deintegrate; 
pod setup; 
pod install; 
cd ...

I hadn’t understood why builds would fail in fastlane and I had to manually remove the libRCT* files from the target in xcode, which was hacky as hell.

Now this is history :wink:

This topic was automatically closed 20 days after the last reply. New replies are no longer allowed.