rive-app / rive-android

A runtime for interactive animations on Android
https://rive.app
MIT License
332 stars 30 forks source link

Android Preview Layout : Render Problem produce no layout preview #275

Open amignotte opened 1 year ago

amignotte commented 1 year ago

Description

Is it normal that the preview layout in Android Studio crash with this error :

java.lang.UnsatisfiedLinkError: 'long app.rive.runtime.kotlin.renderers.RendererSkia.constructor(boolean)' at app.rive.runtime.kotlin.renderers.RendererSkia.constructor(Native Method) at app.rive.runtime.kotlin.renderers.RendererSkia.make(RendererSkia.kt:41) at app.rive.runtime.kotlin.RiveTextureView.onAttachedToWindow(RiveTextureView.kt:62) at app.rive.runtime.kotlin.RiveAnimationView.onAttachedToWindow(RiveAnimationView.kt:532) at android.view.View.dispatchAttachedToWindow(View.java:20753) at android.view.ViewGroup.dispatchAttachedToWindow(ViewGroup.java:3497) at android.view.ViewGroup.dispatchAttachedToWindow(ViewGroup.java:3497) at android.view.ViewGroup.dispatchAttachedToWindow(ViewGroup.java:3497) at android.view.ViewGroup.dispatchAttachedToWindow(ViewGroup.java:3497) at android.view.AttachInfo_Accessor.setAttachInfo(AttachInfo_Accessor.java:58) at com.android.layoutlib.bridge.impl.RenderSessionImpl.inflate(RenderSessionImpl.java:366) at com.android.layoutlib.bridge.Bridge.createSession(Bridge.java:436) at com.android.tools.idea.layoutlib.LayoutLibrary.createSession(LayoutLibrary.java:121) at com.android.tools.idea.rendering.RenderTask.createRenderSession(RenderTask.java:717) at com.android.tools.idea.rendering.RenderTask.lambda$inflate$9(RenderTask.java:873) at com.android.tools.idea.rendering.RenderExecutor$runAsyncActionWithTimeout$3.run(RenderExecutor.kt:192) at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128) at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628) at java.base/java.lang.Thread.run(Thread.java:829)

How can I resolve this problem ? Thanks

Screenshots

image

image

Versions

Android Studio Dolphin | 2021.3.1 Patch 1 Build #AI-213.7172.25.2113.9123335, built on September 30, 2022 Runtime version: 11.0.13+0-b1751.21-8125866 amd64 VM: OpenJDK 64-Bit Server VM by JetBrains s.r.o. Windows 10 10.0 GC: G1 Young Generation, G1 Old Generation Memory: 1280M Cores: 8 Registry: ide.intellij.laf.enable.animation=true external.system.auto.import.disabled=true ide.text.editor.with.preview.show.floating.toolbar=false ide.balloon.shadow.size=0

Non-Bundled Plugins: idea.plugin.protoeditor (213.6461.28) com.softbank.robot.sdkplugin (1.5.3) com.mallowigi.idea (16.0) com.mallowigi (54.1.0) com.thoughtworks.gauge (213.5744.125) com.developerphil.adbidea (1.6.8)

greymag commented 1 year ago

Hello.

If you are not going to make preview for an animation in the layout preview, than please add an edit mode check [isInEditMode()](https://developer.android.com/reference/android/view/View#isInEditMode()) and don't do anything in this mode. Because the current behaviour just breaks the whole screen/component in the preview and it's very inconvenient.