criticalmaps / criticalmaps-ios

Critical Maps iOS App ๐ŸšฒโœŠ
http://www.criticalmaps.net
MIT License
287 stars 41 forks source link

Crash on iOS 14.2.1 #373

Closed tobi3988 closed 3 years ago

tobi3988 commented 3 years ago

At the moment my Critical Maps is crashing on startup. I have an iPhone 12 Pro with iOS 14.2.1. Deleting the App and reinstall didn't help

github-actions[bot] commented 3 years ago

Thank you for submitting this issue! ๐Ÿ™‚

LeanDerVorausdenkende commented 3 years ago

I have the same problem. I'm on iPhone SE (old one) and IOS 14.0.1. After installing Critical Maps v3.9.1, the app crashed every time I started it.

So it seems the issue is not limited to IOS 14.2.1 but rather a bug in the current app version.

tobi3988 commented 3 years ago

It doesnโ€™t crash if I open it in airplay mode. It crashes after the first request is succesful.

fbernutz commented 3 years ago

Oh no! We'll look into this. @mltbnz also experienced a crash, but it couldn't be reproduced a few days later (#365). Thanks for reporting this issue!

mltbnz commented 3 years ago

It doesnโ€™t crash if I open it in airplay mode. It crashes after the first request is succesful.

Do you maybe know which request it is? My guess is that the event feature and the criticalmass.in API might have changed and is not versioned. I will investigate that

the response is also different for different user locations

mltbnz commented 3 years ago

Might be fixed by #392

zeitschlag commented 3 years ago

First of all: thank you for CriticalMaps, you amazing people!

I just stumbled upon another crash, at least on my iPhone SE (2020) running iOS 14.4.2. Reinstalling from the App Store didn't help, so I decided to start Xcode and use the debugger to find out more. I'm not really conviced, that #392 fixes this crash, as Xcode tells me that the app crashes in the generated Strings.swift file, in the L10n-extension to be more specific:

extension L10n {
  private static func tr(_ table: String, _ key: String, _ args: CVarArg...) -> String {
    let format = BundleToken.bundle.localizedString(forKey: key, value: nil, table: table)
    return String(format: format, locale: Locale.current, arguments: args) // Crash ๐Ÿ’ฅ
  }
}

It crashes due to a EXC_BAD_ACCESS (code=1...) and the values of the variables are:

(lldb) po key
"chat.unreadbutton.accessibilityvalue"

(lldb) po format
"%s ungelesene Nachrichten"

(lldb) po Locale.current
โ–ฟ de_DE (current)
  - identifier : "de_DE"
  - kind : "current"

(lldb) po args
โ–ฟ 1 element
  - 0 : "4"

Do you have an idea why it crashes? I might have a deeper look at this later this evening, but as it crashes in the generated code, I'm neither sure that I'll find the cause for this nor that this is the right issue/repo to complain about it ๐Ÿ™‚

I'll keep you posted. If you need anything in the meantime, just say something.

mltbnz commented 3 years ago

Thanks for the hint. I just fired up Xcode to see myself but nothing. Until I set German as the apps language and then it crashed. I found the issue in the german Localizable.strings. PR #394 contains the fix. If you could confirm that it does not crash on your machine? Worked over here

mltbnz commented 3 years ago

Temporarily you could set the apps language to anything but German. Thanks again for your post. Really helped

zeitschlag commented 3 years ago

That %s was waaaaay to obvious ๐Ÿ™ˆ But yes, it works now! Thank you for your help, I'm looking forward to the next release ๐Ÿ™‚

mltbnz commented 3 years ago

it was and it wasn't ๐Ÿ˜† I never used the app in german recently and so I was looking for the error somewhere else. I also added some snapshot tests.