1. 程式人生 > >react native 打包時報錯解決方式 react-native-wx:compileReleaseJavaWithJavac FAILED

react native 打包時報錯解決方式 react-native-wx:compileReleaseJavaWithJavac FAILED

錯誤顯示為:

C:\projects\projects\vcmapp\node_modules\react-native-wx\android\src\main\java\c
n\reactnative\modules\wx\WeChatModule.java:135: 錯誤: 找不到符號
        callback.invoke(null, api.isWXAppSupportAPI());
                                 ^
  符號:   方法 isWXAppSupportAPI()
  位置: 型別為IWXAPI的變數 api
1 個錯誤
:react-native-wx:compileReleaseJavaWithJavac FAILED

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':react-native-wx: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

解決方式: 先執行  gradlew compileDebug --stacktrace

再執行  gradlew tasks

然後就顯示打包成功了。

原因不清楚,只是記錄一下處理方式。