electrode-io / electrode-native

A platform to ease integration&delivery of React Native apps in existing mobile applications
https://native.electrode.io
Other
723 stars 113 forks source link

Native iOS app crashed when integrated with public container. #1904

Closed quanghoang0101 closed 5 months ago

quanghoang0101 commented 5 months ago

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

    }`

  6. 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.