airsdk / Adobe-Runtime-Support

Report, track and discuss issues in Adobe AIR. Monitored by Adobe - and HARMAN - and maintained by the AIR community.
201 stars 11 forks source link

iOS Crash on startup #2860

Closed raresn closed 11 months ago

raresn commented 12 months ago

Our app that is now live on Appstore, somehow passed through review but it crashes on two iphones iPhone with ios < 17. (12 and 16) On an ipad with ios 17 it works.

This is quite serious as this is now live on Appstore :(

Any clue what i can do about this @ajwfrost ?

On Time Agenda-2023-09-28-161255.txt

ajwfrost commented 12 months ago

The earlier crash-log showed an issue with the start-up taking over 10s? Not sure why that might have been the case unless there's a large amount of activity going on within the main app constructor (or ANE initialisations?)

This 16:12:55 one though is fairly clear:

Termination Description: DYLD, Library not loaded:
/System/Library/Frameworks/Combine.framework/Combine
Referenced from: [your app executable]
Reason: image not found

It's meant to be present on iOS 13 and above, so I'm not sure what's going on there.. We shouldn't be adding a reference to this library ourselves, do you know if there's an ANE that has this dependency?

raresn commented 12 months ago

@ajwfrost i didn't think you were that fast :) I removed it because it was an old log, that i attached by mistake. I removed all ANEs from the xml, and it still crashes.

[NO ANE]On Time Agenda-2023-09-28-170221.txt

raresn commented 12 months ago

"It's meant to be present on iOS 13 and above" not sure what you mean here, because that combile.framework means nothing to me, unfortunately - we do have a storyboard generated by a script that @marchbold put together. It crashes with or without it (although WITH it, it shows the splashscreen). Using MAC to compile, btw.

ajwfrost commented 12 months ago

i didn't think you were that fast :)

I got it directly in a notification email.. but thanks for clarifying!

So this latest one log shows something different:

Application Specific Information:
abort() called

and the call stack looks like it's just initializing the UIKit stuff:

2   libsystem_c.dylib               0x00000001bf9c7ea8 0x1bf96d000 + 372392
3   libc++abi.dylib                 0x00000001bf094788 0x1bf093000 + 6024
4   libc++abi.dylib                 0x00000001bf094934 0x1bf093000 + 6452
5   libobjc.A.dylib                 0x00000001bf0abe00 0x1bf0a6000 + 24064
6   libc++abi.dylib                 0x00000001bf0a0838 0x1bf093000 + 55352
7   libc++abi.dylib                 0x00000001bf0a08c4 0x1bf093000 + 55492
8   libdispatch.dylib               0x00000001bf9117e8 0x1bf8b1000 + 395240
9   libdispatch.dylib               0x00000001bf8b65dc 0x1bf8b1000 + 21980
10  FrontBoardServices              0x00000001c288b040 0x1c2845000 + 286784
11  FrontBoardServices              0x00000001c288acdc 0x1c2845000 + 285916
12  FrontBoardServices              0x00000001c288b294 0x1c2845000 + 287380
13  CoreFoundation                  0x00000001bfe64f1c 0x1bfdba000 + 700188
14  CoreFoundation                  0x00000001bfe64e9c 0x1bfdba000 + 700060
15  CoreFoundation                  0x00000001bfe64784 0x1bfdba000 + 698244
16  CoreFoundation                  0x00000001bfe5f6c0 0x1bfdba000 + 677568
17  CoreFoundation                  0x00000001bfe5efb4 0x1bfdba000 + 675764
18  GraphicsServices                0x00000001c206179c 0x1c2057000 + 42908
19  UIKitCore                       0x00000001ec8abc38 0x1ebfef000 + 9161784
20  Your_app_binary                 0x000000010098253c 0x100878000 + 1090876

The earlier error seemed to be complaining that the process relies upon finding "Combine.framework" but didn't find it.. but according to the Apple documentation, "Combine.framework" should be present on all devices that have iOS 13 or later.

What version of macOS and Xcode are you compiling with? There have been some odd issues with the Xcode 15 linker that we're finding currently.. (like, it won't build an IPA against our generated 'stub' files).

thanks

raresn commented 12 months ago

xcode 14.3.1 (14E300c) ventura 13.6 (22G120)

Let me know what else i should try. Lets just say i will be refreshing this thread :D Also i have access to one of the devices that crashes so I can test stuff with ease.

raresn commented 12 months ago

@ajwfrost Here is the crash i ment to upload earlyer. The crash was after a fresh install from the AppStore (so not ios 16, but 15) [ileana]On Time Agenda-2023-09-28-172643.txt

ajwfrost commented 12 months ago

Just thinking about the change there .. if you took the ANEs out of the descriptor file, but the SWF wasn't changed (so it still relied on their library.swf ActionScript definitions) then this may be why there's a deliberate call to abort(), it could be due to an AS3 VerifyError.... I don't suppose you're able to set up Adobe Scout and see whether that has time to connect..?

Do you have the linker command-line that is used (when you build the full app, including those ANEs)? i.e. from adt.log it should show the inclusion of that Combine framework.. am wondering whether there's then a way to properly eliminate that ANE (ideally it could switch into the 'default' platform mode rather than including the native code) and still have your application run up.

Also worth checking .. can you re-package it with the latest ADT.jar file that was uploaded here: https://github.com/airsdk/Adobe-Runtime-Support/issues/2768#issuecomment-1737755883

The log you uploaded just now (17:26:43) has:

  "termination" : {"code":4,"flags":518,"namespace":"DYLD","indicator":"Symbol missing","details":
["(terminated at launch; ignore backtrace)"]
"reasons":["Symbol not found: (
_$s10Foundation10CocoaErrorV4CodeVAA01_cD8ProtocolAAMc
)","Referenced from: '\/Volumes\/VOLUME\/*\/On Time Agenda.app\/On Time Agenda'","Expected in: '\/System\/Library\/Frameworks\/Foundation.framework\/Foundation'"]},

and that's something that should be fixed with this latest adt.jar file...

raresn commented 12 months ago

Appologies for not mentioning, when i removed the extensions, i used a version of the app (swf) that doesn't use extensions (the one for desktop). So the app doesn't start at all - doesn't connect to debugger. Will test with the new adt.jar now.

raresn commented 12 months ago

This compile is with the new adt, with a swf that doesn't uses the extensions, but the extension folder is packaged New_adt_On Time Agenda-2023-09-28-174543.txt .

ajwfrost commented 12 months ago

Okay so that one is back to

Termination Description: DYLD, Library not loaded:
/System/Library/Frameworks/Combine.framework/Combine
Reason: image not found

.. but that would be expected:

OS Version:          iPhone OS 12.5.7 (16H81)

https://developer.apple.com/documentation/combine -> "iOS 13.0+"

So .. something is causing a dependency on this... the "ld64" linker command-line may help tell us what it is, but it may be a case of looking in each .ane file and seeing if there's a mention of this framework in the platformoptions.xml file for the iPhone-ARM platform...

raresn commented 12 months ago

@ajwfrost As all good errors out there, there was a combination of 2 errors :) 1) If you have the storyboard in the xml but don't package it up in the command line, you get the Application Specific Information: abort() called -> Easy fix, you add the damn Storyboard and it will not crash because of that. (Would have been nice to get a compile error here to be honest, but still)

AND OUR PROBLEM ON THEN PLAYSTORE: - the push notification ane from distriqt.

com.distriqt.PushNotifications

Empty swf, just the extensions in the xml = crash Empty swf, just the extensions in the xml without the push notification ane = ok @marchbold - thoughts on this? From what i can see this might be related to:

2768

[PushNotificationANEFail]On Time Agenda-2023-09-29-104727.txt

ajwfrost commented 12 months ago

Okay thanks ..

Easy fix, you add the damn Storyboard and it will not crash because of that. (Would have been nice to get a compile error here to be honest, but still)

I had thought we'd been checking for that, but will double-check. Yes definitely a compiler error/warning would be a good idea...

raresn commented 12 months ago

I replaced the adt.jar inside the lib folder of AIRSDK and same result - crashed with image not found

marchbold commented 12 months ago

What extensions are you using? Haven't noticed any of the sdks list a dependency on the combine framework but I may have missed something.

raresn commented 12 months ago

@marchbold these are all the extensions. Without the push, the app doesn't crash on startup:

 <extensions>
    <extensionID>androidx.appcompat</extensionID>
    <extensionID>androidx.browser</extensionID>
    <extensionID>androidx.cardview</extensionID>
    <extensionID>androidx.constraintlayout</extensionID>
    <extensionID>androidx.core</extensionID>
    <extensionID>androidx.exifinterface</extensionID>
    <extensionID>androidx.vectordrawable</extensionID>
    <extensionID>com.android.installreferrer</extensionID>
    <extensionID>com.bumptech.glide</extensionID>
    <extensionID>com.distriqt.Application</extensionID>
    <extensionID>com.distriqt.CameraRollExtended</extensionID>
    <extensionID>com.distriqt.Contacts</extensionID>
    <extensionID>com.distriqt.Core</extensionID>
    <extensionID>com.distriqt.Firebase</extensionID>
    <extensionID>com.distriqt.IDFA</extensionID>
    <extensionID>com.distriqt.PushNotifications</extensionID>
    <extensionID>com.distriqt.firebase.Auth</extensionID>
    <extensionID>com.distriqt.firebase.Crashlytics</extensionID>
    <extensionID>com.distriqt.firebase.Database</extensionID>
    <extensionID>com.distriqt.playservices.AdsIdentifier</extensionID>
    <extensionID>com.distriqt.playservices.AppSet</extensionID>
    <extensionID>com.distriqt.playservices.Auth</extensionID>
    <extensionID>com.distriqt.playservices.Base</extensionID>
    <extensionID>com.distriqt.playservices.CloudMessaging</extensionID>
    <extensionID>com.distriqt.square.okhttp</extensionID>
    <extensionID>com.distriqt.square.okhttp3</extensionID>
    <extensionID>com.distriqt.square.picasso</extensionID>
    <extensionID>com.google.android.datatransport</extensionID>
    <extensionID>com.google.android.recaptcha</extensionID>
    <extensionID>com.google.code.gson</extensionID>
    <extensionID>com.google.dagger</extensionID>
    <extensionID>com.google.firebase.core</extensionID>
    <extensionID>com.google.firebase.messaging</extensionID>
    <extensionID>com.google.guava</extensionID>
    <extensionID>com.google.protobuflite</extensionID>
    <extensionID>com.jetbrains.kotlin</extensionID>
    <extensionID>io.grpc</extensionID>
    <extensionID>io.reactivex</extensionID>

  </extensions> 
marchbold commented 12 months ago

Which variant of the push ane are you using?

raresn commented 12 months ago

Used APM to update. Did an update yesterday as well to make sure. I will also manually check now that we got the latest ane from github (the one updated last week).

raresn commented 12 months ago

@marchbold com.distriqt.PushNotifications.FCM and i confirm i have the latest version of com.distriqt.PushNotifications.FCM.ane

raresn commented 12 months ago

@marchbold I did a test - by replacing the FCM one with the regular one, it does not crash anymore. So it is isolated to the FCM version.

raresn commented 11 months ago

Any chance this can be a quick fix? :)

marchbold commented 11 months ago

Looking into it. Not sure yet.

raresn commented 11 months ago

@marchbold any update?

marchbold commented 11 months ago

@raresn We are not able to replicate this one currently so not sure what the issue could be. What dev environment are you using to package your app? We are using the AIR SDK 50.2.3.6 on macos with Xcode 14.3

marchbold commented 11 months ago

Ah actually, we have been able to replicate it, but only on an iOS 12 device. Can you confirm you aren't seeing this issue on iOS 13+?

raresn commented 11 months ago

@marchbold Crashes on two iphones iPhone with ios < 17. (12 and 16) On an ipad with ios 17 it works. I can run any test you need, of course.

marchbold commented 11 months ago

Hmm I can't replicate on iOS 16 but have been able to on iOS 12. I'll post an update in the push notifications repo.

Ender22 commented 11 months ago

Some of my users have shown me a crash that happens occasionally, basically my app starts up, about 5 seconds pass, then is crashes. They've shown me it happen 4-5 times in a row, but then after uninstalling the app and reinstalling it, the crashes disappear. Is this the same kind of crash you were able to reproduce Michael, or potentially unrelated? (btw I'm using the pushy version)

marchbold commented 11 months ago

@Ender22 That sounds unrelated. This crash happens immediately at launch.

raresn commented 11 months ago

@marchbold I confirm it works on ios 12 and 17. Can i close the issue?

marchbold commented 11 months ago

Feel free to close this one, I'll close the one in the push notifications repository when we release the update.