RevenueCat / purchases-flutter

Flutter plugin for in-app purchases and subscriptions. Supports iOS, macOS and Android.
https://www.revenuecat.com/
MIT License
600 stars 164 forks source link

Getting warning and slowdown on RevenueCatUI.presentPaywallIfNeeded() #1117

Open JaseElder opened 1 month ago

JaseElder commented 1 month ago

‼️ Required data ‼️

Do not remove any of the steps from the template below. If a step is not applicable to your issue, please leave that step empty.

There are a lot of things that can contribute to things not working. Having a very basic understanding of your environment will help us understand your issue faster!

Environment

• No issues found!

D/RevenueCatUI( 1239): Displaying paywall according to display logic
D/[Purchases] - DEBUG( 1239): ℹ️ Checking if cache is stale AppInBackground false
D/InputMethodManager( 1239): prepareNavigationBarInfo() DecorView@a0e8f33[MainActivity]
D/InputMethodManager( 1239): getNavigationBarColor() -855310
W/ViewRootImpl@784f6a2[MainActivity]( 1239): Cancelling event due to no window focus: 
E/ViewRootImpl@784f6a2[MainActivity]( 1239): mStopped=false mHasWindowFocus=false mPausedForTransition=false
W/ViewRootImpl@784f6a2[MainActivity]( 1239): Cancelling event due to no window focus: 
E/ViewRootImpl@784f6a2[MainActivity]( 1239): mStopped=false mHasWindowFocus=false mPausedForTransition=false
W/ViewRootImpl@784f6a2[MainActivity]( 1239): Cancelling event due to no window focus: 
E/ViewRootImpl@784f6a2[MainActivity]( 1239): mStopped=false mHasWindowFocus=false mPausedForTransition=false
W/ActivityThread( 1239): handleWindowVisibility: no activity for token android.os.BinderProxy@7defe8e
W/ViewRootImpl@784f6a2[MainActivity]( 1239): Cancelling event due to no window focus: 
E/ViewRootImpl@784f6a2[MainActivity]( 1239): mStopped=false mHasWindowFocus=false mPausedForTransition=false
W/ViewRootImpl@784f6a2[MainActivity]( 1239): Cancelling event due to no window focus: 
E/ViewRootImpl@784f6a2[MainActivity]( 1239): mStopped=false mHasWindowFocus=false mPausedForTransition=false
W/ViewRootImpl@784f6a2[MainActivity]( 1239): Cancelling event due to no window focus: 
E/ViewRootImpl@784f6a2[MainActivity]( 1239): mStopped=false mHasWindowFocus=false mPausedForTransition=false
W/ViewRootImpl@784f6a2[MainActivity]( 1239): Cancelling event due to no window focus: 
E/ViewRootImpl@784f6a2[MainActivity]( 1239): mStopped=false mHasWindowFocus=false mPausedForTransition=false
I/MultiWindowDecorSupport( 1239): updateCaptionType >> com.android.internal.policy.MultiWindowDecorSupport@a38ac43, isFloating: false, isApplication: true, hasWindowDecorCaption: false, hasWindowControllerCallback: true
D/MultiWindowDecorSupport( 1239): setCaptionType = 0
E/[Purchases] - ERROR( 1239): Error connecting to billing client to display in-app messages: PurchasesError(code=UnknownError, underlyingErrorMessage=BillingWrapper is not attached to a listener, message='Unknown error.')
D/InputTransport( 1239): Input channel constructed: fd=145
D/ViewRootImpl@cc159d8[PaywallActivity]( 1239): setView = DecorView@cc34131[PaywallActivity] TM=true MM=false
D/ViewRootImpl@784f6a2[MainActivity]( 1239): MSG_WINDOW_FOCUS_CHANGED 0 0
W/tomoto.roadboo( 1239): Class androidx.compose.runtime.snapshots.SnapshotStateMap failed lock verification and will run slower.
W/tomoto.roadboo( 1239): Common causes for lock verification issues are non-optimized dex code
W/tomoto.roadboo( 1239): and incorrect proguard optimizations.
W/tomoto.roadboo( 1239): Accessing hidden field Landroid/graphics/Insets;->left:I (light greylist, linking)
W/tomoto.roadboo( 1239): Accessing hidden field Landroid/graphics/Insets;->top:I (light greylist, linking)
W/tomoto.roadboo( 1239): Accessing hidden field Landroid/graphics/Insets;->right:I (light greylist, linking)
W/tomoto.roadboo( 1239): Accessing hidden field Landroid/graphics/Insets;->bottom:I (light greylist, linking)
W/tomoto.roadboo( 1239): Accessing hidden method Landroid/view/View;->getViewRootImpl()Landroid/view/ViewRootImpl; (light greylist, reflection)
W/tomoto.roadboo( 1239): Accessing hidden field Landroid/view/View$AttachInfo;->mVisibleInsets:Landroid/graphics/Rect; (light greylist, reflection)
W/tomoto.roadboo( 1239): Accessing hidden field Landroid/view/ViewRootImpl;->mAttachInfo:Landroid/view/View$AttachInfo; (light greylist, reflection)
D/ViewRootImpl@cc159d8[PaywallActivity]( 1239): Relayout returned: old=[0,0][800,1280] new=[0,0][800,1280] result=0x7 surface={true 3174756352} changed=true
D/mali_winsys( 1239): EGLint new_window_surface(egl_winsys_display *, void *, EGLSurface, EGLConfig, egl_winsys_surface **, EGLBoolean) returns 0x3000,  [800x1280]-format:1
D/OpenGLRenderer( 1239): eglCreateWindowSurface = 0xee3dc400, 0xbd3af008
W/tomoto.roadboo( 1239): Accessing hidden method Landroid/view/RenderNode;->create(Ljava/lang/String;Landroid/view/View;)Landroid/view/RenderNode; (light greylist, linking)
W/tomoto.roadboo( 1239): Accessing hidden method Landroid/view/RenderNode;->getScaleX()F (dark greylist, linking)
W/tomoto.roadboo( 1239): Accessing hidden method Landroid/view/DisplayListCanvas;->drawRenderNode(Landroid/view/RenderNode;)V (light greylist, linking)
W/tomoto.roadboo( 1239): Accessing hidden method Landroid/view/RenderNode;->getScaleX()F (dark greylist, linking)
W/tomoto.roadboo( 1239): Accessing hidden method Landroid/view/RenderNode;->getAlpha()F (dark greylist, linking)
W/tomoto.roadboo( 1239): Accessing hidden method Landroid/view/RenderNode;->getCameraDistance()F (dark greylist, linking)
W/tomoto.roadboo( 1239): Accessing hidden method Landroid/view/RenderNode;->getClipToOutline()Z (dark greylist, linking)
W/tomoto.roadboo( 1239): Accessing hidden method Landroid/view/RenderNode;->getElevation()F (dark greylist, linking)
W/tomoto.roadboo( 1239): Accessing hidden method Landroid/view/RenderNode;->isValid()Z (light greylist, linking)
W/tomoto.roadboo( 1239): Accessing hidden method Landroid/view/RenderNode;->getInverseMatrix(Landroid/graphics/Matrix;)V (dark greylist, linking)
W/tomoto.roadboo( 1239): Accessing hidden method Landroid/view/RenderNode;->getMatrix(Landroid/graphics/Matrix;)V (dark greylist, linking)
W/tomoto.roadboo( 1239): Accessing hidden method Landroid/view/RenderNode;->getPivotX()F (dark greylist, linking)
W/tomoto.roadboo( 1239): Accessing hidden method Landroid/view/RenderNode;->getPivotY()F (dark greylist, linking)
W/tomoto.roadboo( 1239): Accessing hidden method Landroid/view/RenderNode;->getRotationX()F (dark greylist, linking)
W/tomoto.roadboo( 1239): Accessing hidden method Landroid/view/RenderNode;->getRotationY()F (dark greylist, linking)
W/tomoto.roadboo( 1239): Accessing hidden method Landroid/view/RenderNode;->getRotation()F (dark greylist, linking)
W/tomoto.roadboo( 1239): Accessing hidden method Landroid/view/RenderNode;->getScaleX()F (dark greylist, linking)
W/tomoto.roadboo( 1239): Accessing hidden method Landroid/view/RenderNode;->getScaleY()F (dark greylist, linking)
W/tomoto.roadboo( 1239): Accessing hidden method Landroid/view/RenderNode;->getTranslationX()F (dark greylist, linking)
W/tomoto.roadboo( 1239): Accessing hidden method Landroid/view/RenderNode;->getTranslationY()F (dark greylist, linking)
W/tomoto.roadboo( 1239): Accessing hidden method Landroid/view/RenderNode;->hasOverlappingRendering()Z (dark greylist, linking)
W/tomoto.roadboo( 1239): Accessing hidden method Landroid/view/RenderNode;->offsetLeftAndRight(I)Z (light greylist, linking)
W/tomoto.roadboo( 1239): Accessing hidden method Landroid/view/RenderNode;->offsetTopAndBottom(I)Z (dark greylist, linking)
W/tomoto.roadboo( 1239): Accessing hidden method Landroid/view/RenderNode;->start(II)Landroid/view/DisplayListCanvas; (light greylist, linking)
W/tomoto.roadboo( 1239): Accessing hidden method Landroid/view/RenderNode;->end(Landroid/view/DisplayListCanvas;)V (light greylist, linking)
W/tomoto.roadboo( 1239): Accessing hidden method Landroid/view/RenderNode;->setAlpha(F)Z (dark greylist, linking)
W/tomoto.roadboo( 1239): Accessing hidden method Landroid/view/RenderNode;->setCameraDistance(F)Z (dark greylist, linking)
W/tomoto.roadboo( 1239): Accessing hidden method Landroid/view/RenderNode;->setClipToBounds(Z)Z (light greylist, linking)
W/tomoto.roadboo( 1239): Accessing hidden method Landroid/view/RenderNode;->setClipToOutline(Z)Z (dark greylist, linking)
W/tomoto.roadboo( 1239): Accessing hidden method Landroid/view/RenderNode;->setLayerType(I)Z (dark greylist, linking)
I/chatty  ( 1239): uid=10520(com.tomoto.roadbook) identical 1 line
W/tomoto.roadboo( 1239): Accessing hidden method Landroid/view/RenderNode;->setLayerType(I)Z (dark greylist, linking)
W/tomoto.roadboo( 1239): Accessing hidden method Landroid/view/RenderNode;->setElevation(F)Z (dark greylist, linking)
W/tomoto.roadboo( 1239): Accessing hidden method Landroid/view/RenderNode;->setHasOverlappingRendering(Z)Z (light greylist, linking)
W/tomoto.roadboo( 1239): Accessing hidden method Landroid/view/RenderNode;->setOutline(Landroid/graphics/Outline;)Z (dark greylist, linking)
W/tomoto.roadboo( 1239): Accessing hidden method Landroid/view/RenderNode;->setPivotX(F)Z (dark greylist, linking)
W/tomoto.roadboo( 1239): Accessing hidden method Landroid/view/RenderNode;->setPivotY(F)Z (dark greylist, linking)
W/tomoto.roadboo( 1239): Accessing hidden method Landroid/view/RenderNode;->setLeftTopRightBottom(IIII)Z (light greylist, linking)
W/tomoto.roadboo( 1239): Accessing hidden method Landroid/view/RenderNode;->setRotationX(F)Z (dark greylist, linking)
W/tomoto.roadboo( 1239): Accessing hidden method Landroid/view/RenderNode;->setRotationY(F)Z (dark greylist, linking)
W/tomoto.roadboo( 1239): Accessing hidden method Landroid/view/RenderNode;->setRotation(F)Z (dark greylist, linking)
W/tomoto.roadboo( 1239): Accessing hidden method Landroid/view/RenderNode;->setScaleX(F)Z (dark greylist, linking)
W/tomoto.roadboo( 1239): Accessing hidden method Landroid/view/RenderNode;->setScaleY(F)Z (dark greylist, linking)
W/tomoto.roadboo( 1239): Accessing hidden method Landroid/view/RenderNode;->setTranslationX(F)Z (dark greylist, linking)
W/tomoto.roadboo( 1239): Accessing hidden method Landroid/view/RenderNode;->setTranslationY(F)Z (dark greylist, linking)
W/tomoto.roadboo( 1239): Accessing hidden method Landroid/view/RenderNode;->getScaleX()F (dark greylist, linking)
D/[Purchases] - DEBUG( 1239): ℹ️ Vending Offerings from cache
D/[Purchases] - DEBUG( 1239): ℹ️ Checking if cache is stale AppInBackground false
D/[Purchases] - DEBUG( 1239): Retrieving customer info with policy: CACHED_OR_FETCHED
D/[Purchases] - DEBUG( 1239): ℹ️ Vending CustomerInfo from cache.
D/[Purchases] - DEBUG( 1239): ℹ️ Checking if cache is stale AppInBackground false
W/tomoto.roadboo( 1239): Class androidx.compose.runtime.snapshots.SnapshotStateList failed lock verification and will run slower.
D/[Purchases] - DEBUG( 1239): Tracking paywall event: PaywallEvent(creationData=CreationData(id=cc582dde-4c72-409a-bab4-0ee0d2510ef8, date=Thu Jul 11 16:09:14 GMT+01:00 2024), data=Data(offeringIdentifier=default, paywallRevision=4, sessionIdentifier=30966475-8591-4d54-bf12-82dfec964692, displayMode=full_screen, localeIdentifier=en_GB, darkMode=true), type=IMPRESSION)
W/tomoto.roadboo( 1239): Accessing hidden method Landroid/text/SpannableStringInternal;->length()I (light greylist, linking)
W/tomoto.roadboo( 1239): Accessing hidden method Landroid/graphics/Canvas;->drawPatch(Landroid/graphics/NinePatch;Landroid/graphics/Rect;Landroid/graphics/Paint;)V (dark greylist, linking)
W/tomoto.roadboo( 1239): Accessing hidden method Landroid/graphics/Canvas;->drawPatch(Landroid/graphics/NinePatch;Landroid/graphics/RectF;Landroid/graphics/Paint;)V (dark greylist, linking)
W/View    ( 1239): requestLayout() improperly called by androidx.compose.ui.platform.ViewLayerContainer{a3d8276 V.E...... ......ID 0,0-0,0} during layout: running second layout pass
I/Choreographer( 1239): Skipped 212 frames!  The application may be doing too much work on its main thread.
D/ViewRootImpl@cc159d8[PaywallActivity]( 1239): MSG_RESIZED: frame=[0,0][800,1280] ci=[0,32][0,0] vi=[0,32][0,0] or=1
D/ViewRootImpl@cc159d8[PaywallActivity]( 1239): MSG_WINDOW_FOCUS_CHANGED 1 1

Describe the bug

Getting the below in the above logs, and the paywall is slow to display.

Class androidx.compose.runtime.snapshots.SnapshotStateMap failed lock verification and will run slower. Common causes for lock verification issues are non-optimized dex code and incorrect proguard optimizations.

Additional context

Add any other context about the problem here.

RCGitBot commented 1 month ago

👀 We've just linked this issue to our internal tracker and notified the team. Thank you for reporting, we're checking this out!

joshdholtz commented 1 month ago

@JaseElder Thank you for reporting this! One follow up question if you don't mind so that we can try to reproduce this 💪

1) Are you experiencing this on emulators or also on real Android devices? 2) Is this a repeatable thing you are seeing every time? Or is this only happening sometimes?

Thanks!

JaseElder commented 1 month ago
1. Are you experiencing this on emulators or also on real Android devices?

I haven't checked on emulator - experiencing on real devices. The above was on a Samsung Tab Active 2 running Android API 28 Running on a OnePlus Nord 2T 5G (Android API 34) I get a slightly different set of logs:

W/tomoto.roadbook(10030): Method java.lang.Object androidx.compose.runtime.snapshots.SnapshotStateMap.mutate(kotlin.jvm.functions.Function1) failed lock verification and will run slower.
W/tomoto.roadbook(10030): Common causes for lock verification issues are non-optimized dex code
W/tomoto.roadbook(10030): and incorrect proguard optimizations.
W/tomoto.roadbook(10030): Method void androidx.compose.runtime.snapshots.SnapshotStateMap.update(kotlin.jvm.functions.Function1) failed lock verification and will run slower.
W/tomoto.roadbook(10030): Method boolean androidx.compose.runtime.snapshots.SnapshotStateMap.removeIf$runtime_release(kotlin.jvm.functions.Function1) failed lock verification and will run slower.
2. Is this a repeatable thing you are seeing every time? Or is this only happening sometimes?

It seems to happen every time the paywall is invoked