// 实际上还没执行到success就已经崩溃了。
uni.scanCode({
scanType: ['qrcode'],
success: (res) => {
const { result } = res;
console.log('result=', result);
},
});
- 发布:2021-09-16 21:12
- 更新:2021-09-17 11:09
- 阅读:779
产品分类: uniapp/App
PC开发环境操作系统: Windows
PC开发环境操作系统版本号: win10
HBuilderX类型: 正式
HBuilderX版本号: 3.2.3
手机系统: Android
手机系统版本号: Android 10
手机厂商: 华为
手机机型: 荣耀v10
页面类型: vue
打包方式: 离线
项目创建方式: HBuilderX
示例代码:
操作步骤:
离线打包,使用扫描二维码功能(uni.scanCode),打开摄像头之后,点击右上角的相册。
离线打包,使用扫描二维码功能(uni.scanCode),打开摄像头之后,点击右上角的相册。
预期结果:
在相册界面等待一会,不会崩溃。
在相册界面等待一会,不会崩溃。
实际结果:
在相册界面等待一会,崩溃了。
在相册界面等待一会,崩溃了。
bug描述:
离线打包,819版本离线sdk。
android包。
其他功能正常,但是扫描二维码功能,uni.scanCode功能打开摄像头之后,点击相册,在相册界面等待一会(3-5秒)崩溃。
云端打包一切正常。
离线打包文档,能否加上二维码相关内容?没有任何相关资料。
z***@163.com (作者)
您好:
我的SDK:Android-SDK@3.2.2.80995_20210819-1
项目是cli的,版本
2.0.0-32220210818001
2.0.0-32220210818002
都试过,不行。。。
按理说,这个sdk版本和cli的版本是同一时间的,应该没问题才对。
您帮忙看一下配置还需要配置什么?因为这个文档里面,好像是没有提离线打包需要注意什么。https://uniapp.dcloud.io/api/system/barcode?id=scancode
权限的话,相关的我配置了这些,应该够了吧?
<uses-permission android:name="android.permission.CAMERA" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-feature android:name="android.hardware.camera" />
<uses-feature android:name="android.hardware.camera.autofocus" />
<uses-permission android:name="android.permission.VIBRATE" />
<uses-permission android:name="android.permission.FLASHLIGHT" />
我一会试一下demo
z***@163.com (作者)
您好:
我的SDK:Android-SDK@3.2.2.80995_20210819-1
项目是cli的,版本
2.0.0-32220210818001
2.0.0-32220210818002
都试过,不行。。。
按理说,这个sdk版本和cli的版本是同一时间的,应该没问题才对。
您帮忙看一下配置还需要配置什么?因为这个文档里面,好像是没有提离线打包需要注意什么。https://uniapp.dcloud.io/api/system/barcode?id=scancode
权限的话,相关的我配置了这些,应该够了吧?
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-feature android:name="android.hardware.camera" />
<uses-feature android:name="android.hardware.camera.autofocus" />
<uses-permission android:name="android.permission.VIBRATE" />
<uses-permission android:name="android.permission.FLASHLIGHT" />
我一会试一下demo
2021-09-17 15:18
DCloud_Android_ST
回复 z***@163.com: 跟这些没关系 如果你懂原生可以看下崩溃日志
2021-09-17 16:02
z***@163.com (作者)
回复 DCloud_Android_ST:
2021-09-18 10:55:49.017 26438-26438/com.zkhl.nursecall D/CaptureActivityHandler: CODE_DECODE_FAILED
2021-09-18 10:55:49.085 26438-26438/com.zkhl.nursecall D/CaptureActivityHandler: CODE_DECODE_FAILED
2021-09-18 10:55:49.116 26438-26454/com.zkhl.nursecall I/.zkhl.nursecal: Background concurrent copying GC freed 349(68KB) AllocSpace objects, 42(21MB) LOS objects, 49% free, 20MB/41MB, paused 255us total 143.131ms
2021-09-18 10:55:49.151 26438-26438/com.zkhl.nursecall D/CaptureActivityHandler: CODE_DECODE_FAILED
2021-09-18 10:55:49.220 26438-26438/com.zkhl.nursecall D/CaptureActivityHandler: CODE_DECODE_FAILED
2021-09-18 10:55:49.288 26438-26438/com.zkhl.nursecall D/CaptureActivityHandler: CODE_DECODE_FAILED
2021-09-18 10:55:49.355 26438-26438/com.zkhl.nursecall D/CaptureActivityHandler: CODE_DECODE_FAILED
2021-09-18 10:55:49.442 26438-26438/com.zkhl.nursecall D/CaptureActivityHandler: Got auto-focus message
2021-09-18 10:55:49.459 26438-26438/com.zkhl.nursecall D/CaptureActivityHandler: CODE_DECODE_FAILED
2021-09-18 10:55:49.496 26438-26438/com.zkhl.nursecall D/CaptureActivityHandler: CODE_DECODE_FAILED
2021-09-18 10:55:49.514 26438-26438/com.zkhl.nursecall V/AudioManager: querySoundEffectsEnabled...
2021-09-18 10:55:49.618 26438-26438/com.zkhl.nursecall D/CaptureActivityHandler: CODE_DECODE_FAILED
2021-09-18 10:55:49.762 26438-26438/com.zkhl.nursecall W/.zkhl.nursecal: Accessing hidden method Landroid/os/ServiceManager;->getService(Ljava/lang/String;)Landroid/os/IBinder; (greylist, reflection, allowed)
2021-09-18 10:55:49.763 26438-26438/com.zkhl.nursecall V/FlashlightManager: This device does supports control of a flashlight
2021-09-18 10:55:49.764 26438-26438/com.zkhl.nursecall I/Camera: close camera: 0, package name: com.zkhl.nursecall
2021-09-18 10:55:49.766 26438-26438/com.zkhl.nursecall I/HwCameraUtil: notifySurfaceFlingerCameraStatus : isFront = false , isOpend = false
2021-09-18 10:55:49.886 26438-26438/com.zkhl.nursecall W/ActivityThread: handleWindowVisibility: no activity for token android.os.BinderProxy@e623c58
2021-09-18 10:55:49.898 26438-26438/com.zkhl.nursecall V/ActivityThread: callActivityOnCreate
2021-09-18 10:55:49.964 26438-26438/com.zkhl.nursecall D/ActivityThread: add activity client record, r= ActivityRecord{35b60cf token=android.os.BinderProxy@e623c58 {com.zkhl.nursecall/com.dmcbig.mediapicker.PickerActivity}} token= android.os.BinderProxy@e623c58
2021-09-18 10:55:50.013 26438-27262/com.zkhl.nursecall D/HiTouch_PressGestureDetector: onAttached, package=com.zkhl.nursecall, windowType=1, mHiTouchRestricted=false
2021-09-18 10:55:50.028 26438-26577/com.zkhl.nursecall D/mali_winsys: EGLint new_window_surface(egl_winsys_display , void , EGLSurface, EGLConfig, egl_winsys_surface **, EGLBoolean) returns 0x3000
2021-09-18 10:55:50.060 26438-26438/com.zkhl.nursecall I/HwViewRootImpl: removeInvalidNode jank list is null
2021-09-18 10:55:50.092 26438-26577/com.zkhl.nursecall D/OpenGLRenderer: disableOutlineDraw is true
2021-09-18 10:55:50.114 26438-26438/com.zkhl.nursecall W/Glide: Failed to find GeneratedAppGlideModule. You should include an annotationProcessor compile dependency on com.github.bumptech.glide:compiler in your application and a @GlideModule annotated AppGlideModule implementation or LibraryGlideModules will be silently ignored
2021-09-18 10:55:50.309 26438-27267/com.zkhl.nursecall W/ExifInterface: Invalid image: ExifInterface got an unsupported image format file(ExifInterface supports JPEG and some RAW image formats only) or a corrupted JPEG file to ExifInterface.
java.io.IOException: Invalid byte order: ffff8950
at android.media.ExifInterface.readByteOrder(ExifInterface.java:3198)
at android.media.ExifInterface.isOrfFormat(ExifInterface.java:2507)
at android.media.ExifInterface.getMimeType(ExifInterface.java:2385)
at android.media.ExifInterface.loadAttributes(ExifInterface.java:1803)
at android.media.ExifInterface.<init>(ExifInterface.java:1478)
at com.bumptech.glide.load.resource.bitmap.ExifInterfaceImageHeaderParser.getOrientation(ExifInterfaceImageHeaderParser.java:40)
at com.bumptech.glide.load.ImageHeaderParserUtils.getOrientation(ImageHeaderParserUtils.java:91)
at com.bumptech.glide.load.resource.bitmap.Downsampler.decodeFromWrappedStreams(Downsampler.java:236)
at com.bumptech.glide.load.resource.bitmap.Downsampler.decode(Downsampler.java:206)
at com.bumptech.glide.load.resource.bitmap.Downsampler.decode(Downsampler.java:162)
at com.bumptech.glide.load.resource.bitmap.ByteBufferBitmapDecoder.decode(ByteBufferBitmapDecoder.java:33)
at com.bumptech.glide.load.resource.bitmap.ByteBufferBitmapDecoder.decode(ByteBufferBitmapDecoder.java:16)
at com.bumptech.glide.load.engine.DecodePath.decodeResourceWithList(DecodePath.java:72)
at com.bumptech.glide.load.engine.DecodePath.decodeResource(DecodePath.java:55)
at com.bumptech.glide.load.engine.DecodePath.decode(DecodePath.java:45)
at com.bumptech.glide.load.engine.LoadPath.loadWithExceptionList(LoadPath.java:58)
at com.bumptech.glide.load.engine.LoadPath.load(LoadPath.java:43)
at com.bumptech.glide.load.engine.DecodeJob.runLoadPath(DecodeJob.java:515)
at com.bumptech.glide.load.engine.DecodeJob.decodeFromFetcher(DecodeJob.java:480)
at com.bumptech.glide.load.engine.DecodeJob.decodeFromData(DecodeJob.java:466)
at com.bumptech.glide.load.engine.DecodeJob.decodeFromRetrievedData(DecodeJob.java:418)
at com.bumptech.glide.load.engine.DecodeJob.onDataFetcherReady(DecodeJob.java:387)
at com.bumptech.glide.load.engine.ResourceCacheGenerator.onDataReady(ResourceCacheGenerator.java:120)
at com.bumptech.glide.load.model.ByteBufferFileLoader$ByteBufferFetcher.loadData(ByteBufferFileLoader.java:74)
at com.bumptech.glide.load.engine.ResourceCacheGenerator.startNext(ResourceCacheGenerator.java:99)
at com.bumptech.glide.load.engine.DecodeJob.runGenerators(DecodeJob.java:309)
at com.bumptech.glide.load.engine.DecodeJob.runWrapped(DecodeJob.java:276)
at com.bumptech.glide.load.engine.DecodeJob.run(DecodeJob.java:235)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641)
at java.lang.Thread.run(Thread.java:929)
at com.bumptech.glide.load.engine.executor.GlideExecutor$DefaultThreadFactory$1.run(GlideExecutor.java:446)
2021-09-18 10:55:50.319 26438-27267/com.zkhl.nursecall W/ExifInterface: Invalid image: ExifInterface got an unsupported image format file(ExifInterface supports JPEG and some RAW image formats only) or a corrupted JPEG file to ExifInterface.
java.io.IOException: Invalid byte order: ffff8950
at android.media.ExifInterface.readByteOrder(ExifInterface.java:3198)
at android.media.ExifInterface.isOrfFormat(ExifInterface.java:2507)
at android.media.ExifInterface.getMimeType(ExifInterface.java:2385)
at android.media.ExifInterface.loadAttributes(ExifInterface.java:1803)
at android.media.ExifInterface.<init>(ExifInterface.java:1478)
at com.bumptech.glide.load.resource.bitmap.ExifInterfaceImageHeaderParser.getOrientation(ExifInterfaceImageHeaderParser.java:40)
at com.bumptech.glide.load.ImageHeaderParserUtils.getOrientation(ImageHeaderParserUtils.java:91)
at com.bumptech.glide.load.resource.bitmap.Downsampler.decodeFromWrappedStreams(Downsampler.java:236)
at com.bumptech.glide.load.resource.bitmap.Downsampler.decode(Downsampler.java:206)
at com.bumptech.glide.load.resource.bitmap.Downsampler.decode(Downsampler.java:162)
at com.bumptech.glide.load.resource.bitmap.ByteBufferBitmapDecoder.decode(ByteBufferBitmapDecoder.java:33)
at com.bumptech.glide.load.resource.bitmap.ByteBufferBitmapDecoder.decode(ByteBufferBitmapDecoder.java:16)
at com.bumptech.glide.load.engine.DecodePath.decodeResourceWithList(DecodePath.java:72)
at com.bumptech.glide.load.engine.DecodePath.decodeResource(DecodePath.java:55)
at com.bumptech.glide.load.engine.DecodePath.decode(DecodePath.java:45)
at com.bumptech.glide.load.engine.LoadPath.loadWithExceptionList(LoadPath.java:58)
at com.bumptech.glide.load.engine.LoadPath.load(LoadPath.java:43)
at com.bumptech.glide.load.engine.DecodeJob.runLoadPath(DecodeJob.java:515)
at com.bumptech.glide.load.engine.DecodeJob.decodeFromFetcher(DecodeJob.java:480)
at com.bumptech.glide.load.engine.DecodeJob.decodeFromData(DecodeJob.java:466)
at com.bumptech.glide.load.engine.DecodeJob.decodeFromRetrievedData(DecodeJob.java:418)
at com.bumptech.glide.load.engine.DecodeJob.onDataFetcherReady(DecodeJob.java:387)
at com.bumptech.glide.load.engine.ResourceCacheGenerator.onDataReady(ResourceCacheGenerator.java:120)
at com.bumptech.glide.load.model.ByteBufferFileLoader$ByteBufferFetcher.loadData(ByteBufferFileLoader.java:74)
at com.bumptech.glide.load.engine.ResourceCacheGenerator.startNext(ResourceCacheGenerator.java:99)
at com.bumptech.glide.load.engine.DecodeJob.runGenerators(DecodeJob.java:309)
at com.bumptech.glide.load.engine.DecodeJob.runWrapped(DecodeJob.java:276)
at com.bumptech.glide.load.engine.DecodeJob.run(DecodeJob.java:235)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641)
at java.lang.Thread.run(Thread.java:929)
at com.bumptech.glide.load.engine.executor.GlideExecutor$DefaultThreadFactory$1.run(GlideExecutor.java:446)
2021-09-18 10:55:50.426 26438-26577/com.zkhl.nursecall W/libEGL: EGLNativeWindowType 0xc291d488 disconnect failed
2021-09-18 10:55:50.463 26438-26438/com.zkhl.nursecall D/AndroidRuntime: Shutting down VM
2021-09-18 10:55:50.465 26438-26438/com.zkhl.nursecall I/QarthLog: [PatchStore] createDisableExceptionQarthFile
2021-09-18 10:55:50.465 26438-26438/com.zkhl.nursecall I/QarthLog: [PatchStore] create disable file for com.zkhl.nursecall uid is 10558
2021-09-18 10:55:50.468 26438-26438/com.zkhl.nursecall E/AndroidRuntime: FATAL EXCEPTION: main
Process: com.zkhl.nursecall, PID: 26438
java.lang.AbstractMethodError: abstract method "android.graphics.Rect com.facebook.drawee.interfaces.DraweeHierarchy.getBounds()"
at com.facebook.drawee.controller.AbstractDraweeController.getDimensions(AbstractDraweeController.java:874)
at com.facebook.drawee.controller.AbstractDraweeController.obtainExtras(AbstractDraweeController.java:852)
at com.facebook.drawee.controller.AbstractDraweeController.reportRelease(AbstractDraweeController.java:833)
at com.facebook.drawee.controller.AbstractDraweeController.releaseFetch(AbstractDraweeController.java:235)
at com.facebook.drawee.controller.AbstractDraweeController.release(AbstractDraweeController.java:208)
at com.facebook.drawee.components.DeferredReleaserConcurrentImpl$1.run(DeferredReleaserConcurrentImpl.java:44)
at android.os.Handler.handleCallback(Handler.java:888)
at android.os.Handler.dispatchMessage(Handler.java:100)
at android.os.Looper.loop(Looper.java:213)
at android.app.ActivityThread.main(ActivityThread.java:8178)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:513)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1101)
2021-09-18 10:55:53.596 26438-26438/com.zkhl.nursecall W/System.err: java.lang.AbstractMethodError: abstract method "android.graphics.Rect com.facebook.drawee.interfaces.DraweeHierarchy.getBounds()"
2021-09-18 10:55:53.597 26438-26438/com.zkhl.nursecall W/System.err: at com.facebook.drawee.controller.AbstractDraweeController.getDimensions(AbstractDraweeController.java:874)
2021-09-18 10:55:53.597 26438-26438/com.zkhl.nursecall W/System.err: at com.facebook.drawee.controller.AbstractDraweeController.obtainExtras(AbstractDraweeController.java:852)
2021-09-18 10:55:53.597 26438-26438/com.zkhl.nursecall W/System.err: at com.facebook.drawee.controller.AbstractDraweeController.reportRelease(AbstractDraweeController.java:833)
2021-09-18 10:55:53.597 26438-26438/com.zkhl.nursecall W/System.err: at com.facebook.drawee.controller.AbstractDraweeController.releaseFetch(AbstractDraweeController.java:235)
2021-09-18 10:55:53.597 26438-26438/com.zkhl.nursecall W/System.err: at com.facebook.drawee.controller.AbstractDraweeController.release(AbstractDraweeController.java:208)
2021-09-18 10:55:53.597 26438-26438/com.zkhl.nursecall W/System.err: at com.facebook.drawee.components.DeferredReleaserConcurrentImpl$1.run(DeferredReleaserConcurrentImpl.java:44)
2021-09-18 10:55:53.597 26438-26438/com.zkhl.nursecall W/System.err: at android.os.Handler.handleCallback(Handler.java:888)
2021-09-18 10:55:53.598 26438-26438/com.zkhl.nursecall W/System.err: at android.os.Handler.dispatchMessage(Handler.java:100)
2021-09-18 10:55:53.598 26438-26438/com.zkhl.nursecall W/System.err: at android.os.Looper.loop(Looper.java:213)
2021-09-18 10:55:53.598 26438-26438/com.zkhl.nursecall W/System.err: at android.app.ActivityThread.main(ActivityThread.java:8178)
2021-09-18 10:55:53.598 26438-26438/com.zkhl.nursecall W/System.err: at java.lang.reflect.Method.invoke(Native Method)
2021-09-18 10:55:53.598 26438-26438/com.zkhl.nursecall W/System.err: at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:513)
2021-09-18 10:55:53.598 26438-26438/com.zkhl.nursecall W/System.err: at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1101)
2021-09-18 10:55:53.598 26438-26438/com.zkhl.nursecall I/Process: Sending signal. PID: 26438 SIG: 9
2021-09-18 10:59
z***@163.com (作者)
回复 DCloud_Android_ST:
感觉是fresco 的问题。
我想问一下你们云打包配置的版本是多少?
我用了androidX
配置是:
implementation 'com.facebook.fresco:fresco:2.5.0'
implementation "com.facebook.fresco:animated-gif:2.5.0"
2021-09-18 11:10
z***@163.com (作者)
回复 DCloud_Android_ST:
按照日志的意思,应该是有图片的格式无法解析(比如我的相册里面可能有gif图片),但是为啥云打包的不崩溃。。。
2021-09-18 11:19
DCloud_Android_ST
用3.2.5+版本SDK 试下
2021-09-18 18:25
z***@163.com (作者)
回复 DCloud_Android_ST: 后来用了3.2.9可以。 现在有个问题,hbuilderx中某个项目编译跑到一半,系统蓝屏死机了,重启之后,这个项目再次编译就卡住了(无数次的卡住,试过重新下载HBuilderX,运行reset.bat,都不行,从git上重新下载项目代码,也不行),有没有什么地方可以清理编译中的缓存?
2021-11-08 16:57
DCloud_Android_ST
回复 z***@163.com: 你这个好像是系统环境问题 你可以重装下系统
2021-11-08 18:09