云网牛站
所在位置:首页 > HarmonyOS问题与回答 > HarmonyOS中app调试安装在手机上有两个或多个图标显示

HarmonyOS中app调试安装在手机上有两个或多个图标显示

2021-06-21 17:25:54作者:435949346稿源:HarmonyOS站

问题:在鸿蒙HarmonyOS中app调试安装在手机上有两个或多个图标显示,如下图所示:

HarmonyOS中app调试安装在手机上有两个或多个图标显示

 

问题追加:

如下代码:

{

  "app": {

    "bundleName": "com.example.demophone",

    "vendor": "example",

    "version": {

      "code": 1000000,

      "name": "1.0.0"

    }

  },

  "deviceConfig": {

    "default": {

      "network": {

        "securityConfig": {

          "domainSettings": {

            "cleartextPermitted": true,

            "domains": [

              {

                "name": "aa",

                "subdomains": true

              }

            ]

          }

        }

      }

    }

  },

  "module": {

    "package": "com.example.demophone",

    "name": ".MyApplication",

    "mainAbility": "com.example.demophone.MainAbility",

    "deviceType": [

      "phone"

    ],

    "distro": {

      "deliveryWithInstall": true,

      "moduleName": "entry",

      "moduleType": "entry",

      "installationFree": false

    },

    "abilities": [

      {

        "skills": [

          {

            "entities": [

              "entity.system.home"

            ],

            "actions": [

              "action.system.home"

            ]

          }

        ],

        "metaData": {

          "customizeData": [

            {

              "name": "hwc-theme",

              "value": "androidhwext:style/Theme.Emui.NoTitleBar"

            }

          ]

        },

        "name": "com.example.demophone.MainAbility",

        "icon": "$media:icon",

        "description": "$string:mainability_description",

        "label": "$string:entry_MainAbility",

        "type": "page",

        "launchType": "standard"

      },

      {

        "skills": [

          {

            "entities": [

              "entity.system.home"

            ],

            "actions": [

              "action.system.home"

            ]

          }

        ],

        "name": "com.example.demophone.SecondAbility",

        "icon": "$media:icon",

        "description": "",

        "label": "$string:SecondAbility",

        "type": "page",

        "launchType": "standard",

        "visible": false

      },

      {

        "name": "com.example.demophone.ComputeServiceAbility",

        "icon": "$media:icon",

        "description": "$string:computeserviceability_description",

        "type": "service"

      },

      {

        "name": "com.example.demophone.ComputeAbility",

        "icon": "$media:icon",

        "description": "$string:computeability_description",

        "type": "service"

      }

    ],

    "reqPermissions": [

      {

        "name": "ohos.permission.INTERNET",

        "reason": ""

      },

      {

        "name": "ohos.permission.CAMERA",

        "reason": "需要摄像头权限"

      },

      {

        "name": "ohos.permission.GET_NETWORK_INFO"

      },

      {

        "name": "ohos.permission.SET_NETWORK_INFO"

      },

      {

        "name": "ohos.permission.VIBRATE"

      },

      {

        "name": "ohos.permission.GET_WIFI_INFO"

      },

      {

        "name": " ohos.permission.GET_BUNDLE_INFO"

      },

      {

        "name": " ohos.permission.CAMERA"

      },

      {

        "name": "tohos.permission.MICROPHONE"

      },

      {

        "name": "ohos.permission.LOCATION"

      },

      {

        "name": "ohos.permission.WRITE_USER_STORAGE"

      }

    ],

    "js": [

      {

        "pages": [

          "pages/index/index",

          "pages/dialogPage/dialogPage",

          "pages/panelPage/panelPage",

          "pages/popupPage/popupPage",

          "pages/stackPage/stackPage",

          "pages/tabPage/tabPage",

          "pages/jsCallJava/jsCallJava"

        ],

        "name": "default",

        "window": {

          "designWidth": 720,

          "autoDesignWidth": true

        }

      }

    ]

  }

}

 

回答:

就如上代码而言,请把secondAbility里的以下代码删掉即可:

"skills": [

          {

            "entities": [

              "entity.system.home"

            ],

            "actions": [

              "action.system.home"

            ]

          }

        ],

 

说明:

经实测,把以上代码去除后就没有多余的图标了。如再遇到类似问题,可采用同样的方法处理。

精选文章
热门文章