Caused by java.lang.IncompatibleClassChangeError in PaywallActivity
- [x] I have updated Purchases SDK to the latest version
- [x] I have read the Contribution Guidelines
- [x] I have searched the Community
- [x] I have read docs.revenuecat.com
- [x] I have searched for existing Github issues
Describe the bug I see these crashes on production. It's been reported by crashlytics.
Caused by java.lang.IncompatibleClassChangeError: Found interface androidx.compose.ui.graphics.drawscope.DrawScope, but class was expected (declaration of 'androidx.compose.ui.graphics.drawscope.DrawScope' appears in /data/app/~~qf3RHrX9BucnH2DAJwk3JQ==/com.creativetechnology.beatbounce-hV0elb70LF8iJxPmYFnSNw==/base.apk)
at androidx.compose.ui.graphics.drawscope.DrawScope.drawRect-n-J9OG0$default(:25)
at androidx.compose.foundation.BackgroundNode.drawRect(:33)
at androidx.compose.foundation.BackgroundNode.draw(:8)
at androidx.compose.ui.node.LayoutNodeDrawScope.drawDirect-eZhPAX0$ui_release(:89)
at androidx.compose.ui.node.LayoutNodeDrawScope.draw-eZhPAX0$ui_release(:25)
at androidx.compose.ui.node.NodeCoordinator.drawContainedDrawModifiers(:34)
at androidx.compose.ui.node.NodeCoordinator.access$drawContainedDrawModifiers()
at androidx.compose.ui.node.NodeCoordinator$drawBlock$1$1.invoke(:6)
at androidx.compose.ui.node.NodeCoordinator$drawBlock$1$1.invoke()
at androidx.compose.runtime.snapshots.Snapshot$Companion.observe(:130)
at androidx.compose.runtime.snapshots.SnapshotStateObserver$ObservedScopeMap.observe(:45)
at androidx.compose.runtime.snapshots.SnapshotStateObserver.observeReads(:99)
at androidx.compose.ui.node.OwnerSnapshotObserver.observeReads$ui_release(:2)
at androidx.compose.ui.node.NodeCoordinator$drawBlock$1.invoke(:35)
at androidx.compose.ui.node.NodeCoordinator$drawBlock$1.invoke(:4)
at androidx.compose.ui.platform.GraphicsLayerOwnerLayer$recordLambda$1.invoke(:24)
at androidx.compose.ui.platform.GraphicsLayerOwnerLayer$recordLambda$1.invoke(:2)
at androidx.compose.ui.graphics.layer.GraphicsLayerV29.record(:56)
at androidx.compose.ui.graphics.layer.GraphicsLayer.recordInternal(:55)
at androidx.compose.ui.graphics.layer.GraphicsLayer.record-mL-hObY(:15)
at androidx.compose.ui.platform.GraphicsLayerOwnerLayer.updateDisplayList(:79)
at androidx.compose.ui.platform.GraphicsLayerOwnerLayer.drawLayer(:10)
at androidx.compose.ui.node.NodeCoordinator.draw(:4)
at androidx.compose.ui.node.LayoutNode.draw$ui_release(:4)
at androidx.compose.ui.node.InnerNodeCoordinator.performDraw(:37)
at androidx.compose.ui.node.NodeCoordinator.drawContainedDrawModifiers(:11)
at androidx.compose.ui.node.NodeCoordinator.draw(:29)
at androidx.compose.ui.node.LayoutNode.draw$ui_release(:4)
at androidx.compose.ui.platform.AndroidComposeView.dispatchDraw(:56)
at android.view.View.draw(View.java:26345)
at android.view.View.updateDisplayListIfDirty(View.java:25175)
at android.view.View.draw(View.java:26072)
at android.view.ViewGroup.drawChild(ViewGroup.java:4810)
at android.view.ViewGroup.dispatchDraw(ViewGroup.java:4564)
at android.view.View.updateDisplayListIfDirty(View.java:25161)
at android.view.View.draw(View.java:26072)
at android.view.ViewGroup.drawChild(ViewGroup.java:4810)
at android.view.ViewGroup.dispatchDraw(ViewGroup.java:4564)
at android.view.View.updateDisplayListIfDirty(View.java:25161)
at android.view.View.draw(View.java:26072)
at android.view.ViewGroup.drawChild(ViewGroup.java:4810)
at android.view.ViewGroup.dispatchDraw(ViewGroup.java:4564)
at android.view.View.updateDisplayListIfDirty(View.java:25161)
at android.view.View.draw(View.java:26072)
at android.view.ViewGroup.drawChild(ViewGroup.java:4810)
at android.view.ViewGroup.dispatchDraw(ViewGroup.java:4564)
at com.android.internal.policy.DecorView.dispatchDraw(DecorView.java:1211)
at android.view.View.draw(View.java:26345)
at com.android.internal.policy.DecorView.draw(DecorView.java:1193)
at android.view.View.updateDisplayListIfDirty(View.java:25175)
at android.view.ThreadedRenderer.updateViewTreeDisplayList(ThreadedRenderer.java:694)
at android.view.ThreadedRenderer.updateRootDisplayList(ThreadedRenderer.java:700)
at android.view.ThreadedRenderer.draw(ThreadedRenderer.java:798)
at android.view.ViewRootImpl.draw(ViewRootImpl.java:7016)
at android.view.ViewRootImpl.performDraw(ViewRootImpl.java:6632)
at android.view.ViewRootImpl.performTraversals(ViewRootImpl.java:5531)
at android.view.ViewRootImpl.doTraversal(ViewRootImpl.java:3924)
at android.view.ViewRootImpl$TraversalRunnable.run(ViewRootImpl.java:12903)
at android.view.Choreographer$CallbackRecord.run(Choreographer.java:1901)
at android.view.Choreographer$CallbackRecord.run(Choreographer.java:1910)
at android.view.Choreographer.doCallbacks(Choreographer.java:1367)
at android.view.Choreographer.doFrame(Choreographer.java:1292)
at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:1870)
at android.os.Handler.handleCallback(Handler.java:995)
at android.os.Handler.dispatchMessage(Handler.java:103)
at android.os.Looper.loopOnce(Looper.java:273)
at android.os.Looper.loop(Looper.java:363)
at android.app.ActivityThread.main(ActivityThread.java:10060)
at java.lang.reflect.Method.invoke(Method.java)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:632)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:975)
Additional context
Last screen is PaywallActivity which is triggered by PaywallTrampolineActivity
👀 We've just linked this issue to our internal tracker and notified the team. Thank you for reporting, we're checking this out!
Interesting. We'll look into this. I think it may be due to Proguard obfuscating things. Thanks for reporting this!
This stacktrace looks like a binary mismatch between Compose artifacts:
That means our library was compiled against a different Compose version than what’s on the device at runtime (where DrawScope is an interface), or vice-versa (compiled expecting a class). There's something else in your dependencies graph pulling androidx.compose.*..
The only way to find out what's bringing the mismatched version, and which version of compose it's bringing, is by checking the gradle dependencies in your project. It's not the easiest to get from a Unity project, but basically you have to:
- Export the Android project. I believe Export project or build would work. You basically need the Android project in a folder of your computer
- Open that folder in Terminal and do
./gradlew :launcher:dependencies --configuration releaseRuntimeClasspath - This might fail if there's no Gradle wrapper in the project. I believe Unity doesn't include (at least it doesn't in my tests). In that case, you can open the project in Android Studio and execute the gradle task directly
gradle :launcher:dependencies --configuration releaseRuntimeClasspath. - This prints all Gradle dependencies in the bottom console.
If you can share the output of that, we'll probably be able to see where the problem is.
Thank you
@vegaro Thank you for your detailed instructions. I don't have time to do it now, but I'll do it as soon as possible.