应用程序被拒绝:打开图像裁剪选择器时,React Native应用程序崩溃

时间:2019-05-24 14:58:12

标签: react-native app-store crash-reports

在构建模式和3种不同设备上的应用程序均无问题或崩溃。

App被App Store审核拒绝。

拒绝原因:当我们选择图像上传器时,应用程序崩溃了。


现在,我需要指导来尝试找出崩溃的原因是因为我无法重新创建它。在考虑使用其他图像选择器软件包之前,我想先尝试弄清这种崩溃的含义。


其他信息

“ react-native”:“ 0.57.1​​”, “ react-native-image-crop-picker”:“ ^ 0.21.3”, “ rn-fetch-blob”:“ ^ 0.10.14”


使用的图书馆:https://github.com/ivpusic/react-native-image-crop-picker

使用的代码(是否缺少任何内容?):

openPhotoPicker() {
  const { currentUser } = firebase.auth()
  const Blob = RNFetchBlob.polyfill.Blob
  const fs = RNFetchBlob.fs
  window.XMLHttpRequest = RNFetchBlob.polyfill.XMLHttpRequest
  window.Blob = Blob
  ImagePicker.openPicker({
    width: 60,
    height: 60,
    compressImageMaxWidth: 800,
    compressImageMaxHeight: 800,
    compressImageQuality: 0.8,
    cropping: true,
    smartAlbums: ['UserLibrary', 'Favorites'],
    mediaType: 'photo'
  }).then(image => {
    const imagePath = image.path
    let uploadBlob = null
    const imageRef = firebase.storage()
      .ref(`/users/${currentUser.uid}/progress`)
      .child(`${toJSONLocal(this.state.newDate)}.jpg`)
    let mime = 'image/jpg'
    fs.readFile(imagePath, 'base64')
      .then((data) => {
        return Blob.build(data, { type: `${mime};BASE64` })
    })
    .then((blob) => {
      uploadBlob = blob
      return imageRef.put(blob, { contentType: mime })
    })
    .then(() => {
      uploadBlob.close()
      return imageRef.getDownloadURL()
    })
    .then((url) => {
      let obj = {}
      obj["progressPhoto"] = url
      this.setState(obj)
      this.addPhotoDatabase() // Photo uploaded to firebase storage is also uploaded to database so it can be referenced.
    })
    .catch((error) => {
      console.log(error);
    })
  })
  .catch((error) => {
    console.log(error);
  });
}

这是象征性的崩溃报告:

Exception Type:  EXC_CRASH (SIGABRT) 
Exception Codes: 0x0000000000000000, 0x0000000000000000 
Exception Note:  EXC_CORPSE_NOTIFY 
Triggered by Thread:  1 

Application Specific Information: 
abort() called 

Last Exception Backtrace: 
0   CoreFoundation                0x1b64cf518 __exceptionPreprocess + 228 
1   libobjc.A.dylib               0x1b56aa9f8 objc_exception_throw + 55 
2   MyApp                         0x10048a3f8 RCTFatal + 222200 (RCTAssert.m:132) 
3   MyApp                         0x100486938 -[RCTExceptionsManager reportFatalException:stack:exceptionId:] + 207160 (RCTExceptionsManager.m:58) 
4   CoreFoundation                0x1b64d6ba0 __invoking___ + 143 
5   CoreFoundation                0x1b63b8c90 -[NSInvocation invoke] + 291 
6   CoreFoundation                0x1b63b98c4 -[NSInvocation invokeWithTarget:] + 59 
7   MyApp                         0x10049eaa0 -[RCTModuleMethod invokeWithBridge:module:arguments:] + 305824 (RCTModuleMethod.mm:550) 
8   MyApp                         0x1004e5750 facebook::react::invokeInner(RCTBridge*, RCTModuleData*, unsigned int, folly::dynamic const&) + 595792 (RCTNativeModule.mm:104) 
9   MyApp                         0x1004e54ac invocation function for block in facebook::react::RCTNativeModule::invoke(unsigned int, folly::dynamic&&, int) + 595116 (RCTNativeModule.mm:71) 
10  libdispatch.dylib             0x1b5f0fa38 _dispatch_call_block_and_release + 23 
11  libdispatch.dylib             0x1b5f107d4 _dispatch_client_callout + 15 
12  libdispatch.dylib             0x1b5eb9320 _dispatch_lane_serial_drain$VARIANT$mp + 591 
13  libdispatch.dylib             0x1b5eb9e3c _dispatch_lane_invoke$VARIANT$mp + 427 
14  libdispatch.dylib             0x1b5ec24a8 _dispatch_workloop_worker_thread + 595 
15  libsystem_pthread.dylib       0x1b60f0114 _pthread_wqthread + 303 
16  libsystem_pthread.dylib       0x1b60f2cd4 start_wqthread + 3 


Thread 1 name:  Dispatch queue: com.facebook.react.ExceptionsManagerQueue 
Thread 1 Crashed: 
0   libsystem_kernel.dylib        0x00000001b606d0dc __pthread_kill + 8 
1   libsystem_pthread.dylib       0x00000001b60e6094 pthread_kill$VARIANT$mp + 380 
2   libsystem_c.dylib             0x00000001b5fc6ea8 abort + 140 
3   libc++abi.dylib               0x00000001b5693788 __cxa_bad_cast + 0 
4   libc++abi.dylib               0x00000001b5693934 default_unexpected_handler+ 6452 () + 0 
5   libobjc.A.dylib               0x00000001b56aae00 _objc_terminate+ 24064 () + 124 
6   libc++abi.dylib               0x00000001b569f838 std::__terminate(void (*)+ 55352 ()) + 16 
7   libc++abi.dylib               0x00000001b569f8c4 std::terminate+ 55492 () + 84 
8   libdispatch.dylib             0x00000001b5f107e8 _dispatch_client_callout + 36 
9   libdispatch.dylib             0x00000001b5eb9320 _dispatch_lane_serial_drain$VARIANT$mp + 592 
10  libdispatch.dylib             0x00000001b5eb9e3c _dispatch_lane_invoke$VARIANT$mp + 428 
11  libdispatch.dylib             0x00000001b5ec24a8 _dispatch_workloop_worker_thread + 596 
12  libsystem_pthread.dylib       0x00000001b60f0114 _pthread_wqthread + 304 
13  libsystem_pthread.dylib       0x00000001b60f2cd4 start_wqthread + 4 

0 个答案:

没有答案