electrode-io/electrode-native

Native iOS app crashed when integrated with public container.

Closed this issue · 0 comments

Reproduce steps:

  1. Created local container with a fews mini app ern create-container --miniapps ...

  2. Tranform container: ern transform-container -p ios -t xcframework

  3. Public xcframework to git repo https://github.com/quanghoang0101/ewallet-container-framework/releases/tag/v1.0.1

  4. Installed xcframework from cocoa pod pod 'ElectrodeContainer', :git => 'https://github.com/quanghoang0101/ewallet-container-framework', :tag => 'v1.0.1'

  5. Init container in native project:
    `func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {

     let containerConfig = ElectrodeContainerConfig()
     containerConfig.debugEnabled = false
     ElectrodeReactNative.start(withConfigurations: containerConfig, ernDelegate: nil)
     window = UIWindow(frame: UIScreen.main.bounds)
     window?.rootViewController = UIViewController()
     window?.makeKeyAndVisible()
     return true
    

}`

  1. Run native project and it crashed:
    `Invariant Violation: "" has not been registered. This can happen if:
  • Metro (the local dev server) is run from the wrong folder. Check if Metro is running, stop it and restart it in the current project.
  • A module failed to load due to an error and `AppRegistry.registerComponent` wasn't called.`

I don't know which step was wrong.