Skottie android app run crash

256 views
Skip to first unread message

wei liu

unread,
Nov 18, 2020, 1:53:32 AM11/18/20
to skia-discuss
Hi, skia. I want to run the skottie app in android, and here is my command to build skottie_android.so:

bin/gn gen out/arm64 --args='ndk="/home/lw/ndk/android-ndk-r21b" target_cpu="arm64" is_component_build=true skia_use_ffmpeg=false'

But there has no libskottie_android.so in out/arm64 directory, so I rename libskottie.so to libskottie_android.so, then copy lib*.so file to platform_tools/android/apps/skottie/skottielib/src/main/libs/. So build success, but run crash. Here is the error report:

2020-11-18 14:41:33.876 6740-6740/org.skia.skottie E/AndroidRuntime: Caused by: java.lang.UnsatisfiedLinkError: dlopen f
ailed: cannot locate symbol "_ZNK4sksg6MatrixI5SkM44E8asMatrixEv" referenced by "/data/app/org.skia.skottie-yENN5W9G6_CD
6Gsif7fj8w==/lib/arm64/libskottie_android.so"...
at java.lang.Runtime.loadLibrary0(Runtime.java:1071)
at java.lang.Runtime.loadLibrary0(Runtime.java:1007)
at java.lang.System.loadLibrary(System.java:1667)
at org.skia.skottie.SkottieRunner.<clinit>(SkottieRunner.java:57)
at org.skia.skottie.SkottieRunner.getInstance(Unknown Source:0)
at org.skia.skottie.SkottieView.setSourceHelper(SkottieView.java:114)
at org.skia.skottie.SkottieView.setSource(SkottieView.java:104)
at org.skia.skottie.SkottieView.<init>(SkottieView.java:69)
... 32 more

Is something wrong with the libskottie_android.so? Please help, thanks.

wei liu

unread,
Nov 19, 2020, 10:02:26 PM11/19/20
to skia-discuss
Is anyone help?

Florin Malita

unread,
Nov 20, 2020, 9:03:16 AM11/20/20
to skia-d...@googlegroups.com
Skottie does not work in component (shared lib) builds.  Try is_component_build=false.

--
You received this message because you are subscribed to the Google Groups "skia-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to skia-discuss...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/skia-discuss/19bf8e55-f42e-4ceb-bb36-696debc9b500n%40googlegroups.com.

wei liu

unread,
Nov 20, 2020, 11:32:19 PM11/20/20
to skia-discuss
But set   is_component_build=false will not generate  dynamic link library, and the  platform_tools/android/apps/skottie source code will load libskottie_android.so

Igor Zinovev

unread,
Nov 23, 2020, 5:05:50 PM11/23/20
to skia-discuss
Hey, Florin 

I'm struggle with same thing. I was able to build and run the viewer app, but get the runtime crash for scottie example. 

Unlike for folks above, for me it seems library was loaded properly and crash was after doFrame -> drawFrame sequence, somewhere inside of skia code as far as I can tell. The last known stack call was SkottieAnimation_nDrawFrame and crash happening on top of 10+ frames call at libskottie_android. 

Any ideas how can I triage it? Mb some way attach skia symbols with crash dump?

Skia was builded with args

BUILD_ARGS+=" is_debug=true"
BUILD_ARGS+=" skia_enable_gpu=true"
BUILD_ARGS+=" ndk=\"/Users/zigi/Library/Android/sdk/ndk/21.3.6528147\""
BUILD_ARGS+=" target_cpu=\"arm\""
BUILD_ARGS+= " is_component_build=false"
BUILD_ARGS+=" skia_enable_skottie=true"

Igor Zinovev

unread,
Nov 24, 2020, 11:21:32 AM11/24/20
to skia-discuss
I was able to get tombstone and retrieve crash stack but I don't have any ideas what was wrong while rendering 

Igor Zinovev

unread,
Aug 5, 2021, 2:51:38 PM8/5/21
to skia-discuss
I get back to this topic with latest skia version, still no success, but the error is different. Now I have a crash on JNI library loading

E/AndroidRuntime: Caused by: java.lang.UnsatisfiedLinkError: dlopen failed: cannot locate symbol "_ZN6sk_app6Window5invalEv" referenced by "/data/app/~~hpvc3nZM6aWs-M1KrITcxw==/org.skia.skottie-Ik3_VY1fV01MGiTycLQuWQ==/lib/arm/libskottie_android.so"...
        at java.lang.Runtime.loadLibrary0(Runtime.java:1087)
        at java.lang.Runtime.loadLibrary0(Runtime.java:1008)
        at java.lang.System.loadLibrary(System.java:1664)
        at org.skia.skottie.SkottieRunner.<clinit>(SkottieRunner.java:49)
        at org.skia.skottie.SkottieRunner.getInstance(Unknown Source:0)
        at org.skia.skottie.SkottieView.setSourceHelper(SkottieView.java:149)
        at org.skia.skottie.SkottieView.setSource(SkottieView.java:128)
        at org.skia.skottie.SkottieView.<init>(SkottieView.java:107)
        at org.skia.skottie.SkottieView.<init>(SkottieView.java:67)

Skia was builded like this: "bin/gn gen out/arm64 --args='is_debug=true is_official_build=false is_component_build=false ndk="/Users/zigi/Library/Android/sdk/ndk/22.1.7171670" target_cpu="arm64"'

I will appreciate any tips.

Also need to say Android kit demo runs fine for me and I can see skottie animations on screen

Jorge Betancourt

unread,
Aug 9, 2021, 9:44:53 AM8/9/21
to skia-discuss
If you can get the AndroidKit demo to run, you might have better luck using AndroidKit's SkottieView util (change org.skia.skottie.SkottieView to org.skia.AndroidKit.util.SkottieView). We simplified the SkottieView code and it should be easier to debug on your device.

Florin Malita

unread,
Aug 9, 2021, 11:25:31 AM8/9/21
to skia-d...@googlegroups.com
On Mon, Aug 9, 2021 at 9:44 AM 'Jorge Betancourt' via skia-discuss <skia-d...@googlegroups.com> wrote:
If you can get the AndroidKit demo to run, you might have better luck using AndroidKit's SkottieView util (change org.skia.skottie.SkottieView to org.skia.AndroidKit.util.SkottieView). We simplified the SkottieView code and it should be easier to debug on your device.

Agreed, libskottie_android is bit-rotty at this point, if possible try to use AndroidKit.


On Thursday, August 5, 2021 at 2:51:38 PM UTC-4 Igor Zinovev wrote:
I get back to this topic with latest skia version, still no success, but the error is different. Now I have a crash on JNI library loading

E/AndroidRuntime: Caused by: java.lang.UnsatisfiedLinkError: dlopen failed: cannot locate symbol "_ZN6sk_app6Window5invalEv" referenced by "/data/app/~~hpvc3nZM6aWs-M1KrITcxw==/org.skia.skottie-Ik3_VY1fV01MGiTycLQuWQ==/lib/arm/libskottie_android.so"...
        at java.lang.Runtime.loadLibrary0(Runtime.java:1087)
        at java.lang.Runtime.loadLibrary0(Runtime.java:1008)
        at java.lang.System.loadLibrary(System.java:1664)
        at org.skia.skottie.SkottieRunner.<clinit>(SkottieRunner.java:49)
        at org.skia.skottie.SkottieRunner.getInstance(Unknown Source:0)
        at org.skia.skottie.SkottieView.setSourceHelper(SkottieView.java:149)
        at org.skia.skottie.SkottieView.setSource(SkottieView.java:128)
        at org.skia.skottie.SkottieView.<init>(SkottieView.java:107)
        at org.skia.skottie.SkottieView.<init>(SkottieView.java:67)

Skia was builded like this: "bin/gn gen out/arm64 --args='is_debug=true is_official_build=false is_component_build=false ndk="/Users/zigi/Library/Android/sdk/ndk/22.1.7171670" target_cpu="arm64"'

I will appreciate any tips.

This fixed it for me (emulator tested):

  1. --- a/BUILD.gn
    +++ b/BUILD.gn
    @@ -2454,7 +2454,6 @@ if (skia_enable_tools) {
           deps = [
             ":skia",
             "modules/skottie",
    -        "modules/sksg:samples",
           ]
         }


  2. gn clean out/arm64
  3. rebuild
Let us know if that works for you too. 


Reply all
Reply to author
Forward
0 new messages