ferranabello/Viperit

AppModule.build() crashes app

Closed this issue · 4 comments

I've set optimization level "optimize for speed".

        let module = module.build()        
        module.router.show(from: viewController, embedInNavController: true, setupData: id)

embedInNavController: true seems to be crucial here.

I am calling router.show() with already existing navigation controller to archive card like presentation style with different navigation context.

In that situation app crashes because of nil _preseter. With optimization for speed turned off everything seems to be fine.

Any ideas how to handle? Currently I've turned off optimization.

Hi @pgawlowski thanks for the feedback.

It would be nice to have more context. Could you create a sample project that reproduces this issue? It would be easier to test and fix, or give you more insights on this.

Cheers.

@ferranabello

Sample project won't work beacuase you have to test this in release mode.
You can try by yourself on any kind of project in release mode.

Currently Xcode 12.1. Use any project with Viperit.

Select:

  • scheme
  • edit scheme
  • run
  • build configuration -> Release

Check:

  • Target build settings
  • Swift Compiler Code generation
  • Optimization Level
  • release - any kind of optimization

With this settings I was able to crash every my every application that is using Viperit.
Setting optimization level to none is fixing issue.

Probably some xcode related issue. After update everything started to work normally.

Probably some xcode related issue. After update everything started to work normally.

Glad to hear that 👍