gpt4 book ai didi

android - Android 上的 Lottie 动画奇怪错误,适用于 iOS。路径无法自行循环

转载 作者:行者123 更新时间:2023-11-29 22:40:07 27 4
gpt4 key购买 nike

有人为我制作了这个 Lottie 动画:https://lottiefiles.com/share/DO3Kpo

它似乎在 iOS 上完美运行,但在 Android 上它抛出以下异常。我们尝试了很多,但我们无法弄清楚问题出在哪里。有人对此有任何想法吗?

Java.Lang.IllegalStateException: Unable to parse composition ---> Java.Lang.IllegalArgumentException: The Path cannot loop back on itself.
at java.lang.IllegalArgumentException: The Path cannot loop back on itself.
at at android.view.animation.PathInterpolator.initPath(PathInterpolator.java:185)
at at android.view.animation.PathInterpolator.initCubic(PathInterpolator.java:158)
at at android.view.animation.PathInterpolator.<init>(PathInterpolator.java:89)
at at android.support.v4.view.animation.PathInterpolatorCompat.create(PathInterpolatorCompat.java:82)
at at com.airbnb.lottie.parser.KeyframeParser.parseKeyframe(KeyframeParser.java:130)
at at com.airbnb.lottie.parser.KeyframeParser.parse(KeyframeParser.java:58)
at at com.airbnb.lottie.parser.PathKeyframeParser.parse(PathKeyframeParser.java:21)
at at com.airbnb.lottie.parser.AnimatablePathValueParser.parse(AnimatablePathValueParser.java:29)
at at com.airbnb.lottie.parser.AnimatablePathValueParser.parseSplitPath(AnimatablePathValueParser.java:55)
at at com.airbnb.lottie.parser.AnimatableTransformParser.parse(AnimatableTransformParser.java:54)
at at com.airbnb.lottie.parser.LayerParser.parse(LayerParser.java:99)
at at com.airbnb.lottie.parser.LottieCompositionParser.parseAssets(LottieCompositionParser.java:147)
at at com.airbnb.lottie.parser.LottieCompositionParser.parse(LottieCompositionParser.java:77)
at at com.airbnb.lottie.LottieCompositionFactory.fromJsonReaderSyncInternal(LottieCompositionFactory.java:248)
at at com.airbnb.lottie.LottieCompositionFactory.fromJsonReaderSync(LottieCompositionFactory.java:242)
at at com.airbnb.lottie.LottieCompositionFactory.fromJsonInputStreamSync(LottieCompositionFactory.java:177)
at at com.airbnb.lottie.LottieCompositionFactory.fromJsonInputStreamSync(LottieCompositionFactory.java:171)
at at com.airbnb.lottie.LottieCompositionFactory.fromAssetSync(LottieCompositionFactory.java:114)
at at com.airbnb.lottie.LottieCompositionFactory$2.call(LottieCompositionFactory.java:95)
at at com.airbnb.lottie.LottieCompositionFactory$2.call(LottieCompositionFactory.java:93)
at at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167)
at at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641)
at at java.lang.Thread.run(Thread.java:764)

最佳答案

我想你可以在 https://github.com/airbnb/lottie-android/issues 打开一个问题

分享 json 的链接,他们可能会调查这个问题。

我可以在这里复制它。它发生在 Android 上只是因为异常发生在 Android 类中:

// Note the class path: android.view.animation.PathInterpolator
at at android.view.animation.PathInterpolator.initPath(PathInterpolator.java:185)
at at android.view.animation.PathInterpolator.initCubic(PathInterpolator.java:158)
at at android.view.animation.PathInterpolator.<init>(PathInterpolator.java:89)
at at android.support.v4.view.animation.PathInterpolatorCompat.create(PathInterpolatorCompat.java:82)
at at com.airbnb.lottie.parser.KeyframeParser.parseKeyframe(KeyframeParser.java:130)

查看PathInterpolator源码:

float fraction = pointComponents[componentIndex++];
float x = pointComponents[componentIndex++];
float y = pointComponents[componentIndex++];
if (fraction == prevFraction && x != prevX) {
throw new IllegalArgumentException(
"The Path cannot have discontinuity in the X axis.");
}
if (x < prevX) {
// Exception is being triggered here due to x < prevX
throw new IllegalArgumentException("The Path cannot loop back on itself.");
}

PathInterpolator 正在被 Lottie 库调用。因此,他们可能会就此问题提供更好的反馈。

在那里试试:https://github.com/airbnb/lottie-android/issues

请注意,他们需要 AEP 文件。因此,与您的 friend 交谈以获取该文件:

Zip your After Effects AEP file and attach it. Your issue will be auto-closed if it doesn't have an AEP or no explicit reason otherwise is given.

关于android - Android 上的 Lottie 动画奇怪错误,适用于 iOS。路径无法自行循环,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/59095209/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com