请教下android原生中引入RN热更新的一些问题·



  • 代码如下
    public class WodeReactActivity extends Activity implements DefaultHardwareBackBtnHandler {
    private ReactRootView mReactRootView;
    private ReactInstanceManager mReactInstanceManager;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
    
        mReactRootView = new ReactRootView(this);
        mReactInstanceManager = ReactInstanceManager.builder()
                .setApplication(getApplication())
                .setBundleAssetName("index.android.bundle")
                .setJSMainModuleName("index.android")
                .setJSBundleFile(UpdateContext.getBundleUrl(this))
                .addPackage(new AnExampleReactPackage())
                .setUseDeveloperSupport(false)
                .setInitialLifecycleState(LifecycleState.RESUMED)
                .build();
        mReactRootView.startReactApplication(mReactInstanceManager, "MyAwesomeApp", null);
    
        setContentView(mReactRootView);
    }
    

    我只在这个activity中加入RN,之前调试用手机连接本地server运行demo没啥问题,但是热更新我就不太清楚怎么设置了,有没大手指导下,不胜感激


登录后回复