HarmonyOS 鸿蒙Next:开发好har,编译成.har包,har包作为页面使用ohpm安装,@group/name包名结构报错"imported from",去group可正常跳转
HarmonyOS 鸿蒙Next:开发好har,编译成.har包,har包作为页面使用ohpm安装,@group/name包名结构报错"imported from",去group可正常跳转
有要学HarmonyOS AI的同学吗,联系我:https://www.itying.com/goods-1206.html
关于HarmonyOS 鸿蒙Next:开发好har,编译成.har包,har包作为页面使用ohpm安装,@group/name包名结构报错"imported from",去group可正常跳转的问题,您也可以访问:https://www.itying.com/category-93-b0.html 联系官网客服。
更多关于HarmonyOS 鸿蒙Next:开发好har,编译成.har包,har包作为页面使用ohpm安装,@group/name包名结构报错"imported from",去group可正常跳转的实战教程也可以访问 https://www.itying.com/category-93-b0.html
在项目本地开发好一个har包后,在项目根目录通过ohpm install packages/component 进行安装,功能正常运行,但是将har包通过IDE编译生成.har包后,安装该.har包(ohpm install packages/component/build/default/outputs/default/component.har),运行功能报错,错误如下:

build-profile.json5 编译配置文件如下
{
  "apiType": "stageMode",
  "buildOption": {
  },
  "buildOptionSet": [
    {
      "name": "release",
      "arkOptions": {
        "obfuscation": {
          "ruleOptions": {
            "enable": false,
            "files": [
              "./obfuscation-rules.txt"
            ]
          },
          "consumerFiles": [
            "./consumer-rules.txt"
          ]
        }
      },
    },
  ],
  "targets": [
    {
      "name": "default"
    },
    {
      "name": "ohosTest"
    }
  ]
}
<button style="position: absolute; padding: 4px 8px 0px; cursor: pointer; top: 8px; right: 8px; font-size: 14px;">复制</button>请问,有谁知道问题在哪里么
.har包中是一个页面,通过路由进行跳转
private pathStack: NavPathStack = new NavPathStack();
pathStack.pushPathByName('dfyjModalPanel');
路由声明在了route_map.json中,我使用的是API 12
route_map.json
{
  "routerMap": [
    {
      "name": "dfyjModalPanel",
      "pageSourceFile": "src/main/ets/pageComponent/ModalPanel/index.ets",
      "buildFunction": "ModalPanelComponentBuilder",
      "data": {
        "description" : "this is PageOne"
      }
    }
  ]
}<button style="position: absolute; padding: 4px 8px 0px; cursor: pointer; top: 8px; right: 8px; font-size: 14px;">复制</button>oh-package.json5
{
  "name": "[@dfyj](/user/dfyj)/component",
  "version": "0.0.1-beta.0",
  "description": "todo",
  "main": "Index.ets",
  "author": "jiangxin",
  "keywords": [
    "dfyjcomponent"
  ],
  "license": "Apache-2.0",
  "dependencies": {}
}<button style="position: absolute; padding: 4px 8px 0px; cursor: pointer; top: 8px; right: 8px; font-size: 14px;">复制</button>后来发现在 oh-package.json5中如果name的结构为[@group](/user/group)/name 就会出现上述问题,这有解么。。。。。。。。
更多关于HarmonyOS 鸿蒙Next:开发好har,编译成.har包,har包作为页面使用ohpm安装,@group/name包名结构报错"imported from",去group可正常跳转的实战系列教程也可以访问 https://www.itying.com/category-93-b0.html
希望HarmonyOS能继续加强在安全性方面的研发,保护用户的隐私和数据安全。
oh-package.json5文件中的name值如果包含分组名就会有问题 【@group/xxxxxx 这种结构会有问题】但是不知如何解决
经过测试发现 是oh-package.json5文件中的name值如果包含分组名就会有问题,@group/xxxxxx 这种结构会有问题,但是不知道怎么解决。。。。。。(在不删除group名的情况下)
 
        
       
                   
                   
                  

