airsdk / Adobe-Runtime-Support

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

AIR 33.1.1.63 - iOS - Immediately crashing on startup #258

Open FliplineStudios opened 4 years ago

FliplineStudios commented 4 years ago

Problem Description

iOS app is immediately crashing on startup when packaged with AIR 33.1.1.63, also tested with AIR 33.1.1.50 with same crash. Some details about the app:

Using LaunchScreen.storyboardc as required by newest iOS SDK, which shows up correctly, but as soon as the app should start it is crashing. Crash log from the device is attached below.

Tested exact same build with AIR 32.0.0.103 (and using 32.0 namespace in XML), which runs correctly on the device.

ios_crash_log.txt

FliplineStudios commented 4 years ago

Quick update:

The crash seems to happen randomly when using the flash.geom classes that have been updated in AIR 33.1.

In almost all cases it would crash during startup when setting root.transform.perspectiveProjection.projectionCenter with a new Point(usex,usey), though occasionally it would handle this fine, and further into the app it would instead randomly crash when defining a new Point or new Rectangle.

ajwfrost commented 4 years ago

Thanks for the hint here .. presumably this isn’t actually calling the new APIs themselves? but is built using the 33.1 airglobal SWC file?

FliplineStudios commented 4 years ago

Hmm actually with our workflow we generally build the SWF using FlashDevelop, and package that final SWF separately using the latest ADT command-line version, so our source SWF is often compiled with a different version than what ADT is using (in this case it looks like we're using -swf-version=37).

For ADT in AIR 33.1, could you clarify if ADT requires that the source SWF is also using 33.1, or if it can continue to package older SWFs? I can also work towards overlaying 33.1 on FlashDevelop's Flex SDK, and see if we still have the same problem.

Also on a related note I've tested the same build on Android with 33.1.1.63 and don't seem to have any issues with the flash.geom classes there, seems like it's only occurring on iOS for me.

ajwfrost commented 4 years ago

Thanks; so it should be absolutely fine with this workflow i.e. older SWFs with different versions can be packaged using the latest SDKs. The step of packaging for iOS though would use the compile-abc tools to pull out the ActionScript and pre-build this (AOT) and then link everything together.

A quick check of the files involved in this process though suggests that they're all updated to handle the new APIs.. looking at the perspectiveProjection property itself, I may have just seen an issue where the AS3 definition doesn't quite match up with the C++ definition (a default parameter is defined on the C++ side). The normal way this is called (JIT/interp), the default parameter would be invoked; potentially though with AOT, the calling function may not know about this and it may have an invalid value depending on the contents of a particular register at that time.

We'll do a bit of digging to work out what might actually happen in this scenario, to confirm whether this might be the case or not...

thanks

FliplineStudios commented 4 years ago

Thanks Andrew, it looks like if I comment out the perspectiveProjection part, it's reliably crashing now during a section of code where I'm drawing into BitmapData when creating a new Point or new Rectangle. I'll see if I can narrow that down better to help shed some light on where the crash is happening, and see if I can make a sample file to send over that would reproduce it for testing too.

KaseYu commented 4 years ago

I have the same problem here. The same problem occurs with the packaging of my app using SDK 33.1.1.63. On Android, ANE will become NULL, and on iOS, it will crash. Returning to 32.0.2.338 will be normal

ajwfrost commented 4 years ago

@KaseYu I think the ANE-related problem is actually a separate issue from this which is geometry-related.. are you okay to raise a new issue for what you see?

@FliplineStudios that’s concerning if it’s just about creating a new Point/Rectangle - unless perhaps there are more things going on under the hood.. we can get an updated application to you that hopefully fixes the perspective projection problem, are you on a Mac or Windows?

KaseYu commented 4 years ago

@ajwfrost OK

ajwfrost commented 4 years ago

@FliplineStudios are you able to copy the file from the zip (link below) into the lib/aot/lib folder of your .63 SDK and try re-building the IPA file? This should fix the perspectiveProjection part, but I would be interested to see if there are then other issues with points/rectangles as we hadn't touch them! https://transfer.harman.com/message/kGoapzM1JURiLRMGYjPofn

Thanks

FliplineStudios commented 4 years ago

@ajwfrost After doing more debugging, I can't seem to find any rhyme or reason to the crashing, but it does always crash in every session within the first minute. Running the same IPA, sometimes it will crash immediately on startup, other times I can see my title screen, but as soon as it starts initializing the game it will crash -- and it crashes in a different spot in each session when I re-open the same app. It first seemed to be related to when it was creating bitmaps and creating new Points and Rectangles, but sometimes it crashes before reaching that point, so it may not be exactly related.

Definitely seems to be related to AOT compiling, since an ipa-debug-interpreter build doesn't crash, but ipa-debug and ipa-ad-hoc both do crash every time.

I've attached some crash logs from one build crashing at various different points, where I kept re-opening the app and re-running it until it crashed again, not sure if these have any usable information for tracking down the issue.

Papa's Sushiria To Go-2020-03-10-101931.txt Papa's Sushiria To Go-2020-03-10-102140.txt Papa's Sushiria To Go-2020-03-10-102449.txt Papa's Sushiria To Go-2020-03-10-102633.txt Papa's Sushiria To Go-2020-03-10-102743.txt Papa's Sushiria To Go-2020-03-10-102909.txt Papa's Sushiria To Go-2020-03-10-103033.txt

I'll try the file you attached in the last post and re-build to see if there are any changes with that. If there's anything else you'd like me to try or like me to send over just let me know!

FliplineStudios commented 4 years ago

@ajwfrost I just tried the updated libRuntimeHMAOT and that seems to have fixed the crashing!

Was the perspectiveProjection the only change in that updated file? Just curious because I still have perspectiveProjection commented out in my code, but all of the other crashes further in the game initialization seem to have disappeared with this update. Tried both ipa-debug with a debug SWF and ipa-ad-hoc with a release SWF, and both seem to be working correctly now with that update. I'll continue testing with this IPA to make sure the crashes aren't popping up further along.

Thanks!

ajwfrost commented 4 years ago

That's promising! Yes, literally the only change in this was to change the Transform class definition so that the get_perspectiveProjection method no longer took an optional parameter in C++. It sounds like this adjusted the function offsets for the other classes which would perhaps explain the issues.

cheers

stoff99 commented 4 years ago

Hi @ajwfrost, i have more or less the same issue with the .63 SDK. We using the setTo method of Rectangle which cause in a crash.

My main problem is that i cannot debug with the new .63 SDK. IntelliJ cannot start debugging because adt -devices -platform ios command is crashing with error "Mismatch in device list length: argument was 1, found 2" I described the problem here: https://github.com/Gamua/Adobe-Runtime-Support/issues/112 (last comment)

I copied your content as you described to the lib/aot/lib folder. As soon as this is fixed i can debug again with IntelliJ. When i make an adHoc build i only see that its crashing fully again.

smileygamer commented 4 years ago

Hi @ajwfrost , I just started testing AIR 33, and I seem to be having the same problem: a crash on launch. I'm using Adobe Animate (latest version) on MacOS 10.13.4. It seems the file you shared earlier is not available anymore for download. Is that the only solution?

Thanks

smileygamer commented 4 years ago

Some more info: this is happening on iOS. On Android we also have crashes on launch but different ones (VerifyErrors in 3rd party ANEs).

I made a blank project and started adding ANEs 1 by 1 to see if any of them cause the crash. But by themselves they work, it's only when I combine multiple ANEs that it crashes.

E.g. with the following Distriqt ANEs: Core + Application + Notifications -> works Core + Application + Notifications + PushNotifications -> crash Core + Application + PushNotifications -> works!

The same happens with other combinations. Sometimes it works, sometimes it crashes. It doesn't make sense to me...

Can somebody please help? It looks like I'll be forced to use AIR 33 on iOS starting this April: "Starting April 2020, all iOS apps submitted to the App Store must be built with the iOS 13 SDK or later".

ajwfrost commented 4 years ago

@smileygamer thanks for the analysis: if you’re finding issues with ANE combinations then this isn’t the Geometry API problem that we put out the temporary fix for.. but we are still aiming to get a release out to fix the ANE things this week..

leossmith commented 4 years ago

I think I have the same issue. I am just testing to make sure this is an issue with the combination of ANEs. For now it looks like my app is crashing on iOS when using both Notifications + PushNotifications.

Android works perfectly.

ajwfrost commented 4 years ago

Hi @leossmith - can I check what version of the SDK you're using? We had the issue in 33.1.1.63 but that was fixed in 33.1.1.98.. And also does this crash only with particular handsets/iOS versions?

thanks

leossmith commented 4 years ago

I have tried 33.0.2.338 and 33.1.1.98. I get the same behavior in debug or release. In debug, app starts, i can see the launchimage briefly then it quits without any errors. I do have an error log from Apple if it helps (error log1 errorlog2 ).

I am using Distriqts Core + Notifications + Dialog + NetworkInfo.

My testing device is iPad mini 2 with ios 12.4.7 but as you can see review has tested it in other devices too.

EDIT:

So after a lot of tests, i figured out that the issue was something else all together (at least in my case). It looks like UILaunchStoryboardName ended up in my xml file without a file to use, causing it to crash without any messages on startup.

rdefalco commented 4 years ago

So after a lot of tests, i figured out that the issue was something else all together (at least in my case). It looks like UILaunchStoryboardName ended up in my xml file without a file to use, causing it to crash without any messages on startup.

Thanks and thanks again, mate! It seems that MyFlashLabs' Ane Lab put in my manifest these additions:

UILaunchStoryboardName LaunchScreen

I fixed launch crash simply commenting/removing them!

I don't know iOS structure enough to suggest if this issue should be addressed by MyFlashLabs simply by NOT adding this manifest addition or by Harman?