diff --git a/uni_modules/uts-animation-view/utssdk/app-android/index.vue b/uni_modules/uts-animation-view/utssdk/app-android/index.vue index a298254b1fa8abde48f0a7edf7ed67dbf2d5f2cf..8a64c41b0962760287011ef8720d38dfe80e2d52 100644 --- a/uni_modules/uts-animation-view/utssdk/app-android/index.vue +++ b/uni_modules/uts-animation-view/utssdk/app-android/index.vue @@ -93,9 +93,13 @@ if (newPath.startsWith("http://") || newPath.startsWith("https://")) { lottieAnimationView.setAnimationFromUrl(newPath) } else { - // 默认是static了 - var realJsonPath = UTSAndroid.getResourcePath(newPath) - lottieAnimationView.setAnimation(new FileInputStream(realJsonPath),newPath) + // 正式打包会放在asset中,需要特殊处理 + let realJsonPath = UTSAndroid.getResourcePath(newPath) + if(realJsonPath.startsWith("/android_asset")){ + lottieAnimationView.setAnimation(realJsonPath!.substring(15)) + }else{ + lottieAnimationView.setAnimation(new FileInputStream(realJsonPath),newPath) + } } } if (this.autoplay) {