Hi, I had an interesting experience where my compo...
# multiplatform
s
Hi, I had an interesting experience where my compose multiplatform ios app is crashing on startup only for the
apple app store
build but not for the
Testflight
. Hence, I cannot see the Firebase Crashlytics logs, as probably the SDK is not initialised. The interesting thing is that the app was working fine with the TestFlight build and on the local build, but after downloading the app from the Apple App Store after its live which was today, it crashes on startup that answered why the user base has significantly decreased. Is this an issue on Apple’s side within their processing pipeline, where the binary might have become corrupted, or could it be something on my end? Given that Firebase doesn’t report this problem it’s rather frustrating. Amidst this chaos, I submitted an app update, hoping that the issue will be resolved magically. Does anyone have any idea about this? Any thoughts or suggestions to troubleshoot would be greatly appreciated.
I think what causes the crash are these log lines
Copy code
Exception Type:  EXC_CRASH (SIGABRT)
Exception Codes: 0x0000000000000000, 0x0000000000000000
Termination Reason: SIGNAL 6 Abort trap: 6
Terminating Process: foo bar app [6826]

Triggered by Thread:  0

Last Exception Backtrace:
0   foo bar app                    	0x104ee1f00 kfun:kotlin.io.encoding.Base64.decodeImpl#internal + 340 (Base64.kt:524)
1   foo bar app                    	0x104ee1f00 kfun:kotlin.io.encoding.Base64#decode(kotlin.ByteArray;kotlin.Int;kotlin.Int){}kotlin.ByteArray + 340 (Base64.kt:285)
2   foo bar app                    	0x104ee1f00 kfun:kotlin.io.encoding.Base64#decode$default(kotlin.ByteArray;kotlin.Int;kotlin.Int;kotlin.Int){}kotlin.ByteArray + 340 (Base64.kt:279)
3   foo bar app                    	0x104ee1f00 kfun:kotlin.io.encoding.Base64#decode(kotlin.CharSequence;kotlin.Int;kotlin.Int){}kotlin.ByteArray + 1088 (Base64.kt:351)
4   foo bar app                    	0x104ee1f00 kfun:kotlin.io.encoding.Base64#decode$default(kotlin.CharSequence;kotlin.Int;kotlin.Int;kotlin.Int){}kotlin.ByteArray + 4236 (Base64.kt:349)
5   foo bar app                    	0x1058c8294 kfun:org.jetbrains.compose.resources.decodeAsString#internal + 224 (StringResourcesUtils.kt:47)
6   foo bar app                    	0x1058c8294 kfun:org.jetbrains.compose.resources.$getStringItem$lambda$0COROUTINE$0.invokeSuspend#internal + 4956 (StringResourcesUtils.kt:41)
7   foo bar app                    	0x1058c86bc kfun:org.jetbrains.compose.resources.getStringItem$lambda$0#internal + 216 (StringResourcesUtils.kt:29)
8   foo bar app                    	0x1058c86bc kfun:org.jetbrains.compose.resources.$getStringItem$lambda$0$FUNCTION_REFERENCE$0.invoke#internal + 276 (StringResourcesUtils.kt:27)
9   foo bar app                    	0x1058ac048 kfun:kotlin.coroutines.SuspendFunction0#invoke#suspend(kotlin.coroutines.Continuation<1:0>){}kotlin.Any?-trampoline + 288 ([K][Suspend]Functions:1)
10  foo bar app                    	0x1058ac048 kfun:org.jetbrains.compose.resources.AsyncCache.getOrLoad$lambda$1$lambda$0#internal + 288 (AsyncCache.kt:19)
11  foo bar app                    	0x1058ac048 kfun:org.jetbrains.compose.resources.AsyncCache.$getOrLoad$lambda$1$lambda$0$FUNCTION_REFERENCE$1.invoke#internal + 332 (AsyncCache.kt:19)
12  foo bar app                    	0x104e199bc kfun:kotlin.Function2#invoke(1:0;1:1){}1:2-trampoline + 84 ([K][Suspend]Functions:1)
13  foo bar app                    	0x104e199bc kfun:kotlin.coroutines.intrinsics#startCoroutineUninterceptedOrReturn__at__kotlin.coroutines.SuspendFunction1<0:0,0:1>(0:0;kotlin.coroutines.Continuation<0:1>){0§<kotlin.Any?>;1§<kotlin.Any?>}kotli... + 628 (IntrinsicsNative.kt:72)
14  foo bar app                    	0x104e199bc <inlined-out:<anonymous>> + 632 (IntrinsicsNative.kt:186)
15  foo bar app                    	0x104e199bc kfun:kotlin.coroutines.intrinsics.object-2.invokeSuspend#internal + 792 (IntrinsicsNative.kt:254)
16  foo bar app                    	0x104e170cc kfun:kotlin.coroutines.native.internal.BaseContinuationImpl#invokeSuspend(kotlin.Result<kotlin.Any?>){}kotlin.Any?-trampoline + 28 (ContinuationImpl.kt:50)
17  foo bar app                    	0x104e170cc <inlined-out:<anonymous>> + 44 (ContinuationImpl.kt:30)
18  foo bar app                    	0x104e170cc kfun:kotlin#with(0:0;kotlin.Function1<0:0,0:1>){0§<kotlin.Any?>;1§<kotlin.Any?>}0:1 + 44 (Standard.kt:70)
19  foo bar app                    	0x104e170cc kfun:kotlin.coroutines.native.internal.BaseContinuationImpl#resumeWith(kotlin.Result<kotlin.Any?>){} + 188 (ContinuationImpl.kt:26)
20  foo bar app                    	0x104f61b8c kfun:kotlin.coroutines.Continuation#resumeWith(kotlin.Result<1:0>){}-trampoline + 24 (Continuation.kt:26)
21  foo bar app                    	0x104f61b8c kfun:kotlin.coroutines#resume__at__kotlin.coroutines.Continuation<0:0>(0:0){0§<kotlin.Any?>} + 24 (Continuation.kt:45)
22  foo bar app                    	0x104f61b8c <inlined-out:<anonymous>> + 1768 (DispatchedTask.kt:101)
On Looking at the logs closely, its causing the crash due to the line #1 below
kotlin
lines and the
strings.xml
Kotlin
Copy code
val tabItems = categories.map { TabItem(stringResource(it.getNameResId())) }

fun CheatCategory.getNameResId(): StringResource {
  return when (this) {
    CheatCategory.World -> Res.string.world
    CheatCategory.Player -> Res.string.player
    CheatCategory.Weapon -> Res.string.weapon
    CheatCategory.Vehicle -> Res.string.vehicle
  }

}
Strings.xml
Copy code
<string name="world">World</string>
    <string name="player">Player</string>
    <string name="weapon">Weapon</string>
    <string name="vehicle">Vehicle</string>
I didn't even change it in the new release, and the code remained the same. But why did it crash? 🤔 (edited)
p
Quick idea is that resources were not bundled properly. on macos you can right click on installed app and "show package contents" and check if strings are there/compare app store version with testflight
s
@Piotr Romanowicz Ive compared the strings file i.e a
cvr
file as you said for the build from
apple app store
vs the
testflight
for the same version but the content is completely identical
dem you Apple, my guess was right; simply after an update, this crash was fixed. It was some issue from the Apple processing pipeline. I have just added a CrashKiOS to the new release, nothing else which is unrelated to this crash and its resolved after an app update. I never thought this could even happen
😅 1