You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

华为Dynamic Ability SDK动态特性安装失败:无静默安装权限(错误码8)

华为Dynamic Ability SDK动态模块安装报错:No install permission

我已通过Google SDK实现Google Play动态特性,目前在不同构建变体中使用华为Dynamic Ability SDK进行类似开发,该SDK与Google SDK几乎一致。

调用以下代码请求安装模块:

fun startInstall(moduleName: String): Task<Int> {
    val request = FeatureInstallRequest.newBuilder()
        .addModule(moduleName)
        .build()

    return manager.installFeature(request)
}

manager
        .startInstall(sdkInfo.moduleName)
        .addOnSuccessListener { sessionId ->
                ...
        }
        .addOnFailureListener { exception ->
                listener?.onError(sdkInfo, exception, null) // 触发此回调
        }

但收到错误:

com.huawei.hms.feature.model.FeatureInstallException: No install permission..

日志信息如下:

12:12:05.729 13092-13092 DF_b                     I  Ready to installFeature from the market.
12:12:05.729 13092-13092 DF_LocalApk-d            I  fire
12:12:05.730 13092-13092 WindowOnBackDispatcher   W  sendCancelIfRunning: isInProgress=false callback=android.app.Dialog$$ExternalSyntheticLambda2@fd4d6e6
12:12:05.730 13092-13257 DF_LocalApk-d            I  Begin binding to the service.
12:12:05.731 13092-13131 HWUI                     D  endAllActiveAnimators on 0xb4000072a1fb5820 (RippleDrawable) with handle 0xb400007421eb44e0
12:12:05.749 13092-13257 DF_LocalApk-d            I  Binding to the service  success
12:12:05.753 13092-13092 DF_LocalApk-d            I  onServiceConnected
12:12:05.753 13092-13092 DF_LocalApk-d            I  onServiceConnected successed , check permission successed
12:12:05.753 13092-13257 DF_LocalApk-d            I  begin linking to death...
12:12:05.753 13092-13257 DF_LocalApk-b            I  start add new feature [esp32_sdk]
12:12:05.753 13092-13257 DF_LocalApk-b            I  installFeature....[esp32_sdk]
12:12:05.757 13092-13105 DF_LocalApk-b            E  Get error from hw marke , marketErrorCode is 8, errorMsg is No silent install permission.
12:12:05.757 13092-13257 DF_LocalApk-d            I  forget
12:12:05.757 13092-13092 OnboardingViewModel      E  SDK error: esp32_sdk, com.huawei.hms.feature.model.FeatureInstallException: No install permission., null

已做尝试:

  • 查阅官方文档和示例源码,未找到问题根源
  • 在AndroidManifest.xml中添加权限:
<uses-permission android:name="android.permission.REQUEST_INSTALL_PACKAGES" />
  • 测试环境为安装了HMS服务的模拟器
  • 补充:FeatureInstallErrorCode枚举中无该错误码

请问如何解决该问题?


内容的提问来源于stack exchange,提问作者4ntoine

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.06.01 22:04:52