App Crashes Only On Testflight Build

前端 未结 11 2123
北海茫月
北海茫月 2020-12-13 03:56

I have created an app on swift and tested it extensively using iPhone 6, iPhone 6 plus and iPhone 5 devices and all the simulators offered in Xcode. The app runs fine and do

相关标签:
11条回答
  • 2020-12-13 04:18

    In my case this happened after starting to use Xcode 11. It was a UISearchDisplayController (deprecated since iOS 8) that seems to work on a device or simulator in debug mode, but not in the release build. Xcode 11.3 doesn't give any inline warning in the code. The crash was hard to find, because the search controller wasn't used any more, it was orphaned code.

    0 讨论(0)
  • Instead of i += 1; in the empty while loops.

    I did this in my empty while Loop: RunLoop.current.run(until: Date(timeIntervalSinceNow: 1))

    And now the TestFlight App does not bomb!

    A shorter time might also work such as: RunLoop.current.run(until: Date(timeIntervalSinceNow: 0.25))

    0 讨论(0)
  • 2020-12-13 04:23

    If anyone else is having the same problem, here's what my fix was:

    I finally got the problem down to a loop with a if statement, akin to this -

    while(condition)
    {
        if (check)
        {
            code!
        }
        //There was no code here
    }
    

    Notice that there's no code at the end of the loop (where the comment is). Once I added a random bit of code (in this case, incrementing a variable for output), the problem stopped.

    while(condition)
    {
        if (check)
        {
            code!
        }
        i += 1;
        output statement
    }
    

    I think this has to be a compiler error, or else my "fix" shouldn't be a fix at all. But here it is in case it helps anyone else!

    0 讨论(0)
  • 2020-12-13 04:27

    It might be the Bitcode related issue. Check if your all third-party libraries support bitcode then and then only set bitcode to YES else set to NO.

    Actually Bitcode is an intermediate representation of a compiled program. Apps you upload to iTunes Connect that contain bitcode will be compiled and linked on the App Store.

    0 讨论(0)
  • 2020-12-13 04:30

    For anyone still having this issue, you can run this command to run it in release mode, the same when you archive a build. That way you can debug the issue easier:

    react-native run-ios --configuration Release 
    
    0 讨论(0)
提交回复
热议问题