uni-app打包出 ios app经常崩溃帮忙看下,崩溃日志已贴出

uni-app打包出 ios app经常崩溃帮忙看下,崩溃日志已贴出

操作步骤

  • 偶发不能100%复现,是通过Umeng抓的崩溃日志

预期结果

  • 不崩溃

实际结果

  • 崩溃

bug描述:

Exception Category: nsexception  
Exception Type:  EXC_CRASH (SIGABRT)  
Exception Codes: 0x00000000 at 0x0000000000000000  
Crashed Thread:  0  

CrashDoctor Diagnosis: Application threw exception NSInternalInconsistencyException: ERROR: -[_UIFeedbackHapticOnlyEngine _deactivate] called more times than the feedback engine was activated  

Thread 0 Crashed:  
0   CoreFoundation                      0x0000000188ab3ea0 0x188998000 + 1162912  
1   libobjc.A.dylib                     0x0000000187c85a40 0x187c7f000 + 27200  
2   CoreFoundation                      0x00000001889c9c1c 0x188998000 + 203804  
3   Foundation                          0x00000001894b7140 0x18942b000 + 573760  
4   UIKitCore                           0x00000001b5826ae8 0x1b53cd000 + 4561640  
5   UIKitCore                           0x00000001b580ea38 0x1b53cd000 + 4463160  
6   libdispatch.dylib                   0x00000001884ed6c8 0x18848d000 + 394952  
7   libdispatch.dylib                   0x00000001884ee484 0x18848d000 + 398468  
8   libdispatch.dylib                   0x00000001884cdb44 0x18848d000 + 265028  
9   CoreFoundation                      0x0000000188a43dd0 0x188998000 + 703952  
10  CoreFoundation                      0x0000000188a3ec98 0x188998000 + 683160  
11  CoreFoundation                      0x0000000188a3e1cc 0x188998000 + 680396  
12  GraphicsServices                    0x000000018acb5584 0x18acaa000 + 46468  
13  UIKitCore                           0x00000001b5cb5054 0x1b53cd000 + 9338964  
14  HBuilder                            0x00000001045b1fc0 0x1045ac000 + 24512  
15  libdyld.dylib                       0x00000001884febb4 0x1884fe000 + 2996  
...


更多关于uni-app打包出 ios app经常崩溃帮忙看下,崩溃日志已贴出的实战教程也可以访问 https://www.itying.com/category-93-b0.html

3 回复

谁能给看下呀

更多关于uni-app打包出 ios app经常崩溃帮忙看下,崩溃日志已贴出的实战教程也可以访问 https://www.itying.com/category-93-b0.html


你好,有ios企业证书吗,可能用到解决问题

从崩溃日志来看,这是一个iOS原生层面的崩溃问题,具体是_UIFeedbackHapticOnlyEngine触发的NSInternalInconsistencyException异常。这个错误通常发生在触觉反馈引擎被错误调用时。

主要问题点:

  1. 错误类型:[_UIFeedbackHapticOnlyEngine _deactivate] called more times than the feedback engine was activated
  2. 这表明触觉反馈引擎的deactivate方法被调用了超过activate的次数

可能原因:

  1. 在uni-app中使用了振动API(如uni.vibrateLong/vibrateShort)
  2. 快速连续调用振动API导致状态不一致
  3. iOS系统触觉反馈引擎的调用时序问题

建议解决方案:

  1. 检查代码中所有调用振动API的地方
  2. 确保振动API不会被快速连续调用
  3. 可以考虑在调用振动API时添加防抖处理

示例修复代码:

let isVibrating = false;
function safeVibrate() {
  if(!isVibrating) {
    isVibrating = true;
    uni.vibrateShort({
      success: () => isVibrating = false,
      fail: () => isVibrating = false
    });
  }
}
回到顶部