zoukankan      html  css  js  c++  java
  • React Native遇到的坑

    错误提示

    错误一:

    出现这个问题,解决方法:打开menu,点击“Dev Settings”,然后在点击“Debug server host&port for device”,在输入框中输入:连接的电脑的IP地址:8081

    问题二:

    Invariant Violation:Applicaction 项目名 has not been registered.This is either due to a require() error during initialization or failure to call AppRegistry.registerCommponent.

    这个错误的根本原因是根目录./index.android.js中

    AppRegistry.registerComponent('项目名',() => ...);

    与./android/项目名/appDelegate.m中的

    RCTRootView*rootView = [[RCTRootViewalloc]initWithBundleURL:jsCodeLocation

    moduleName:@"项目名" launchOptions:launchOptions];

    或是./android/app/src/main/java/com/项目名/MainActivity.java中的

    mReactRootView.startReactApplication(mReactInstanceManager, "项目名", null);

    没有保持一致,解决方法很简单。编辑成相同的参数即可。




  • 相关阅读:
    hdoj:2033
    hdoj:2032
    hdoj:2031
    hdoj:2029
    hdoj:2028
    hdoj:2027
    hdoj:2024
    hdoj:2023
    hdoj:2022
    hdoj:题目分类
  • 原文地址:https://www.cnblogs.com/chhom/p/5749101.html
Copyright © 2011-2022 走看看