最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

java - Why is the animated vector drawable crashing my app? - Stack Overflow

programmeradmin4浏览0评论

So I'm using a custom-created animated vector drawable in Android Studio for the splash screen (animate at the beginning) since, in Android 12+, the system default splash screen entry doesn't allow customization, but it's crashing the app (staying for 1 second, not even animating, and crashing the app by then) plus Logcat logs are not stopping.

Here's my drawable: res/animator/rotate_star.xml

<objectAnimator xmlns:android=";
    android:duration="1000"
    android:propertyName="rotation"
    android:valueFrom="0"
    android:valueTo="360"
    android:repeatCount="infinite"
    android:interpolator="@android:interpolator/linear"/>

res/drawable/avd_star.xml

<animated-vector 
    xmlns:android=";
    android:drawable="@drawable/ic_star">
    <target
        android:name="star"
        android:animation="@animator/rotate_star"/>
</animated-vector>

res/drawable/ic_star.xml

<vector xmlns:android=";
    android:width="24dp"
    android:height="24dp"
    android:viewportWidth="24"
    android:viewportHeight="24">
    <path
        android:name="star"
        android:fillColor="#FF0000"
        android:pathData="M12,2 L15,8 L22,9 L17,14 L18,21 L12,18 L6,21 L7,14 L2,9 L9,8 Z"/>
</vector>

MainActivity.java

protected void onCreate(Bundle savedInstanceState) {
    // Show the system splash screen
    FirebaseApp.initializeApp(this);
    super.onCreate(savedInstanceState);
    hideSystemBars();
    setContentView(R.layout.activity_main);

    ImageView starImageView = findViewById(R.id.starImageView);
    AnimatedVectorDrawableCompat avd = AnimatedVectorDrawableCompat.create(this, R.drawable.avd_star);

    if (avd != null) {
        starImageView.setImageDrawable(avd);
        avd.start();
    }
    askNotificationPermission();
    fetchFCMToken();
}

Stack trace on Logcat:

[FatalError:fetchResourceAsync] request reuse failed, url:
could not get any valid access key from remote settings
[FatalError:fetchResourceAsync] request reuse failed, url:
could not get any valid access key from remote settings
could not get any valid access key from remote settings
fetchAsync error:30: memoryError:cannot find cached buffer,
[FatalError:fetchResourceAsync] request reuse failed, url:
could not get any valid access key from remote settings
fetchAsync error:30: memoryError:cannot find cached buffer,
[KeyInfo:fetchAsync] msg = offline resource exist:true extraRuntimeInfo = {gecko_config_from=client_config, gecko_channel=mt_dm_streak_milestone_small_resource, wait_low_storage_update=false, check_gecko_file_available=true, gecko_access_key=365b20e8f6c343df1eff65214a0e3e74, disable_gecko_update=false, gecko_sync_update=false, gecko_bundle=200/dark/social_dm_streakupgrade_fire5_dark.json}
[KeyInfo:fetchAsync] msg = offline resource exist:true extraRuntimeInfo = {gecko_config_from=client_config, gecko_channel=mt_dm_streak_milestone_big_resource_1, wait_low_storage_update=false, check_gecko_file_available=true, gecko_access_key=365b20e8f6c343df1eff65214a0e3e74, disable_gecko_update=false, gecko_sync_update=false, gecko_bundle=dm_streak_lv4_animation_264_v1/config.json}
[KeyInfo:fetchAsync] msg = offline resource exist:true extraRuntimeInfo = {gecko_config_from=client_config, gecko_channel=tiktok_im_streak_pet, wait_low_storage_update=false, check_gecko_file_available=true, gecko_access_key=365b20e8f6c343df1eff65214a0e3e74, disable_gecko_update=false, gecko_sync_update=false, gecko_bundle=/pet/template.js}
onCheckServerVersionSuccess:requestMap:null responseMap:null
download failed with waitGeckoUpdate=false ,channel = mt_dm_streak_milestone_big_resource_1,bundle = dm_streak_lv4_animation_264_v1/config.json
java.lang.Throwable: invalid channel
    at X.VFG.LJ(SourceFile:33554556)
    at X.9HI.LIZ(SourceFile:16777732)
    at X.9HI.run(SourceFile:9)
    at Y.AObjectS242S0100000_3.invoke$4(SourceFile:16777222)
    at Y.AObjectS242S0100000_3.invoke(Unknown Source:12)
    at kotlin.jvm.internal.ApS311S0100000_3.invoke$114(SourceFile:16777224)
    at kotlin.jvm.internal.ApS311S0100000_3.invoke(Unknown Source:57)
    at X.9Lu.LIZ(SourceFile:50331894)
    at X.9BW.LJ(SourceFile:88)
    at X.9BW.run(SourceFile:0)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:644)
    at Y.ARunnableS32S0200000_3.run$13(SourceFile:16777229)
    at Y.ARunnableS32S0200000_3.run(Unknown Source:198)
    at java.lang.Thread.run(Thread.java:1012)
onLocalNewestVersion:localPackage:com.bytedance.geckox.model.LocalPackageModel@8beb59b
onCheckServerVersionSuccess:requestMap:null responseMap:null
download failed with waitGeckoUpdate=false ,channel = mt_dm_streak_milestone_small_resource,bundle = 200/dark/social_dm_streakupgrade_fire5_dark.json
java.lang.Throwable: invalid channel
    at X.VFG.LJ(SourceFile:33554556)
    at X.9HI.LIZ(SourceFile:16777732)
    at X.9HI.run(SourceFile:9)
    at Y.AObjectS242S0100000_3.invoke$4(SourceFile:16777222)
    at Y.AObjectS242S0100000_3.invoke(Unknown Source:12)
    at kotlin.jvm.internal.ApS311S0100000_3.invoke$114(SourceFile:16777224)
    at kotlin.jvm.internal.ApS311S0100000_3.invoke(Unknown Source:57)
    at X.9Lu.LIZ(SourceFile:50331894)
    at X.9BW.LJ(SourceFile:88)
    at X.9BW.run(SourceFile:0)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:644)
    at Y.ARunnableS32S0200000_3.run$13(SourceFile:16777229)
    at Y.ARunnableS32S0200000_3.run(Unknown Source:198)
    at java.lang.Thread.run(Thread.java:1012)
[FatalError:fetchResourceAsync] request reuse failed, url:
could not get any valid access key from remote settings
onLocalNewestVersion:localPackage:com.bytedance.geckox.model.LocalPackageModel@5896d4d
fetchAsync error:30: memoryError:cannot find cached buffer,
onCheckServerVersionSuccess:requestMap:null responseMap:null
download failed with waitGeckoUpdate=false ,channel = tiktok_im_streak_pet,bundle = /pet/template.js
java.lang.Throwable: invalid channel
    at X.VFG.LJ(SourceFile:33554556)
    at X.9HI.LIZ(SourceFile:16777732)
    at X.9HI.run(SourceFile:9)
    at Y.AObjectS242S0100000_3.invoke$4(SourceFile:16777222)
    at Y.AObjectS242S0100000_3.invoke(Unknown Source:12)
    at kotlin.jvm.internal.ApS311S0100000_3.invoke$114(SourceFile:16777224)
    at kotlin.jvm.internal.ApS311S0100000_3.invoke(Unknown Source:57)
    at X.9Lu.LIZ(SourceFile:50331894)
    at X.9BW.LJ(SourceFile:88)
    at X.9BW.run(SourceFile:0)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:644)
    at Y.ARunnableS32S0200000_3.run$13(SourceFile:16777229)
    at Y.ARunnableS32S0200000_3.run(Unknown Source:198)
    at java.lang.Thread.run(Thread.java:1012)
onLocalNewestVersion:localPackage:com.bytedance.geckox.model.LocalPackageModel@c0bfb50
[KeyInfo:fetchAsync] msg = offline resource exist:true extraRuntimeInfo = {gecko_config_from=client_config, gecko_channel=mt_dm_streak_common_resource, wait_low_storage_update=false, check_gecko_file_available=true, gecko_access_key=365b20e8f6c343df1eff65214a0e3e74, disable_gecko_update=false, gecko_sync_update=false, gecko_bundle=/dm_friends_restore/social_dm_friends_restore_light.json}
[KeyInfo:fetchAsync] msg = offline resource exist:true extraRuntimeInfo = {gecko_config_from=client_config, gecko_channel=tiktok_im_streak_pet, wait_low_storage_update=false, check_gecko_file_available=true, gecko_access_key=365b20e8f6c343df1eff65214a0e3e74, disable_gecko_update=false, gecko_sync_update=false, gecko_bundle=/widget/template.js}
[FatalError:fetchResourceAsync] request reuse failed, url:
could not get any valid access key from remote settings
[FatalError:fetchResourceAsync] request reuse failed, url:
could not get any valid access key from remote settings
fetchAsync error:30: memoryError:cannot find cached buffer,
[KeyInfo:fetchAsync] msg = offline resource exist:true extraRuntimeInfo = {gecko_config_from=client_config, gecko_channel=mt_dm_streak_milestone_big_resource_2, wait_low_storage_update=false, check_gecko_file_available=true, gecko_access_key=365b20e8f6c343df1eff65214a0e3e74, disable_gecko_update=false, gecko_sync_update=false, gecko_bundle=dm_streak_lv6_animation_264_v1/config.json}
[FatalError:fetchResourceAsync] request reuse failed, url:
could not get any valid access key from remote settings
fetchAsync error:30: memoryError:cannot find cached buffer,
onCheckServerVersionSuccess:requestMap:null responseMap:null
download failed with waitGeckoUpdate=false ,channel = tiktok_im_streak_pet,bundle = /widget/template.js
java.lang.Throwable: invalid channel
    at X.VFG.LJ(SourceFile:33554556)
    at X.9HI.LIZ(SourceFile:16777732)
    at X.9HI.run(SourceFile:9)
    at Y.AObjectS242S0100000_3.invoke$4(SourceFile:16777222)
    at Y.AObjectS242S0100000_3.invoke(Unknown Source:12)
    at kotlin.jvm.internal.ApS311S0100000_3.invoke$114(SourceFile:16777224)
    at kotlin.jvm.internal.ApS311S0100000_3.invoke(Unknown Source:57)
    at X.9Lu.LIZ(SourceFile:50331894)
    at X.9BW.LJ(SourceFile:88)
    at X.9BW.run(SourceFile:0)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:644)
    at Y.ARunnableS32S0200000_3.run$13(SourceFile:16777229)
    at Y.ARunnableS32S0200000_3.run(Unknown Source:198)
    at java.lang.Thread.run(Thread.java:1012)
[KeyInfo:fetchAsync] msg = offline resource exist:true extraRuntimeInfo = {gecko_config_from=client_config, gecko_channel=tiktok_im_message_card_lynx, wait_low_storage_update=false, check_gecko_file_available=true, gecko_access_key=365b20e8f6c343df1eff65214a0e3e74, disable_gecko_update=false, gecko_sync_update=false, gecko_bundle=/pages/streak_pet_invitation/template.js}
onLocalNewestVersion:localPackage:com.bytedance.geckox.model.LocalPackageModel@44e2d75
onCheckServerVersionSuccess:requestMap:null responseMap:null
download failed with waitGeckoUpdate=false ,channel = mt_dm_streak_common_resource,bundle = /dm_friends_restore/social_dm_friends_restore_Light.json
java.lang.Throwable: invalid channel
    at X.VFG.LJ(SourceFile:33554556)
    at X.9HI.LIZ(SourceFile:16777732)
    at X.9HI.run(SourceFile:9)
    at Y.AObjectS242S0100000_3.invoke$4(SourceFile:16777222)
    at Y.AObjectS242S0100000_3.invoke(Unknown Source:12)
    at kotlin.jvm.internal.ApS311S0100000_3.invoke$114(SourceFile:16777224)
    at kotlin.jvm.internal.ApS311S0100000_3.invoke(Unknown Source:57)
    at X.9Lu.LIZ(SourceFile:50331894)
    at X.9BW.LJ(SourceFile:88)
    at X.9BW.run(SourceFile:0)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:644)
    at Y.ARunnableS32S0200000_3.run$13(SourceFile:16777229)
    at Y.ARunnableS32S0200000_3.run(Unknown Source:198)
    at java.lang.Thread.run(Thread.java:1012)
[KeyInfo:fetchAsync] msg =
onLocalNewestVersion:localPackage:com.bytedance.geckox.model.LocalPackageModel@d4f1d7b
onCheckServerVersionSuccess:requestMap:null responseMap:null
download failed with waitGeckoUpdate=false ,channel = mt_dm_streak_milestone_big_resource_2,bundle = dm_streak_lv6_animation_264_v1/config.json
java.lang.Throwable: invalid channel
    at X.VFG.LJ(SourceFile:33554556)
    at X.9HI.LIZ(SourceFile:16777732)
    at X.9HI.run(SourceFile:9)
    at Y.AObjectS242S0100000_3.invoke$4(SourceFile:16777222)
    at Y.AObjectS242S0100000_3.invoke(Unknown Source:12)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:644)
    at Y.ARunnableS32S0200000_3.run$13(SourceFile:16777229)
    at Y.ARunnableS32S0200000_3.run(Unknown Source:198)
    at java.lang.Thread.run(Thread.java:1012)
onLocalNewestVersion:localPackage:com.bytedance.geckox.model.LocalPackageModel@2d9794f
onCheckServerVersionSuccess:requestMap:null responseMap:null
download failed with waitGeckoUpdate=false ,channel = mt_dm_streak_common_resource,bundle = /dm_friends_restore/social_dm_friends_restore_Dark.json
java.lang.Throwable: invalid channel
    at X.VFG.LJ(SourceFile:33554556)
    at X.9HI.LIZ(SourceFile:16777732)
    at X.9HI.run(SourceFile:9)
    at Y.AObjectS242S0100000_3.invoke$4(SourceFile:16777222)
    at Y.AObjectS242S0100000_3.invoke(Unknown Source:12)
    at kotlin.jvm.internal.ApS311S0100000_3.invoke$114(SourceFile:16777224)
    at kotlin.jvm.internal.ApS311S0100000_3.invoke(Unknown Source:57)
    at X.9Lu.LIZ(SourceFile:50331894)
    at X.9BW.LJ(SourceFile:88)
    at X.9BW.run(SourceFile:0)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:644)
    at Y.ARunnableS32S0200000_3.run$13(SourceFile:16777229)
    at Y.ARunnableS32S0200000_3.run(Unknown Source:198)
    at java.lang.Thread.run(Thread.java:1012)
onLocalNewestVersion:localPackage:com.bytedance.geckox.model.LocalPackageModel@4065de5
发布评论

评论列表(0)

  1. 暂无评论