在世博会托管项目中关闭模式时 IOS 崩溃

问题描述 投票:0回答:2

iOS 上的 Expo 管理项目

当我的应用程序启动时,会出现一个模式,其中有一个按钮可以在没有任何帐户的情况下访问该应用程序。单击此按钮时会发生崩溃。正确的行为是关闭模式。

当我在开发版本和测试飞行中进行测试时,它工作正常,但在审查时它崩溃了。我无法在 iPad 或 iPhone 上重现该问题。这是我收到的崩溃报告之一:

"exception" : {"codes":"0x0000000000000000, 0x0000000000000000","rawCodes":[0,0],"type":"EXC_CRASH","signal":"SIGABRT"},
  "ktriageinfo" : "VM - Fault hit memory shortage\nVM - Fault hit memory shortage\nVM - Fault hit memory shortage\nVM - Fault hit memory shortage\nVM - Fault hit memory shortage\n",
  "asi" : {"libsystem_c.dylib":["abort() called"]},
  "lastExceptionBacktrace" : [{"imageOffset":601372,"symbol":"__exceptionPreprocess","symbolLocation":216,"imageIndex":5},{"imageOffset":85732,"symbol":"objc_exception_throw","symbolLocation":56,"imageIndex":4},{"imageOffset":941832,"symbol":"__CFDictionaryCreateGeneric","symbolLocation":0,"imageIndex":5},{"imageOffset":4919592,"symbol":"-[UIView(Hierarchy) _associatedViewControllerForwardsAppearanceCallbacks:performHierarchyCheck:isRoot:]","symbolLocation":284,"imageIndex":7},{"imageOffset":4109060,"symbol":"-[UIView(Hierarchy) _willMoveToWindow:withAncestorView:]","symbolLocation":244,"imageIndex":7},{"imageOffset":1545712,"symbol":"-[UIView(Internal) _addSubview:positioned:relativeTo:]","symbolLocation":432,"imageIndex":7},{"imageOffset":2486960,"symbol":"-[UITransitionView transition:fromView:toView:removeFromView:]","symbolLocation":1336,"imageIndex":7},{"imageOffset":2880572,"symbol":"-[UIViewControllerBuiltinTransitionViewAnimator animateTransition:]","symbolLocation":1496,"imageIndex":7},{"imageOffset":4759516,"symbol":"___UIViewControllerTransitioningRunCustomTransition_block_invoke_2","symbolLocation":72,"imageIndex":7},{"imageOffset":2917644,"symbol":"+[UIKeyboardSceneDelegate _pinInputViewsForKeyboardSceneDelegate:onBehalfOfResponder:duringBlock:]","symbolLocation":104,"imageIndex":7},{"imageOffset":3387600,"symbol":"___UIViewControllerTransitioningRunCustomTransition_block_invoke.641","symbolLocation":176,"imageIndex":7},{"imageOffset":3939216,"symbol":"+[UIView(Animation) _setAlongsideAnimations:toRunByEndOfBlock:]","symbolLocation":172,"imageIndex":7},{"imageOffset":2511492,"symbol":"_UIViewControllerTransitioningRunCustomTransition","symbolLocation":572,"imageIndex":7},{"imageOffset":8979416,"symbol":"__56-[UIPresentationController runTransitionForCurrentState]_block_invoke.401","symbolLocation":2152,"imageIndex":7},{"imageOffset":3195456,"symbol":"-[_UIAfterCACommitBlock run]","symbolLocation":64,"imageIndex":7},{"imageOffset":2258800,"symbol":"-[_UIAfterCACommitQueue flush]","symbolLocation":200,"imageIndex":7},{"imageOffset":1400496,"symbol":"_runAfterCACommitDeferredBlocks","symbolLocation":640,"imageIndex":7},{"imageOffset":1402236,"symbol":"_cleanUpAfterCAFlushAndRunDeferredBlocks","symbolLocation":128,"imageIndex":7},{"imageOffset":1402696,"symbol":"_afterCACommitHandler","symbolLocation":56,"imageIndex":7},{"imageOffset":256060,"symbol":"__CFRUNLOOP_IS_CALLING_OUT_TO_AN_OBSERVER_CALLBACK_FUNCTION__","symbolLocation":32,"imageIndex":5},{"imageOffset":64116,"symbol":"__CFRunLoopDoObservers","symbolLocation":616,"imageIndex":5},{"imageOffset":45052,"symbol":"__CFRunLoopRun","symbolLocation":1012,"imageIndex":5},{"imageOffset":123472,"symbol":"CFRunLoopRunSpecific","symbolLocation":572,"imageIndex":5},{"imageOffset":6536,"symbol":"GSEventRunModal","symbolLocation":160,"imageIndex":6},{"imageOffset":5134996,"symbol":"-[UIApplication _run]","symbolLocation":1080,"imageIndex":7},{"imageOffset":2617300,"symbol":"UIApplicationMain","symbolLocation":336,"imageIndex":7},{"imageOffset":21672,"imageIndex":8},{"imageOffset":99536,"symbol":"start","symbolLocation":444,"imageIndex":9}],

我很难理解这份报告。我知道这是语言异常,但找不到更多内容。 https://developer.apple.com/documentation/xcode/addressing-language-exception-crashes

<Modal
        animationType="fade"
        transparent={false}
        visible={!this.props.estConnecte}>
        <View style={styles.accueilView}>
          <ImageBackground resizeMode="cover" style={{flex:1, justifyContent: 'flex-end', padding:50}} source={require('../assets/splash.png')}>

          <Button1 onPress={() => this.displayLogin()} title = {"Se connecter"} styleSup = {{color: COLORS.iconesView}}/>
          <Button1 onPress={() => this.creerCompte()} title = {"Créer un compte"} styleSup = {{color: COLORS.iconesView}}/>
          <Button1 onPress={() => this.accesSansCompte()} title = {"Accès sans compte"} styleSup = {{color: COLORS.iconesView}}/>
          <View style={{flex:0.1}}/>
          </ImageBackground>
        </View>
        <Login/>
        <Signin/>
      </Modal>

函数 this.accesSansCompte() 仅更改 this.props.estConnecte 的状态。

我尝试在关闭模式之前添加超时,但没有成功。任何想法都将不胜感激!感谢您的宝贵时间!

javascript ios react-native expo
2个回答
0
投票

所以问题来自模态组件本身,如下所示:

https://github.com/software-mansion/react-native-screens/issues/944#issuecomment-971559549

我安装了包react-native-modal,而不是使用标准Modal:

https://github.com/react-native-modal/react-native-modal

我仅在应用程序开始时显示的第一个登录模式中使用它,并且效果很好!

无需使用超时或其他任何东西。


0
投票

就我而言,当我遇到这个问题时,我将

transparent
属性设置为 false。更改
transparent={true}
后,应用程序停止崩溃。不知道为什么,但这似乎是我在尝试修复几个小时后看到的唯一解决方法。

© www.soinside.com 2019 - 2024. All rights reserved.