人生不设限
人生不设限
  • 发布:2024-03-01 09:16
  • 更新:2024-03-04 10:31
  • 阅读:399

【报Bug】代码中使用 'uni.previewImage'预览图片,导致应用崩溃

分类:uni-app

产品分类: uniapp/App

PC开发环境操作系统: Windows

PC开发环境操作系统版本号: win10

HBuilderX类型: 正式

HBuilderX版本号: 3.99

手机系统: Android

手机系统版本号: Android 9.0

手机厂商: 商米

手机机型: 平板

页面类型: vue

vue版本: vue3

打包方式: 离线

项目创建方式: HBuilderX

示例代码:
uni.previewImage({  
            current: index,  
            urls: item.checkPic  
          })

操作步骤:
uni.previewImage({  
            current: index,  
            urls: item.checkPic  
          })

checkPic为一个包含本地地址路径的数组,例如:['/storage/emulated/0/SampleVideo/video/a.jpg']

预期结果:

正常预览图片

实际结果:

调用预览方法报错并导致应用崩溃,错误提示如下:
···
2024-02-29 19:02:06.569 22600-22600/com.bear.kcyszd E/AndroidRuntime: FATAL EXCEPTION: main
Process: com.bear.kcyszd, PID: 22600
java.lang.NoSuchMethodError: No virtual method download(Ljava/lang/Object;)Lcom/bumptech/glide/RequestBuilder; in class Lcom/bumptech/glide/RequestManager; or its super classes (declaration of 'com.bumptech.glide.RequestManager' appears in /data/app/com.bear.kcyszd-ieEud-O5RBtzK40mSqakjQ==/base.apk)
at io.dcloud.feature.nativeObj.photoview.PhotoActivity$2.displayImage(Unknown Source:22)
at io.dcloud.feature.nativeObj.BannerLayout$LoopPagerAdapter.instantiateItem(Unknown Source:11)
at androidx.viewpager.widget.ViewPager.addNewItem(ViewPager.java:1010)
at androidx.viewpager.widget.ViewPager.populate(ViewPager.java:1158)
at androidx.viewpager.widget.ViewPager.populate(ViewPager.java:1092)
at androidx.viewpager.widget.ViewPager.onMeasure(ViewPager.java:1622)
at android.view.View.measure(View.java:23182)
at android.widget.RelativeLayout.measureChildHorizontal(RelativeLayout.java:715)
at android.widget.RelativeLayout.onMeasure(RelativeLayout.java:461)
at android.view.View.measure(View.java:23182)
at android.widget.RelativeLayout.measureChildHorizontal(RelativeLayout.java:715)
at android.widget.RelativeLayout.onMeasure(RelativeLayout.java:461)
at android.view.View.measure(View.java:23182)
at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:6749)
at android.widget.FrameLayout.onMeasure(FrameLayout.java:185)
at android.view.View.measure(View.java:23182)
at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:6749)
at android.widget.LinearLayout.measureChildBeforeLayout(LinearLayout.java:1535)
at android.widget.LinearLayout.measureVertical(LinearLayout.java:825)
at android.widget.LinearLayout.onMeasure(LinearLayout.java:704)
at android.view.View.measure(View.java:23182)

···

bug描述:

代码中使用 'uni.previewImage'预览图片,导致应用崩溃。
该应用使用离线打包,sdk版本3.99,调用预览方法报错并导致应用崩溃,错误提示如下:

2024-03-01 09:16 负责人:无 分享
已邀请:
人生不设限

人生不设限 (作者)

已解决,是一个包引入版本问题

要回复问题请先登录注册