exponea / exponea-ios-sdk

MIT License
19 stars 27 forks source link

Self check not working #46

Closed saiefelgebali closed 11 months ago

saiefelgebali commented 1 year ago

Self check does not work, because we check if we are running a debug version of the app.

The code to check that we are running a debug version uses an outdated technique that doesn't seem to work.

From BuildConfiguration.swift:

// based on https://forums.swift.org/t/support-debug-only-code/11037

func inDebugBuild(_ code: () -> Void) {
    assert({
        code()
        return true
        }()
    )
}

Since the SDK is a dependency of our application, the assert will never run. Therefore this function wouldn't work as expected.

adam1929 commented 1 year ago

Hi @saiefelgebali thank you for report. I assume that this is not working on XCode 14.3 right? Yes, this code is obsolete due to historical reasons - we'll update a solution

Ankmara commented 11 months ago

Hi, what is your optimization level for debug in build settings please?

adam1929 commented 11 months ago

@saiefelgebali Hi, could you check your setup of optimization level according to comment form @Ankmara ? thank you

saiefelgebali commented 10 months ago

Hello,

The Swift Compiler optimization level is set to No Optimization [-Onone].

Does that make a difference to why this bug is happening?