adaptyteam / AdaptyUI-Unity

Extension to the Adapty SDK that allows you to easily add purchase screens to your application.
https://docs.adapty.io/docs/paywall-builder-getting-started
MIT License
6 stars 0 forks source link

Receiving a SegmentationFault after calling view.Present For Android #2

Closed RFS-6ro closed 7 months ago

RFS-6ro commented 7 months ago

image

Here's the code I use to show the paywall: It appears for one second and the application crashes.

#region Fetch
Adapty.GetPaywall
(
    placement.ToString(), 
    (paywall, error) => 
    {
        if(error == null) return:

        #region Create Paywall View
        AdaptyUI.CreatePaywallView
        (
            paywall, "en", preloadProducts: true, 
            (view, error) => 
            {
                  if(error == null)  return:

                  #region Present Paywall View

                  view.Present((error) => { }); //Error is null

                  #endregion
              }
          );
          #endregion
    }
);
#endregion
fablerq commented 7 months ago

+1 for the same behavior

RFS-6ro commented 7 months ago

Attaching Crash Log captured on android device through Android Logcat

Adapty_SIGSEGV_Crash_Log.txt

vladd-g commented 7 months ago

@RFS-6ro @fablerq thank you for the report! Could you please check if this solution fixes the problem?

RFS-6ro commented 7 months ago

@RFS-6ro @fablerq thank you for the report! Could you please check if this solution fixes the problem?

I was using il2cpp even before integrating your solution

vladd-g commented 7 months ago

@RFS-6ro which Adapty and Unity versions do you use?

RFS-6ro commented 7 months ago

@vladd-g Unity v2022.3.8f1 AdaptySDK v2.7.1 (Yes, you said to use 2.7.0, but it's not compatible due to compilation errors (missing Adapty.SetUnknownEventListener method)) Adapty.UI v2.0.1

vladd-g commented 7 months ago

@RFS-6ro thank you!

We built with 2021.3.30f1, it was ok

Is it the same for AdaptyUI v2.0.0?

RFS-6ro commented 7 months ago

@vladd-g Will try your sample project and those versions right away

RFS-6ro commented 7 months ago

Ok, I figured it out. The problem was with Sentry SDK that is monitoring activities and unity sessions. Since Adapty is pausing Unity activity and creating its own - Sentry was throwing an exception, closing an application.