做热更新步骤的时候到这一步的报错是什么意思?



  • 我已经把所有热更新的配置都设置好了,在进行发布版本的时候就会出现这个错误,不知是为什么?不知道是在哪一步错了!

    :react-native-update:compileReleaseJavaWithJavac - is not incremental (e.g. outputs have changed, no previous execution, etc.).
    E:\work\TestMy\node_modules\react-native-update\android\src\main\java\cn\reactnative\modules\update\UpdateModule.java:128: 错误: 无法将类 JSBundleLoader中的方法 createFileLoader应用到给定类型;
    JSBundleLoader loader = JSBundleLoader.createFileLoader(application, UpdateContext.getBundleUrl(application));
    ^
    需要: String
    找到: Application,String
    原因: 实际参数列表和形式参数列表长度不同
    1 个错误
    :react-native-update:compileReleaseJavaWithJavac FAILED

    FAILURE: Build failed with an exception.

    • What went wrong:
      Execution failed for task ':react-native-update:compileReleaseJavaWithJavac'.

    Compilation failed; see the compiler error output for details.

    • Try:
      Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.

    BUILD FAILED

    Total time: 3.167 secs





  • @ocman 说:

    @huangdou
    128行有两个application参数,都要去掉吗?我去掉第一个application后会报这样的错误:
    :app:compileReleaseJavaWithJavac
    :app:compileReleaseJavaWithJavac - is not incremental (e.g. outputs have changed, no previous execution, etc.).
    E:\work\TestMy\android\app\src\main\java\com\testmy\MainApplication.java:22: 错误: 找不到符号
    return UpdateContext.getBundleUrl(MainApplication.this);
    ^
    符号: 变量 UpdateContext
    1 个错误
    :app:compileReleaseJavaWithJavac FAILED

    FAILURE: Build failed with an exception.

    • What went wrong:
      Execution failed for task ':app:compileReleaseJavaWithJavac'.

    Compilation failed; see the compiler error output for details.

    • Try:
      Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.

    BUILD FAILED



  • @sunnylqm

    两个application都去掉之后会报这样的错误:

    :react-native-update:compileReleaseJavaWithJavac
    E:\work\TestMy\node_modules\react-native-update\android\src\main\java\cn\reactnative\modules\update\UpdateModule.java:128: 错误: 无法从静态上下文中引用非静态 方法 getBundleUrl()
    JSBundleLoader loader = JSBundleLoader.createFileLoader(UpdateContext.getBundleUrl());
    ^
    1 个错误
    Incremental compilation of 2 classes completed in 0.237 secs.
    :react-native-update:compileReleaseJavaWithJavac FAILED

    FAILURE: Build failed with an exception.

    What went wrong:
    Execution failed for task ':react-native-update:compileReleaseJavaWithJavac'.
    Compilation failed; see the compiler error output for details.
    Try:
    Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.
    BUILD FAILED