1ilI / WebViewJavascriptBridge_harmony

6 stars 3 forks source link

用你的例子试了下,运行不起来报错 #1

Open youlongxifeng opened 2 months ago

youlongxifeng commented 2 months ago

/Applications/DevEco-Studio.app/Contents/tools/node/bin/node /Applications/DevEco-Studio.app/Contents/tools/hvigor/bin/hvigorw.js clean --mode module -p product=default assembleHap --analyze=normal --parallel --incremental --daemon

hvigor Finished :entry:clean... after 587 ms hvigor Finished :entry:default@PreBuild... after 473 ms hvigor Finished :entry:default@GenerateMetadata... after 12 ms hvigor Finished :entry:default@ConfigureCmake... after 1 ms hvigor Finished :entry:default@MergeProfile... after 28 ms hvigor Finished :entry:default@CreateBuildProfile... after 8 ms hvigor Finished :entry:default@PreCheckSyscap... after 1 ms hvigor Finished :entry:default@GeneratePkgContextInfo... after 2 ms hvigor Finished :entry:default@ProcessIntegratedHsp... after 4 ms hvigor Finished :entry:default@BuildNativeWithCmake... after 1 ms hvigor Finished :entry:default@MakePackInfo... after 20 ms hvigor Finished :entry:default@ProcessProfile... after 218 ms hvigor Finished :entry:default@SyscapTransform... after 19 ms hvigor Finished :entry:default@ProcessRouterMap... after 9 ms hvigor Finished :entry:default@BuildNativeWithNinja... after 3 ms hvigor Finished :entry:default@ProcessResource... after 21 ms hvigor Finished :entry:default@GenerateLoaderJson... after 39 ms hvigor Finished :entry:default@CompileResource... after 843 ms hvigor Finished :entry:default@BuildJS... after 5 ms hvigor Finished :entry:default@ProcessLibs... after 2 s 193 ms hvigor Finished :entry:default@DoNativeStrip... after 52 ms hvigor Finished :entry:default@CacheNativeLibs... after 2 s 783 ms "@yue/WebViewJavascriptBridge" is imported by "entry/src/main/ets/pages/Index.ets", but could not be resolved – treating it as an external dependency. hvigor ERROR: Failed :entry:default@CompileArkTS... hvigor ERROR: ArkTS Compiler Error 1 WARN: ArkTS:WARN: For details about ArkTS syntax errors, see FAQs 1 ERROR: ArkTS:ERROR File: /Users/xiezhenggen/AndroidStudioProjects/DevEcoStudioProjects/2024/07/uniAppHarmonyOS/entry/src/main/ets/pages/Index.ets:41:5 Namespaces cannot be used as objects (arkts-no-ns-as-obj)

2 ERROR: ArkTS:ERROR File: /Users/xiezhenggen/AndroidStudioProjects/DevEcoStudioProjects/2024/07/uniAppHarmonyOS/entry/src/main/ets/pages/Index.ets:104:28 Use explicit types instead of "any", "unknown" (arkts-no-any-unknown)

3 ERROR: ArkTS:ERROR File: /Users/xiezhenggen/AndroidStudioProjects/DevEcoStudioProjects/2024/07/uniAppHarmonyOS/entry/src/main/ets/pages/Index.ets:40:13 Declaration expected.

4 ERROR: ArkTS:ERROR File: /Users/xiezhenggen/AndroidStudioProjects/DevEcoStudioProjects/2024/07/uniAppHarmonyOS/entry/src/main/ets/pages/Index.ets:70:5 Declaration or statement expected.

5 ERROR: ArkTS:ERROR File: /Users/xiezhenggen/AndroidStudioProjects/DevEcoStudioProjects/2024/07/uniAppHarmonyOS/entry/src/main/ets/pages/Index.ets:6:8 Cannot find module '@yue/WebViewJavascriptBridge' or its corresponding type declarations.

6 ERROR: ArkTS:ERROR File: /Users/xiezhenggen/AndroidStudioProjects/DevEcoStudioProjects/2024/07/uniAppHarmonyOS/entry/src/main/ets/pages/Index.ets:20:12 Property 'webView' does not exist on type 'Index'.

7 ERROR: ArkTS:ERROR File: /Users/xiezhenggen/AndroidStudioProjects/DevEcoStudioProjects/2024/07/uniAppHarmonyOS/entry/src/main/ets/pages/Index.ets:41:5 This expression is not callable. Type 'typeof webview' has no call signatures.

8 ERROR: ArkTS:ERROR File: /Users/xiezhenggen/AndroidStudioProjects/DevEcoStudioProjects/2024/07/uniAppHarmonyOS/entry/src/main/ets/pages/Index.ets:20:7 'this.webView();' does not meet UI component syntax.

9 ERROR: ArkTS:ERROR File: /Users/xiezhenggen/AndroidStudioProjects/DevEcoStudioProjects/2024/07/uniAppHarmonyOS/entry/src/main/ets/pages/Index.ets:40:5 Only UI component syntax can be written in build method.

COMPILE RESULT:FAIL {ERROR:10 WARN:1}

hvigor ERROR: BUILD FAILED in 23 s 725 ms

Process finished with exit code -1

1ilI commented 2 months ago

你的编辑器版本是多少,DP1 、DP2、DB1、DB2、DB3,我都运行过,没遇到过这种情况,另外看起来这报错大部分都是 xxx/uniAppHarmonyOS/entry/src/main/ets/pages/Index.ets 这里面的,你单独运行 demo 试一下?(本库即 demo 工程)