aws-sdk(v 2.395.0)和react-native

时间:2019-01-29 07:09:10

标签: react-native aws-sdk aws-sdk-js

我正忙于升级已继承职责的React Native应用程序,并且在升级react native之后遇到一些构建问题。

我决定对旧项目进行核对(基于RN 0.53.3),并使用RN 0.58.2创建一个新项目。深入了解源代码之后,我在模拟器上的构建被捆绑在Metro捆绑器中的速度约为99%,该应用程序最终超时,告诉我它无法连接至开发服务器。

由于无法有效地调试问题,我一直在逐个文件,逐个代码地进行依赖以缩小问题的范围,导致这种挂起的第一个问题实际上是 aws-sdk npm模块。

仅添加了import AWS from 'aws-sdk/dist/aws-sdk-react-native'语句后,build就演示了概述的行为。

Failed to load bundle(http://localhost:8081/index.bundle?platform=ios&dev=true&minify=false) with error:(Could not connect to development server.

Ensure the following:
- Node server is running and available on the same network - run 'npm start' from react-native root
- Node server URL is correctly set in AppDelegate
- WiFi is enabled and connected to the same network as the Node Server

URL: http://localhost:8081/index.bundle?platform=ios&dev=true&minify=false The operation couldn’t be completed. (NSURLErrorDomain error -999.))

__38-[RCTCxxBridge loadSource:onProgress:]_block_invoke.226
    RCTCxxBridge.mm:412
___ZL36attemptAsynchronousLoadOfBundleAtURLP5NSURLU13block_pointerFvP18RCTLoadingProgressEU13block_pointerFvP7NSErrorP9RCTSourceE_block_invoke.118
-[RCTMultipartDataTask URLSession:streamTask:didBecomeInputStream:outputStream:]
__88-[NSURLSession delegate_streamTask:didBecomeInputStream:outputStream:completionHandler:]_block_invoke
__NSBLOCKOPERATION_IS_CALLING_OUT_TO_A_BLOCK__
-[NSBlockOperation main]
-[__NSOperationInternal _start:]
__NSOQSchedule_f
_dispatch_call_block_and_release
_dispatch_client_callout
_dispatch_continuation_pop
_dispatch_async_redirect_invoke
_dispatch_root_queue_drain
_dispatch_worker_thread2
_pthread_wqthread
start_wqthread

RN环境信息如下:

  React Native Environment Info:
    System:
      OS: macOS 10.14
      CPU: (8) x64 Intel(R) Core(TM) i7-7820HQ CPU @ 2.90GHz
      Memory: 1.04 GB / 16.00 GB
      Shell: 5.3 - /bin/zsh
    Binaries:
      Node: 8.12.0 - /usr/local/bin/node
      npm: 6.4.1 - /usr/local/bin/npm
      Watchman: 4.9.0 - /usr/local/bin/watchman
    SDKs:
      iOS SDK:
        Platforms: iOS 12.1, macOS 10.14, tvOS 12.1, watchOS 5.1
      Android SDK:
        API Levels: 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 7, 8, 9
        Build Tools: 19.1.0, 21.1.2, 22.0.1, 23.0.1, 23.0.2, 25.0.2, 26.0.3, 27.0.3, 28.0.2
        System Images: android-22 | Google APIs Intel x86 Atom, android-25 | Google APIs Intel x86 Atom, android-26 | Google APIs Intel x86 Atom_64, android-28 | Google APIs Intel x86 Atom
    IDEs:
      Android Studio: 3.2 AI-181.5540.7.32.5056338
      Xcode: 10.1/10B61 - /usr/bin/xcodebuild
    npmPackages:
      react: 16.6.3 => 16.6.3 
      react-native: 0.58.3 => 0.58.3 
    npmGlobalPackages:
      react-native-cli: 2.0.1
      react-native-git-upgrade: 0.2.7
      react-native-patch: 0.2.0

1 个答案:

答案 0 :(得分:0)

请找到附件。经过2天的苦苦挣扎,我们在xcode中找到了Max-old-size的解决方案。

Please find attachment