我正在编写一个跨平台应用程序(Win / IOS / Web),并在IOS应用程序中面临一些奇怪的冻结(IOS版本15.3.1 -也发生在较低版本上)。当我关闭应用程序时,问题就出现了,让它躺上大约5秒,然后重新打开它。然而,这些冻结只是偶尔出现,应用程序管理了一段时间后,在10秒到2分之间,以恢复。在应用程序恢复后,它继续运行,好像什么都没发生一样。
如果我用Xcode调试应用程序并触摸冻结的应用程序用户界面,我将得到以下控制台输出:App[449:19368][IPC] Connection::waitForSyncReply: Timed-out while waiting for reply for WebPage_touchEventSync from process 451, id=39
不幸的是,这个错误对我在调试过程中并没有很大的帮助。因此,我开始取消对应用程序的以下部分的注释,以确定问题部分(没有成功)
DeviceOrientation.watchHeading().subscribe(...)Geolocation.watchPosition(...) 有谁知道有什么问题吗?
我目前使用以下package.json (但其中有些未在IOS构建中使用):
"dependencies": {
"@babel/core": "^7.13.14",
"@capacitor-community/electron": "^3.0.0-rc.6",
"@capacitor-community/http": "^1.0.0",
"@capacitor/app": "^1.0.5",
"@capacitor/browser": "^1.0.5",
"@capacitor/core": "^3.2.5",
"@capacitor/device": "^1.0.5",
"@capacitor/filesystem": "^1.0.5",
"@capacitor/geolocation": "^1.1.2",
"@capacitor/ios": "^3.2.5",
"@capacitor/network": "^1.0.5",
"@capacitor/push-notifications": "^1.0.6",
"@capacitor/share": "^1.0.6",
"@capacitor/splash-screen": "^1.1.5",
"@craco/craco": "^6.0.0",
"@ionic-native/device-orientation": "^5.36.0",
"@ionic-native/file-opener": "^5.34.0",
"@ionic-native/screen-orientation": "^5.36.0",
"@ionic/pwa-elements": "^3.0.2",
"@material-ui/core": "^4.11.0",
"@material-ui/icons": "^4.9.1",
"@material-ui/lab": "^4.0.0-alpha.60",
"@microsoft/signalr": "^3.1.6",
"@reduxjs/toolkit": "^1.4.0",
"axios": "^0.21.1",
"axios-retry": "^3.2.0",
"canvas": "^2.6.1",
"capacitor-secure-storage-plugin": "^0.6.2",
"cordova-plugin-device-orientation": "^2.0.1",
"cordova-plugin-file-opener2": "^3.0.5",
"cordova-plugin-screen-orientation": "^3.0.2",
"fibers": "^5.0.0",
"i18next": "^19.6.2",
"i18next-http-backend": "^1.0.21",
"ionic-appauth": "^0.7.4",
"node-sass": "^5.0.0",
"notistack": "^1.0.5",
"ol": "^6.3.1",
"proj4": "^2.6.3",
"react": "^17.0.1",
"react-dnd": "^14.0.2",
"react-dnd-html5-backend": "^14.0.0",
"react-dnd-touch-backend": "^14.0.0",
"react-dom": "^17.0.1",
"react-file-viewer": "^1.2.1",
"react-i18next": "^11.7.0",
"react-redux": "^7.2.0",
"react-router": "^5.2.0",
"react-router-dom": "^5.2.0",
"react-scripts": "4.0.3",
"react-webcam": "^6.0.0",
"redux": "^4.0.5",
"sass": "^1.32.8",
"type-fest": "^0.13.1",
"uuid": "^8.3.1"
}
}发布于 2022-04-05 07:11:39
我的应用程序也有类似的问题(HU提醒).我能够通过删除‘@离子型-本机/后台模式’(不使用)和查询后台模式(在我的例子中,到DB的连接)仍然存在.(app.component.ts)
import { Platform } from '@ionic/angular';
constructor(
private platform: Platform,
...
) {
this.setPlatformListener();
}
async setPlatformListener() {
// background mode
this.platform.pause.subscribe(() => {
console.log(' #### app is in background');
});
// foreground mode
this.platform.resume.subscribe(async () => {
console.log(' #### app is in Foreground: ' );
if( 'check your code....' ) {
console.log(' #### app is crashed -----!');
}
await SplashScreen.show({
showDuration: 1000,
autoHide: true,
});
... to do your code ...
}
else {
console.log(' #### all is ready ...');
}
});
}希望我能帮上忙
https://stackoverflow.com/questions/71470478
复制相似问题