Browse Source

build(Basic & SDK): 将构建模式从 debug 更改为 release- 在 BuildProfile.ets 文件中将 BUILD_MODE_NAME 从 'debug' 改为 'release'
- 将 DEBUG 变量从 true 改为 false
- 更新 CHANGELOG.md,添加解决窗口状态异常问题的说明
- 修改 README.md 中的 AppAbility 示例代码,优化日志输出和窗口初始化逻辑

徐勤民 1 week ago
parent
commit
caa51066e2
3 changed files with 8 additions and 5 deletions
  1. 2 2
      BuildProfile.ets
  2. 1 0
      CHANGELOG.md
  3. 5 3
      README.md

+ 2 - 2
BuildProfile.ets

@@ -2,8 +2,8 @@
  * Use these variables when you tailor your ArkTS code. They must be of the const type.
  */
 export const HAR_VERSION = '1.0.10';
-export const BUILD_MODE_NAME = 'debug';
-export const DEBUG = true;
+export const BUILD_MODE_NAME = 'release';
+export const DEBUG = false;
 export const TARGET_NAME = 'default';
 
 /**

+ 1 - 0
CHANGELOG.md

@@ -3,6 +3,7 @@
 > - `ToolsHelper.showConfirmDialog()`&`ToolsHelper.showAlertDialog()`添加自定义`UI`功能
 > - 添加一个`ImageHelper`,处理图片相关
 > - 添加一个`SwipeView`,左滑删除的item组件
+> - 修改初始化逻辑,解决`This window state is abnormal`的问题
 >
 
 # [v1.0.9] 2025.04.06

+ 5 - 3
README.md

@@ -14,14 +14,16 @@ import { GlobalContext } from '@szyx/sdk_base';
 export default class AppAbility extends UIAbility {
   onWindowStageCreate(windowStage: window.WindowStage): void {
 
+    GlobalContext.setContext(this.context)
+
     windowStage.loadContent('pages/Index', (err) => {
       if (err.code) {
-        hilog.error(0x0000, 'testTag', 'Failed to load the content. Cause: %{public}s', JSON.stringify(err) ?? '');
+        LogHelper.error(`Failed to load the content. Cause: ${JSON.stringify(err) ?? ''}`);
         return;
       }
+      hilog.info(0x0000, 'testTag', 'Succeeded in loading the content.');
+      WindowHelper.windowClass = windowStage.getMainWindowSync()
     });
-    // 这行代码
-    GlobalContext.setContext(this.context)
   }
 }
 ```