debug程序时提示:Cannot debug the project when its build mode is release. Change Build Mode to debug and try again. (HarmonyOS 鸿蒙Next)

debug程序时提示:Cannot debug the project when its build mode is release. Change Build Mode to debug and try again. (HarmonyOS 鸿蒙Next) debug程序时提示:Cannot debug the project when its build mode is release. Change Build Mode to debug and try again, run程序则没问题。按照提示更改运行配置为debug模式也不行,照样错误提示。
DevEco Studio版本: 5.0.3.910
Harmony版本:HarmonyOS 5.0.0 Release SDK,基于OpenHarmony SDK Ohos_sdk_public 5.0.0.71 (API Version 12 Release)


更多关于debug程序时提示:Cannot debug the project when its build mode is release. Change Build Mode to debug and try again. (HarmonyOS 鸿蒙Next)的实战教程也可以访问 https://www.itying.com/category-93-b0.html

9 回复

证书文件用的是发布证书吗,发布证书打的包只能用于应用市场分发。

更多关于debug程序时提示:Cannot debug the project when its build mode is release. Change Build Mode to debug and try again. (HarmonyOS 鸿蒙Next)的实战系列教程也可以访问 https://www.itying.com/category-93-b0.html


要增加debuggable选项才可

cke_1648.png

升级了DevEco并重新签名了应用就可以Debug了

是改这里吧?clearn->修改->运行,还是不行

仍然不行

build Mode换为debug

改了,还是不行哦,

先clean掉,再改,再运行试试,

在HarmonyOS鸿蒙Next开发环境中,当你尝试调试程序时,提示“Cannot debug the project when its build mode is release. Change Build Mode to debug and try again。”,这意味着当前项目的构建模式为Release模式,而调试功能仅在Debug模式下可用。

要解决此问题,你需要将项目的构建模式从Release更改为Debug。具体操作如下:

  1. 打开DevEco Studio。
  2. 在项目视图中,选择并打开需要调试的项目。
  3. 在菜单栏中,点击“Build”选项。
  4. 在下拉菜单中选择“Select Build Variant”。
  5. 在弹出的窗口中,将当前的构建模式从“release”更改为“debug”。
  6. 确认更改后,重新构建项目。
  7. 再次尝试调试程序。

完成上述步骤后,你应该能够在Debug模式下正常调试项目。

回到顶部