Skip to content

yarn dev:ios #93

@stephanevallejo

Description

@stephanevallejo

Hello,

I did:
yarn install
and next did:
yarn dev:ios
to test on Apple TV but I have this error:

✔ Created native directory
› Using react-native@npm:react-native-tvos@~0.81.0-0 instead of recommended react-native@0.81.5.
✔ Updated package.json | no changes
» ios: icon: No icon is defined in the Expo config.
✖ Prebuild failed
Error: [ios.appDelegate]: withIosAppDelegateBaseMod: Failed to match "@implementation AppDelegate" in contents:
import Expo
import React
import ReactAppDependencyProvider

@UIApplicationMain
public class AppDelegate: ExpoAppDelegate {
  var window: UIWindow?

  var reactNativeDelegate: ExpoReactNativeFactoryDelegate?
  var reactNativeFactory: RCTReactNativeFactory?

  public override func application(
    _ application: UIApplication,
    didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]? = nil
  ) -> Bool {
    let delegate = ReactNativeDelegate()
    let factory = ExpoReactNativeFactory(delegate: delegate)
    delegate.dependencyProvider = RCTAppDependencyProvider()

    reactNativeDelegate = delegate
    reactNativeFactory = factory
    bindReactNativeFactory(factory)

#if os(iOS) || os(tvOS)
    window = UIWindow(frame: UIScreen.main.bounds)
    factory.startReactNative(
      withModuleName: "main",
      in: window,
      launchOptions: launchOptions)
#endif

    return super.application(application, didFinishLaunchingWithOptions: launchOptions)
  }

  // Linking API
  public override func application(
    _ app: UIApplication,
    open url: URL,
    options: [UIApplication.OpenURLOptionsKey: Any] = [:]
  ) -> Bool {
    return super.application(app, open: url, options: options) || RCTLinkingManager.application(app, open: url, options: options)
  }

  // Universal Links
  public override func application(
    _ application: UIApplication,
    continue userActivity: NSUserActivity,
    restorationHandler: @escaping ([UIUserActivityRestoring]?) -> Void
  ) -> Bool {
    let result = RCTLinkingManager.application(application, continue: userActivity, restorationHandler: restorationHandler)
    return super.application(application, continue: userActivity, restorationHandler: restorationHandler) || result
  }
}

class ReactNativeDelegate: ExpoReactNativeFactoryDelegate {
  // Extension point for config-plugins

  override func sourceURL(for bridge: RCTBridge) -> URL? {
    // needed to return the correct URL for expo-dev-client.
    bridge.bundleURL ?? bundleURL()
  }

  override func bundleURL() -> URL? {
#if DEBUG
    return RCTBundleURLProvider.sharedSettings().jsBundleURL(forBundleRoot: ".expo/.virtual-metro-entry")
#else
    return Bundle.main.url(forResource: "main", withExtension: "jsbundle")
#endif
  }
}

Error: [ios.appDelegate]: withIosAppDelegateBaseMod: Failed to match "@implementation AppDelegate" in contents:
import Expo
import React
import ReactAppDependencyProvider

@UIApplicationMain
public class AppDelegate: ExpoAppDelegate {
  var window: UIWindow?

  var reactNativeDelegate: ExpoReactNativeFactoryDelegate?
  var reactNativeFactory: RCTReactNativeFactory?

  public override func application(
    _ application: UIApplication,
    didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]? = nil
  ) -> Bool {
    let delegate = ReactNativeDelegate()
    let factory = ExpoReactNativeFactory(delegate: delegate)
    delegate.dependencyProvider = RCTAppDependencyProvider()

    reactNativeDelegate = delegate
    reactNativeFactory = factory
    bindReactNativeFactory(factory)

#if os(iOS) || os(tvOS)
    window = UIWindow(frame: UIScreen.main.bounds)
    factory.startReactNative(
      withModuleName: "main",
      in: window,
      launchOptions: launchOptions)
#endif

    return super.application(application, didFinishLaunchingWithOptions: launchOptions)
  }

  // Linking API
  public override func application(
    _ app: UIApplication,
    open url: URL,
    options: [UIApplication.OpenURLOptionsKey: Any] = [:]
  ) -> Bool {
    return super.application(app, open: url, options: options) || RCTLinkingManager.application(app, open: url, options: options)
  }

  // Universal Links
  public override func application(
    _ application: UIApplication,
    continue userActivity: NSUserActivity,
    restorationHandler: @escaping ([UIUserActivityRestoring]?) -> Void
  ) -> Bool {
    let result = RCTLinkingManager.application(application, continue: userActivity, restorationHandler: restorationHandler)
    return super.application(application, continue: userActivity, restorationHandler: restorationHandler) || result
  }
}

class ReactNativeDelegate: ExpoReactNativeFactoryDelegate {
  // Extension point for config-plugins

  override func sourceURL(for bridge: RCTBridge) -> URL? {
    // needed to return the correct URL for expo-dev-client.
    bridge.bundleURL ?? bundleURL()
  }

  override func bundleURL() -> URL? {
#if DEBUG
    return RCTBundleURLProvider.sharedSettings().jsBundleURL(forBundleRoot: ".expo/.virtual-metro-entry")
#else
    return Bundle.main.url(forResource: "main", withExtension: "jsbundle")
#endif
  }
}

    at addLines (/Users/stephane/Documents/Nexup/customers/moselletv/apps/MoselleTV-tvOS/apps/expo-multi-tv/node_modules/@bam.tech/react-native-keyevent-expo-config-plugin/node_modules/@expo/config-plugins/src/utils/generateCode.ts:82:19)
    at mergeContents (/Users/stephane/Documents/Nexup/customers/moselletv/apps/MoselleTV-tvOS/apps/expo-multi-tv/node_modules/@bam.tech/react-native-keyevent-expo-config-plugin/node_modules/@expo/config-plugins/src/utils/generateCode.ts:55:17)
    at action (/Users/stephane/Documents/Nexup/customers/moselletv/apps/MoselleTV-tvOS/apps/expo-multi-tv/node_modules/@bam.tech/react-native-keyevent-expo-config-plugin/build/withReactNativeKeyevent.js:61:60)
    at action (/Users/stephane/Documents/Nexup/customers/moselletv/apps/MoselleTV-tvOS/apps/expo-multi-tv/node_modules/@bam.tech/react-native-keyevent-expo-config-plugin/node_modules/@expo/config-plugins/src/plugins/withMod.ts:228:29)
    at nextMod (/Users/stephane/Documents/Nexup/customers/moselletv/apps/MoselleTV-tvOS/apps/expo-multi-tv/node_modules/@bam.tech/react-native-keyevent-expo-config-plugin/node_modules/@expo/config-plugins/src/plugins/withMod.ts:109:27)
    at action (/Users/stephane/Documents/Nexup/customers/moselletv/apps/MoselleTV-tvOS/apps/expo-multi-tv/node_modules/@expo/config-plugins/src/plugins/withMod.ts:229:14)
    at interceptingMod (/Users/stephane/Documents/Nexup/customers/moselletv/apps/MoselleTV-tvOS/apps/expo-multi-tv/node_modules/@expo/config-plugins/src/plugins/withMod.ts:109:21)
    at action (/Users/stephane/Documents/Nexup/customers/moselletv/apps/MoselleTV-tvOS/apps/expo-multi-tv/node_modules/@expo/config-plugins/src/plugins/createBaseMod.ts:82:21)
    at interceptingMod (/Users/stephane/Documents/Nexup/customers/moselletv/apps/MoselleTV-tvOS/apps/expo-multi-tv/node_modules/@expo/config-plugins/src/plugins/withMod.ts:109:21)
    at evalModsAsync (/Users/stephane/Documents/Nexup/customers/moselletv/apps/MoselleTV-tvOS/apps/expo-multi-tv/node_modules/@expo/config-plugins/src/plugins/mod-compiler.ts:190:25)

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions