mac下使用react-native-amap3d时pod install报错



  • package.json

    {
      "name": "demo2",
      "version": "0.0.1",
      "private": true,
      "scripts": {
        "start": "node node_modules/react-native/local-cli/cli.js start",
        "test": "jest"
      },
      "dependencies": {
        "react": "16.3.1",
        "react-native": "0.55.4",
        "react-native-amap3d": "^1.0.0"
      },
      "devDependencies": {
        "babel-jest": "23.0.1",
        "babel-preset-react-native": "4.0.0",
        "jest": "23.1.0",
        "react-test-renderer": "16.3.1"
      },
      "jest": {
        "preset": "react-native"
      }
    }
    

    ios下的Podfile内容:

    # Uncomment the next line to define a global platform for your project
    platform :ios, '9.0'
    
    target 'demo2' do
        pod 'React', :path => '../node_modules/react-native', :subspecs => [
          'Core',
          'CxxBridge', # Include this for RN >= 0.47
          'DevSupport', # Include this to enable In-App Devmenu if RN >= 0.43
          'RCTText',
          'RCTNetwork',
          'RCTWebSocket', # needed for debugging
          # Add any other subspecs you want to use in your project
        ]
        pod 'yoga', :path => '../node_modules/react-native/ReactCommon/yoga'
        pod 'DoubleConversion', :podspec => '../node_modules/react-native/third-party-podspecs/DoubleConversion.podspec'
        pod 'glog', :podspec => '../node_modules/react-native/third-party-podspecs/glog.podspec'
        pod 'Folly', :podspec => '../node_modules/react-native/third-party-podspecs/Folly.podspec'
        pod 'react-native-amap3d', path: '../node_modules/react-native-amap3d/lib/ios'
    end
    

    报错信息
    $ pod install --verbose

      Preparing
    
    Analyzing dependencies
    
    Inspecting targets to integrate
      Using `ARCHS` setting to build architectures of target `Pods-demo2`: (``)
    
    Fetching external sources
    -> Fetching podspec for `DoubleConversion` from `../node_modules/react-native/third-party-podspecs/DoubleConversion.podspec`
    -> Fetching podspec for `Folly` from `../node_modules/react-native/third-party-podspecs/Folly.podspec`
    -> Fetching podspec for `React` from `../node_modules/react-native`
    -> Fetching podspec for `glog` from `../node_modules/react-native/third-party-podspecs/glog.podspec`
    -> Fetching podspec for `react-native-amap3d` from `../node_modules/react-native-amap3d/lib/ios`
    -> Fetching podspec for `yoga` from `../node_modules/react-native/ReactCommon/yoga`
    
    Resolving dependencies of `Podfile`
    
    Comparing resolved specification to the sandbox manifest
      A AMap3DMap
      A AMapFoundation
      A DoubleConversion
      A Folly
      A React
      A boost-for-react-native
      A glog
      A react-native-amap3d
      A yoga
    
    Downloading dependencies
    
    -> Installing AMap3DMap (6.1.0)
      > Copying AMap3DMap from
      `/Users/ligson/Library/Caches/CocoaPods/Pods/Release/AMap3DMap/6.1.0-bd68c`
      to `Pods/AMap3DMap`
    
    -> Installing AMapFoundation (1.5.2)
      > Copying AMapFoundation from
      `/Users/ligson/Library/Caches/CocoaPods/Pods/Release/AMapFoundation/1.5.2-7ea3b`
      to `Pods/AMapFoundation`
    
    -> Installing DoubleConversion (1.1.5)
      > Copying DoubleConversion from
      `/Users/ligson/Library/Caches/CocoaPods/Pods/External/DoubleConversion/d06baae4c040ec2ea227cca2d1621055-e22e0`
      to `Pods/DoubleConversion`
    
    -> Installing Folly (2016.09.26.00)
      > Copying Folly from
      `/Users/ligson/Library/Caches/CocoaPods/Pods/External/Folly/93e8d2821110236b453d60594c008b84-21177`
      to `Pods/Folly`
    
    -> Installing React (0.55.4)
    
    -> Installing boost-for-react-native (1.63.0)
      > Copying boost-for-react-native from
      `/Users/ligson/Library/Caches/CocoaPods/Pods/Release/boost-for-react-native/1.63.0-7140d`
      to `Pods/boost-for-react-native`
    
    -> Installing glog (0.3.4)
     > Git download
     > Git download
         $ /usr/local/bin/git clone https://github.com/google/glog.git
         /var/folders/bc/3kq7n9xj45dd6bd2ryp_09j40000gn/T/d20180615-25838-orp6yk
         --template= --single-branch --depth 1 --branch v0.3.4
         Cloning into '/var/folders/bc/3kq7n9xj45dd6bd2ryp_09j40000gn/T/d20180615-25838-orp6yk'...
         Note: checking out 'd8cb47f77d1c31779f3ff890e1a5748483778d6a'.
         
         You are in 'detached HEAD' state. You can look around, make experimental
         changes and commit them, and you can discard any commits you make in this
         state without impacting any branches by performing another checkout.
         
         If you want to create a new branch to retain commits you create, you may
         do so (now or later) by using -b with the checkout command again. Example:
         
           git checkout -b <new-branch-name>
         
     > Running prepare command
       $ /bin/bash -c  set -e #!/bin/bash set -e 
       PLATFORM_NAME="${PLATFORM_NAME:-iphoneos}"
       CURRENT_ARCH="${CURRENT_ARCH:-armv7}"  export CC="$(xcrun -find -sdk
       $PLATFORM_NAME cc) -arch $CURRENT_ARCH -isysroot $(xcrun -sdk $PLATFORM_NAME
       --show-sdk-path)" export CXX="$CC"  # Remove automake symlink if it exists if
       [ -h "test-driver" ]; then     rm test-driver fi  ./configure --host
       arm-apple-darwin  # Fix build for tvOS cat << EOF >> src/config.h  /* Add in
       so we have Apple Target Conditionals */ #ifdef __APPLE__ #include
       <TargetConditionals.h> #include <Availability.h> #endif  /* Special
       configuration for AppleTVOS */ #if TARGET_OS_TV #undef HAVE_SYSCALL_H #undef
       HAVE_SYS_SYSCALL_H #undef OS_MACOSX #endif  /* Special configuration for
       ucontext */ #undef HAVE_UCONTEXT_H #undef PC_FROM_UCONTEXT #if
       defined(__x86_64__) #define PC_FROM_UCONTEXT uc_mcontext->__ss.__rip #elif
       defined(__i386__) #define PC_FROM_UCONTEXT uc_mcontext->__ss.__eip #endif EOF
       /bin/bash: ./configure: /bin/sh^M: bad interpreter: No such file or directory
    [!] /bin/bash -c 
    set -e
    #!/bin/bash
    set -e
    
    PLATFORM_NAME="${PLATFORM_NAME:-iphoneos}"
    CURRENT_ARCH="${CURRENT_ARCH:-armv7}"
    
    export CC="$(xcrun -find -sdk $PLATFORM_NAME cc) -arch $CURRENT_ARCH -isysroot $(xcrun -sdk $PLATFORM_NAME --show-sdk-path)"
    export CXX="$CC"
    
    # Remove automake symlink if it exists
    if [ -h "test-driver" ]; then
        rm test-driver
    fi
    
    ./configure --host arm-apple-darwin
    
    # Fix build for tvOS
    cat << EOF >> src/config.h
    
    /* Add in so we have Apple Target Conditionals */
    #ifdef __APPLE__
    #include <TargetConditionals.h>
    #include <Availability.h>
    #endif
    
    /* Special configuration for AppleTVOS */
    #if TARGET_OS_TV
    #undef HAVE_SYSCALL_H
    #undef HAVE_SYS_SYSCALL_H
    #undef OS_MACOSX
    #endif
    
    /* Special configuration for ucontext */
    #undef HAVE_UCONTEXT_H
    #undef PC_FROM_UCONTEXT
    #if defined(__x86_64__)
    #define PC_FROM_UCONTEXT uc_mcontext->__ss.__rip
    #elif defined(__i386__)
    #define PC_FROM_UCONTEXT uc_mcontext->__ss.__eip
    #endif
    EOF
    
    /bin/bash: ./configure: /bin/sh^M: bad interpreter: No such file or directory
    
    
    /usr/local/Cellar/cocoapods/1.5.3/libexec/gems/cocoapods-1.5.3/lib/cocoapods/executable.rb:69:in `execute_command'
    /usr/local/Cellar/cocoapods/1.5.3/libexec/gems/cocoapods-1.5.3/lib/cocoapods/executable.rb:27:in `block in executable'
    /usr/local/Cellar/cocoapods/1.5.3/libexec/gems/cocoapods-1.5.3/lib/cocoapods/installer/pod_source_preparer.rb:66:in `block (2 levels) in run_prepare_command'
    /usr/local/Cellar/cocoapods/1.5.3/libexec/gems/cocoapods-1.5.3/lib/cocoapods/installer/pod_source_preparer.rb:60:in `chdir'
    /usr/local/Cellar/cocoapods/1.5.3/libexec/gems/cocoapods-1.5.3/lib/cocoapods/installer/pod_source_preparer.rb:60:in `block in run_prepare_command'
    /usr/local/Cellar/cocoapods/1.5.3/libexec/gems/cocoapods-1.5.3/lib/cocoapods/user_interface.rb:64:in `section'
    /usr/local/Cellar/cocoapods/1.5.3/libexec/gems/cocoapods-1.5.3/lib/cocoapods/installer/pod_source_preparer.rb:59:in `run_prepare_command'
    /usr/local/Cellar/cocoapods/1.5.3/libexec/gems/cocoapods-1.5.3/lib/cocoapods/installer/pod_source_preparer.rb:37:in `prepare!'
    /usr/local/Cellar/cocoapods/1.5.3/libexec/gems/cocoapods-1.5.3/lib/cocoapods/downloader/cache.rb:202:in `copy_and_clean'
    /usr/local/Cellar/cocoapods/1.5.3/libexec/gems/cocoapods-1.5.3/lib/cocoapods/downloader/cache.rb:159:in `block (2 levels) in uncached_pod'
    /usr/local/Cellar/cocoapods/1.5.3/libexec/gems/cocoapods-1.5.3/lib/cocoapods/downloader/cache.rb:157:in `each'
    /usr/local/Cellar/cocoapods/1.5.3/libexec/gems/cocoapods-1.5.3/lib/cocoapods/downloader/cache.rb:157:in `block in uncached_pod'
    /usr/local/Cellar/cocoapods/1.5.3/libexec/gems/cocoapods-1.5.3/lib/cocoapods/downloader/cache.rb:181:in `in_tmpdir'
    /usr/local/Cellar/cocoapods/1.5.3/libexec/gems/cocoapods-1.5.3/lib/cocoapods/downloader/cache.rb:153:in `uncached_pod'
    /usr/local/Cellar/cocoapods/1.5.3/libexec/gems/cocoapods-1.5.3/lib/cocoapods/downloader/cache.rb:33:in `download_pod'
    /usr/local/Cellar/cocoapods/1.5.3/libexec/gems/cocoapods-1.5.3/lib/cocoapods/downloader.rb:42:in `download'
    /usr/local/Cellar/cocoapods/1.5.3/libexec/gems/cocoapods-1.5.3/lib/cocoapods/installer/pod_source_installer.rb:121:in `download_source'
    /usr/local/Cellar/cocoapods/1.5.3/libexec/gems/cocoapods-1.5.3/lib/cocoapods/installer/pod_source_installer.rb:60:in `install!'
    /usr/local/Cellar/cocoapods/1.5.3/libexec/gems/cocoapods-1.5.3/lib/cocoapods/installer.rb:374:in `install_source_of_pod'
    /usr/local/Cellar/cocoapods/1.5.3/libexec/gems/cocoapods-1.5.3/lib/cocoapods/installer.rb:339:in `block (2 levels) in install_pod_sources'
    /usr/local/Cellar/cocoapods/1.5.3/libexec/gems/cocoapods-1.5.3/lib/cocoapods/user_interface.rb:85:in `titled_section'
    /usr/local/Cellar/cocoapods/1.5.3/libexec/gems/cocoapods-1.5.3/lib/cocoapods/installer.rb:338:in `block in install_pod_sources'
    /usr/local/Cellar/cocoapods/1.5.3/libexec/gems/cocoapods-1.5.3/lib/cocoapods/installer.rb:321:in `each'
    /usr/local/Cellar/cocoapods/1.5.3/libexec/gems/cocoapods-1.5.3/lib/cocoapods/installer.rb:321:in `install_pod_sources'
    /usr/local/Cellar/cocoapods/1.5.3/libexec/gems/cocoapods-1.5.3/lib/cocoapods/installer.rb:164:in `block in download_dependencies'
    /usr/local/Cellar/cocoapods/1.5.3/libexec/gems/cocoapods-1.5.3/lib/cocoapods/user_interface.rb:64:in `section'
    /usr/local/Cellar/cocoapods/1.5.3/libexec/gems/cocoapods-1.5.3/lib/cocoapods/installer.rb:162:in `download_dependencies'
    /usr/local/Cellar/cocoapods/1.5.3/libexec/gems/cocoapods-1.5.3/lib/cocoapods/installer.rb:117:in `install!'
    /usr/local/Cellar/cocoapods/1.5.3/libexec/gems/cocoapods-1.5.3/lib/cocoapods/command/install.rb:41:in `run'
    /Library/Ruby/Gems/2.3.0/gems/claide-1.0.2/lib/claide/command.rb:334:in `run'
    /usr/local/Cellar/cocoapods/1.5.3/libexec/gems/cocoapods-1.5.3/lib/cocoapods/command.rb:52:in `run'
    /usr/local/Cellar/cocoapods/1.5.3/libexec/gems/cocoapods-1.5.3/bin/pod:55:in `<top (required)>'
    /usr/local/Cellar/cocoapods/1.5.3/libexec/bin/pod:22:in `load'
    /usr/local/Cellar/cocoapods/1.5.3/libexec/bin/pod:22:in `<main>'
    
    [!] 'AMap3DMap' uses the unencrypted http protocol to transfer the Pod. Please be sure you're in a safe network with only trusted hosts in there. Please reach out to the library author to notify them of this security issue.
    
    [!] 'AMapFoundation' uses the unencrypted http protocol to transfer the Pod. Please be sure you're in a safe network with only trusted hosts in there. Please reach out to the library author to notify them of this security issue.
    


  • 能解决的加我qq吧。解决后100元红包。决不食言。。。QQ:3235215



  • 加了,红包快拿来!!!



  • @ios_react 没看见jia我啊。至少问题得解决


Log in to reply