uni-app 打包鸿蒙应用报错 ohpm INFO: MetaDataFetcher fetching meta info of package '@uni_modules/uni-push'

发布于 1周前 作者 wuwangju 来自 Uni-App

uni-app 打包鸿蒙应用报错 ohpm INFO: MetaDataFetcher fetching meta info of package ‘@uni_modules/uni-push’

产品分类

uniapp/App

PC开发环境操作系统

Windows

PC开发环境操作系统版本号

win11

HBuilderX类型

正式

HBuilderX版本号

4.36

手机系统

Android

手机系统版本号

Android 15

手机厂商

华为

手机机型

华为

页面类型

vue

vue版本

vue3

打包方式

云端

项目创建方式

HBuilderX

示例代码

15:40:33.086 ​src/utils/uniapi.js (434:44): Error when using sourcemap for reporting an error: Can't resolve original location of error.
15:41:40.652 项目 zzt-uniapp-vue3-vite 编译成功。
15:41:42.015 安装鸿蒙工程的依赖 ...
15:41:42.918 ohpm INFO: MetaDataFetcher fetching meta info of package '[@uni_modules](/user/uni_modules)/uni-push' from https://ohpm.openharmony.cn/ohpm/
ohpm INFO: MetaDataFetcher fetching meta info of package '[@cashier_alipay](/user/cashier_alipay)/cashiersdk' from https://ohpm.openharmony.cn/ohpm/
ohpm INFO: MetaDataFetcher fetching meta info of package '[@ohos](/user/ohos)/hypium' from https://ohpm.openharmony.cn/ohpm/
ohpm ERROR: missing: @dcloudio/uts-harmony@E:\a\dist\release\a.huawei.com\entry\src\main\ets\uts, required by @
ohpm ERROR: Found exception: Error: Fetch local folder package error, E:\a\dist\release\a.huawei.com\entry\src\main\ets\uts does not exist., reached retry limit or non retryable error encountered.
ohpm ERROR: missing: @dcloudio/uni-app-harmony@E:\a\dist\release\a.huawei.com\entry\src\main\ets\uni-app-harmony, required by @
ohpm ERROR: Found exception: Error: Fetch local folder package error, E:\a\dist\release\a.huawei.com\entry\src\main\ets\uni-app-harmony does not exist., reached retry limit or non retryable error encountered.
ohpm ERROR: missing: @dcloudio/uni-app-harmony-framework@E:\a\dist\release\a.huawei.com\entry\src\main\resources\rawfile\uni-app, required by @
ohpm ERROR: Found exception: Error: Fetch local folder package error, E:\a\dist\release\a.huawei.com\entry\src\main\resources\rawfile\uni-app does not exist., reached retry limit or non retryable error encountered.
ohpm ERROR: Install failed, detail: Error: Fetch local folder package error, E:\a\dist\release\a.huawei.com\entry\src\main\ets\uts does not exist.
15:41:42.919 安装鸿蒙工程依赖失败
15:41:42.919 运行方式:打开 undefined, 导入 dist\build\app-harmony 运行。
16:00:42.422 <--- Last few GCs --->
16:00:42.422 [5016:000001FDD984CE10]  5883108 ms: Mark-sweep 2022.1 (2089.7) -> 2010.2 (2094.0) MB, 827.8 / 0.0 ms  (average mu = 0.772, current mu = 0.034) allocation failure; scavenge might not succeed
16:00:42.422 [5016:000001FDD984CE10]  5884495 ms: Mark-sweep 2026.2 (2094.0) -> 2014.3 (2098.0) MB, 1355.3 / 0.0 ms  (average mu = 0.559, current mu = 0.023) allocation failure; scavenge might not succeed
16:00:42.422 <--- JS stacktrace --->
16:00:42.422 FATAL ERROR: Reached heap limit Allocation failed - JavaScript heap out of memory
16:00:42.634  1: 00007FF6264E5AFF node_api_throw_syntax_error+174175
16:00:42.638  2: 00007FF626468F26 v8::internal::wasm::WasmCode::safepoint_table_offset+59926
16:00:42.638  3: 00007FF62646ABC0 v8::internal::wasm::WasmCode::safepoint_table_offset+67248
16:00:42.638  4: 00007FF626F16224 v8::Isolate::ReportExternalAllocationLimitReached+116
16:00:42.638  5: 00007FF626F015B2 v8::Isolate::Exit+674
16:00:42.638  6: 00007FF626D8327C v8::internal::EmbedderStackStateScope::ExplicitScopeForTesting+124
16:00:42.638  7: 00007FF626D8049B v8::internal::Heap::CollectGarbage+3963
16:00:42.638  8: 00007FF626D966D3 v8::internal::HeapAllocator::AllocateRawWithLightRetrySlowPath+2099
16:00:42.638  9: 00007FF626D96F7D v8::internal::HeapAllocator::AllocateRawWithRetryOrFailSlowPath+93
16:00:42.638 10: 00007FF626DA6740 v8::internal::Factory::NewFillerObject+816
16:00:42.638 11: 00007FF626A97145 v8::internal::DateCache::Weekday+1349
16:00:42.638 12: 00007FF626FB4121 v8::internal::SetupIsolateDelegate::SetupHeap+558257
16:00:42.638 13: 00007FF626FB50D4 v8::internal::SetupIsolateDelegate::SetupHeap+562276
16:00:42.638 14: 00007FF5B35071B2

操作步骤

15:40:33.086 ​src/utils/uniapi.js (434:44): Error when using sourcemap for reporting an error: Can't resolve original location of error.
15:41:40.652 项目 zzt-uniapp-vue3-vite 编译成功。
15:41:42.015 安装鸿蒙工程的依赖 ...
15:41:42.918 ohpm INFO: MetaDataFetcher fetching meta info of package '[@uni_modules](/user/uni_modules)/uni-push' from https://ohpm.openharmony.cn/ohpm/
ohpm INFO: MetaDataFetcher fetching meta info of package '[@cashier_alipay](/user/cashier_alipay)/cashiersdk' from https://ohpm.openharmony.cn/ohpm/
ohpm INFO: MetaDataFetcher fetching meta info of package '[@ohos](/user/ohos)/hypium' from https://ohpm.openharmony.cn/ohpm/
ohpm ERROR: missing: @dcloudio/uts-harmony@E:\a\dist\release\a.huawei.com\entry\src\main\ets\uts, required by @
ohpm ERROR: Found exception: Error: Fetch local folder package error, E:\a\dist\release\a.huawei.com\entry\src\main\ets\uts does not exist., reached retry limit or non retryable error encountered.
ohpm ERROR: missing: @dcloudio/uni-app-harmony@E:\a\dist\release\a.huawei.com\entry\src\main\ets\uni-app-harmony, required by @
ohpm ERROR: Found exception: Error: Fetch local folder package error, E:\a\dist\release\a.huawei.com\entry\src\main\ets\uni-app-harmony does not exist., reached retry limit or non retryable error encountered.
ohpm ERROR: missing: @dcloudio/uni-app-harmony-framework@E:\a\dist\release\a.huawei.com\entry\src\main\resources\rawfile\uni-app, required by @
ohpm ERROR: Found exception: Error: Fetch local folder package error, E:\a\dist\release\a.huawei.com\entry\src\main\resources\rawfile\uni-app does not exist., reached retry limit or non retryable error encountered.
ohpm ERROR: Install failed, detail: Error: Fetch local folder package error, E:\a\dist\release\a.huawei.com\entry\src\main\ets\uts does not exist.
15:41:42.919 安装鸿蒙工程依赖失败
15:41:42.919 运行方式:打开 undefined, 导入 dist\build\app-harmony 运行。
16:00:42.422 <--- Last few GCs --->
16:00:42.422 [5016:000001FDD984CE10]  5883108 ms: Mark-sweep 2022.1 (2089.7) -> 2010.2 (2094.0) MB, 827.8 / 0.0 ms  (average mu = 0.772, current mu = 0.034) allocation failure; scavenge might not succeed
16:00:42.422 [5016:000001FDD984CE10]  5884495 ms: Mark-sweep 2026.2 (2094.0) -> 2014.3 (2098.0) MB, 1355.3 / 0.0 ms  (average mu = 0.559, current mu = 0.023) allocation failure; scavenge might not succeed
16:00:42.422 <--- JS stacktrace --->
16:00:42.422 FATAL ERROR: Reached heap limit Allocation failed - JavaScript heap out of memory
16:00:42.634  1: 00007FF6264E5AFF node_api_throw_syntax_error+174175
16:00:42.638  2: 00007FF626468F26 v8::internal::wasm::WasmCode::safepoint_table_offset+59926
16:00:42.638  3: 00007FF62646ABC0 v8::internal::wasm::WasmCode::safepoint_table_offset+67248
16:00:42.638  4: 00007FF626F16224 v8::Isolate::ReportExternalAllocationLimitReached+116
16:00:42.638  5: 00007FF626F015B2 v8::Isolate::Exit+674
16:00:42.638  6: 00007FF626D8327C v8::internal::EmbedderStackStateScope::ExplicitScopeForTesting+124
16:00:42.638  7: 00007FF626D8049B v8::internal::Heap::CollectGarbage+3963
16:00:42.638  8: 00007FF626D966D3 v8::internal::HeapAllocator::AllocateRawWithLightRetrySlowPath+2099
16:00:42.638  9: 00007FF626D96F7D v8::internal::HeapAllocator::AllocateRawWithRetryOrFailSlowPath+93
16:00:42.638 10: 00007FF626DA6740 v8::internal::Factory::NewFillerObject+816
16:00:42.638 11: 00007FF626A97145 v8::internal::DateCache::Weekday+1349
16:00:42.638 12: 00007FF626FB4121 v8::internal::SetupIsolateDelegate::SetupHeap+558257
16:00:42.638 13: 00007FF626FB50D4 v8::internal::SetupIsolateDelegate::SetupHeap+562276
16:00:42.638 14: 00007FF5B35071B2

预期结果

15:40:33.086 ​src/utils/uniapi.js (434:44): Error when using sourcemap for reporting an error: Can't resolve original location of error.
15:41:40.652 项目 zzt-uniapp-vue3-vite 编译成功。
15:41:42.015 安装鸿蒙工程的依赖 ...
15:41:42.918 ohpm INFO: MetaDataFetcher fetching meta info of package '[@uni_modules](/user/uni_modules)/uni-push' from https://ohpm.openharmony.cn/ohpm/
ohpm INFO: MetaDataFetcher fetching meta info of package '[@cashier_alipay](/user/cashier_alipay)/cashiersdk' from https://ohpm.openharmony.cn/ohpm/
ohpm INFO: MetaDataFetcher fetching meta info of package '[@ohos](/user/ohos)/hypium' from https://ohpm.openharmony.cn/ohpm/
ohpm ERROR: missing: @dcloudio/uts-harmony@E:\a\dist\release\a.huawei.com\entry\src\main\ets\uts, required by @
ohpm ERROR: Found exception: Error: Fetch local folder package error, E:\a\dist\release\a.huawei.com\entry\src\main\ets\uts does not exist., reached retry limit or non retryable error encountered.
ohpm ERROR: missing: @dcloudio/uni-app-harmony@E:\a\dist\release\a.huawei.com\entry\src\main\ets\uni-app-harmony, required by @
ohpm ERROR: Found exception: Error: Fetch local folder package error, E:\a\dist\release\a.huawei.com\entry\src\main\ets\uni-app-harmony does not exist., reached retry limit or non retryable error encountered.
ohpm ERROR: missing: @dcloudio/uni-app-harmony-framework@E:\a\dist\release\a.huawei.com\entry\src\main\resources\rawfile\uni-app, required by @
ohpm ERROR: Found exception: Error: Fetch local folder package error, E:\a\dist\release\a.huawei.com\entry\src\main\resources\rawfile\uni-app does not exist., reached retry limit or non retryable error encountered.
ohpm ERROR: Install failed, detail: Error: Fetch local folder package error, E:\a\dist\release\a.huawei.com\entry\src\main\ets\uts does not exist.
15:41:42.919 安装鸿蒙工程依赖失败
15:41:42.919 运行方式:打开 undefined, 导入 dist\build\app-harmony 运行。
16:00:42.422 <--- Last few GCs --->
16:00:42.422 [5016:000001FDD984CE10]  5883108 ms: Mark-sweep 2022.1 (2089.7) -> 2010.2 (2094.0) MB, 827.8 / 0.0 ms  (average mu = 0.772, current mu = 0.034) allocation failure; scavenge might not succeed
16:00:42.422 [5016:000001FDD984CE10]  5884495 ms: Mark-sweep 2026.2 (2094.0) -> 2014.3 (2098.0) MB, 1355.3 / 0.0 ms  (average mu = 0.559, current mu = 0.023) allocation failure; scavenge might not succeed
16:00:42.422 <--- JS stacktrace --->
16:00:42.422 FATAL ERROR: Reached heap limit Allocation failed - JavaScript heap out of memory
16:00:42.634  1: 00007FF6264E5AFF node_api_throw_syntax_error+174175
16:00:42.638  2: 00007FF626468F26 v8::internal::wasm::WasmCode::safepoint_table_offset+59926
16:00:42.638  3: 00007FF62646ABC0 v8::internal::wasm::WasmCode::safepoint_table_offset+67248
16:00:42.638  4: 00007FF626F16224 v8::Isolate::ReportExternalAllocationLimitReached+116
16:00:42.638  5: 00007FF626F015B2 v8::Isolate::Exit+674
16:00:42.638  6: 00007FF626D8327C v8::internal::EmbedderStackStateScope::ExplicitScopeForTesting+124
16:00:42.638  7: 00007FF626D8049B v8::internal::Heap::CollectGarbage+3963
16:00:42.638  8: 00007FF626D966D3 v8::internal::HeapAllocator::AllocateRawWithLightRetrySlowPath+2099
16:00:42.638  9: 00007FF626D96F7D v8::internal::HeapAllocator::AllocateRawWithRetryOrFailSlowPath+93
16:00:42.638 10: 00007FF626DA6740 v8::internal::Factory::NewFillerObject+816
16:00:42.638 11: 00007FF626A97145 v8::internal::DateCache::Weekday+1349
16:00:42.638 12: 00007FF626FB4121 v8::internal::SetupIsolateDelegate::SetupHeap+558257
16:00:42.638 13: 00007FF626FB50D4 v8::internal::SetupIsolateDelegate::SetupHeap+562276
16:00:42.638 14: 00007FF5B35071B2

实际结果

15:40:33.086 ​src/utils/uniapi.js (434:44): Error when using sourcemap for reporting an error: Can't resolve original location of error.
15:41:40.652 项目 zzt-uniapp-vue3-vite 编译成功。
15:41:42.015 安装鸿蒙工程的依赖 ...
15:41:42.918 ohpm INFO: MetaDataFetcher fetching meta info of package '[@uni_modules](/user/uni_modules)/uni-push' from https://ohpm.openharmony.cn/ohpm/
ohpm INFO: MetaDataFetcher fetching meta info of package '[@cashier_alipay](/user/cashier_alipay)/cashiersdk' from https://ohpm.openharmony.cn/ohpm/
ohpm INFO: MetaDataFetcher fetching meta info of package '[@ohos](/user/ohos)/hypium' from https://ohpm.openharmony.cn/ohpm/
ohpm ERROR: missing: @dcloudio/uts-harmony@E:\a\dist\release\a.huawei.com\entry\src\main\ets\uts, required by @
ohpm ERROR: Found exception: Error: Fetch local folder package error, E:\a\dist\release\a.huawei.com\entry\src\main\ets\uts does not exist., reached retry limit or non retryable error encountered.
ohpm ERROR: missing: @dcloudio/uni-app-harmony@E:\a\dist\release\a.huawei.com\entry\src\main\ets\uni-app-harmony, required by @
ohpm ERROR: Found exception: Error: Fetch local folder package error, E:\a\dist\release\a.huawei.com\entry\src\main\ets\uni-app-harmony does not exist., reached retry limit or non retryable error encountered.
ohpm ERROR: missing: @dcloudio/uni-app-harmony-framework@E:\a\dist\release\a.huawei.com\entry\src\main\resources\rawfile\uni-app, required by @
ohpm ERROR: Found exception: Error: Fetch local folder package error, E:\a\dist\release\a.huawei.com\entry\src\main\resources\rawfile\uni-app does not exist., reached retry limit or non retryable error encountered.
ohpm ERROR: Install failed, detail: Error: Fetch local folder package error, E:\a\dist\release\a.huawei.com\entry\src\main\ets\uts does not exist.
15:41:42.919 安装鸿蒙工程依赖失败
15:41:42.919 运行方式:打开 undefined, 导入 dist\build\app-harmony 运行。
16:00:42.422 <--- Last few GCs --->
16:00:42.422 [5016:000001FDD984CE10]  5883108 ms: Mark-sweep 2022.1 (2089.7) -> 2010.2 (2094.0) MB, 827.8 / 0.0 ms  (average mu = 0.772, current mu = 0.034) allocation failure; scavenge might not succeed
16:00:42.422 [5016:000001FDD984CE10]  5884495 ms: Mark-sweep 2026.2 (2094.0) -> 2014.3 (2098.0) MB, 1355.3 / 0.0 ms  (average mu = 0.559, current mu = 0.023) allocation failure; scavenge might not succeed
16:00:42.422 <--- JS stacktrace --->
16:00:42.422 FATAL ERROR: Reached heap limit Allocation failed - JavaScript heap out of memory
16:00:42.634  1: 00007FF6264E5AFF node_api_throw_syntax_error+174175
16:00:42.638  2: 00007FF626468F26 v8::internal::wasm::WasmCode::safepoint_table_offset+59926
16:00:42.638  3: 00007FF62646ABC0 v8::internal::wasm::WasmCode::safepoint_table_offset+67248
16:00:42.638  4: 00007FF626F16224 v8::Isolate::ReportExternalAllocationLimitReached+116
16:00:42.638  5: 00007FF626F015B2 v8::Isolate::Exit+674
16:00:42.638  6: 00007FF626D8327C v8::internal::EmbedderStackStateScope::ExplicitScopeForTesting+124
16:00:42.638  7: 00007FF626D8049B v8::internal::Heap::CollectGarbage+3963
16:00:42.638  8: 00007FF626D966D3 v8::internal::HeapAllocator::AllocateRawWithLightRetrySlowPath+2099
16:00:42.638  9: 00007FF626D96F7D v8::internal::HeapAllocator::AllocateRawWithRetryOrFailSlowPath+93
16:00:42.638 10: 00007FF626DA6740 v8::internal::Factory::NewFillerObject+816
16:00:42.638 11: 00007FF626A97145 v8::internal::DateCache::Weekday+1349
16:00:42.638 12: 00007FF626FB4121 v8::internal::SetupIsolateDelegate::SetupHeap+558257
16:00:42.638 13: 00007FF626FB50D4 v8::internal::SetupIsolateDelegate::SetupHeap+562276
16:00:42.638 14: 00007FF5B35071B2

更多关于uni-app 打包鸿蒙应用报错 ohpm INFO: MetaDataFetcher fetching meta info of package '@uni_modules/uni-push'的实战系列教程也可以访问 https://www.itying.com/category-93-b0.html

2 回复

使用HBuilderX 4.36新创建一个工程看看

更多关于uni-app 打包鸿蒙应用报错 ohpm INFO: MetaDataFetcher fetching meta info of package '@uni_modules/uni-push'的实战系列教程也可以访问 https://www.itying.com/category-93-b0.html


在处理uni-app打包鸿蒙应用时遇到关于@uni_modules/uni-push模块的报错,通常是因为模块依赖、配置问题或者模块本身与鸿蒙系统的兼容性问题。由于错误信息ohpm INFO: MetaDataFetcher fetching meta info of package '@uni_modules/uni-push'只显示了正在获取模块元信息的操作,并没有具体的错误代码或描述,我们需要从几个常见的问题点入手进行排查和解决。

1. 检查模块安装与版本

首先确保@uni_modules/uni-push模块已经正确安装,并且版本与uni-app及鸿蒙SDK兼容。你可以通过以下命令检查并安装(或更新)该模块:

# 安装或更新uni-push模块
npm install @uni_modules/uni-push@latest --save

2. 检查manifest.json配置

确保在manifest.json中正确配置了uni-push相关的权限和设置。以下是一个基本的配置示例:

{
  "mp-huawei": { // 鸿蒙应用配置
    "appid": "your-huawei-appid",
    "setting": {
      "requestPermissions": [
        "ohos.permission.INTERNET",
        // 其他必要的权限,如推送相关权限
      ]
    },
    "plugins": {
      "@uni_modules/uni-push": {
        "version": "latest", // 或具体版本号
        "provider": "uni-push-provider"
      }
    }
  }
}

3. 鸿蒙特定配置与代码调整

由于鸿蒙系统有其特定的API和权限要求,你可能需要在代码中做一些特定的调整。例如,确保在请求推送权限时使用了鸿蒙系统提供的API。这里是一个简化的示例,展示如何在代码中处理权限请求(注意,实际代码需要根据鸿蒙SDK文档调整):

if (uni.getSystemInfoSync().platform === 'ohos') {
  // 鸿蒙系统特有的权限请求代码
  ohos.permission.request({
    permissions: ['ohos.permission.PUSH_RECEIVE'],
    success: function (data) {
      console.log('权限请求成功');
    },
    fail: function (err) {
      console.error('权限请求失败', err);
    }
  });
}

4. 查看构建日志与错误输出

如果以上步骤未能解决问题,建议详细查看构建日志和错误输出,查找是否有更具体的错误信息或警告。这有助于定位问题所在。

结论

由于鸿蒙系统的特殊性和uni-app框架的持续更新,处理此类问题可能需要结合最新的官方文档和社区资源。确保所有依赖和配置都是最新的,并且符合鸿蒙系统的要求。如果问题依旧存在,考虑在uni-app社区或鸿蒙开发者论坛寻求帮助。

回到顶部