HarmonyOS 添加短信权限后安装失败 code:9568289

原本应用可以正常运行,添加短信权限申请后,应用编译或调试时,安装时提示错误。点击链接查看为ACL权限错误。

05/09 17:20:44: Install Failed: error: failed to install bundle.

code:9568289

error: install failed due to grant request permissions failed.

View detailed instructions.

HarmonyOS
2024-08-22 23:02:38
浏览
收藏 0
回答 1
回答 1
按赞同
/
按时间
superinsect

当前仅支持部分权限通过应用市场(AGC)使用ACL的方式跨级别申请权限:

https://developer.huawei.com/consumer/cn/doc/harmonyos-guides-V5/permissions-in-acl-0000001763952222-V5

通过接口发送短信仅限系统应用使用,三方应用需拉起短信应用发送;

拉起短信应用并自动填充接收号码和短信内容

Button(“跳转到短信”).onClick((event: ClickEvent) => { 
  let context = getContext(this) as common.UIAbilityContext; 
  class info{ 
    contactName:string 
    telephone: string 
    // content:String 
    constructor() { 
      this.contactName = ‘ZhangSan’ 
      this.telephone = ‘123’ 
    } 
 
  } 
  // class want 
  let contactInfo:Array<Object> = new Array() 
  contactInfo[0] = new info(); 
  let want:Want = { 
    bundleName: ‘com.ohos.xxx’, 
    abilityName: ‘com.ohos.xxx.MainAbility’, 
    parameters: { 
      contactObjects: JSON.stringify(contactInfo), 
      content:“内容”, 
      pageFlag: ‘conversation’ 
    } 
  }; 
  context.startAbility(want) 
    .then(() => { 
      //… 
    }) 
    .catch((err:BusinessError) => { 
      console.error(Failed to startAbility. Code: ${err.code}, message: ${err.message}); 
    }); 
}).margin(10)
  • 1.
  • 2.
  • 3.
  • 4.
  • 5.
  • 6.
  • 7.
  • 8.
  • 9.
  • 10.
  • 11.
  • 12.
  • 13.
  • 14.
  • 15.
  • 16.
  • 17.
  • 18.
  • 19.
  • 20.
  • 21.
  • 22.
  • 23.
  • 24.
  • 25.
  • 26.
  • 27.
  • 28.
  • 29.
  • 30.
  • 31.
  • 32.
分享
微博
QQ
微信
回复
2024-08-23 19:27:56
相关问题
HarmonyOS 添加权限运行安装失败
1667浏览 • 1回复 待解决
HarmonyOS 安装APP报错code:9568289
2180浏览 • 1回复 待解决
配置好权限,APP安装失败
3083浏览 • 1回复 待解决
置好权限,APP安装失败
1078浏览 • 1回复 待解决
HarmonyOS flutter Plugin权限申请报错9568289
1151浏览 • 1回复 待解决
HarmonyOS APP无法链接数据线安装9568289
1133浏览 • 1回复 待解决
HarmonyOS 安装报错code: 9568332
1437浏览 • 1回复 待解决
HarmonyOS socket连接失败code: 103
798浏览 • 1回复 待解决
HarmonyOS hap安装报错 code:9568305
1072浏览 • 1回复 待解决
HarmonyOS 权限添加出错
721浏览 • 1回复 待解决