裸露的骨头ExpoKit项目无法在iOS或Android上运行

时间:2019-07-11 05:21:49

标签: react-native cocoapods react-native-android expo react-native-ios

我使用expo init创建了一个简单的react native项目。 弹出并选择ExpoKit。

我立即进行Pod安装后,出现了此错误。

[!]在../node_modules/expo-barcode-scanner-interface/ios中找不到EXBarCodeScannerInterface的podspec

在某人周围谷歌搜索只是为了注释掉这些内容,因此我在pod文件中评论了7-8行这样的podspec。

现在,一旦错误消失,我就会收到此错误。

[!]找不到EXAdsAdMob依赖的UMCore规范

如果我注释掉EXAdsAdMob,我在EXAdsFacebook上也会遇到相同的错误,依此类推。

在Android上,我使用Android Studio运行弹出的文件并出现以下错误。

  

/ android / enabled-modules不存在。

下面是我的package.json,然后是我的podfile

package.json

{
  "main": "node_modules/expo/AppEntry.js",
  "scripts": {
    "start": "expo start",
    "android": "expo start --android",
    "ios": "expo start --ios",
    "web": "expo start --web",
    "eject": "expo eject"
  },
  "dependencies": {
    "expo": "^33.0.0",
    "expo-core": "1.0.1",
    "expokit": "33.0.4",
    "react": "16.8.3",
    "react-dom": "^16.8.6",
    "react-native": "https://github.com/expo/react-native/archive/sdk-33.0.0.tar.gz",
    "react-native-unimodules": "^0.4.1",
    "react-native-web": "^0.11.4"
  },
  "devDependencies": {
    "babel-preset-expo": "^5.1.1"
  },
  "private": true
}

Podfile

source 'https://github.com/CocoaPods/Specs.git'
platform :ios, '10.0'

target 'demo-stripe-project' do
  pod 'ExpoKit',
    :git => "http://github.com/expo/expo.git",
    :tag => "ios/2.11.0",
    :subspecs => [
      "Core"
    ],
    :inhibit_warnings => true
  pod 'EXAdsAdMob',
    :path => "../node_modules/expo-ads-admob/ios"
  pod 'EXAdsFacebook',
    :path => "../node_modules/expo-ads-facebook/ios"
  pod 'EXAmplitude',
    :path => "../node_modules/expo-analytics-amplitude/ios"
  pod 'EXSegment',
    :path => "../node_modules/expo-analytics-segment/ios"
  pod 'EXAppAuth',
    :path => "../node_modules/expo-app-auth/ios"
  pod 'EXAppLoaderProvider',
    :path => "../node_modules/expo-app-loader-provider/ios"
  pod 'EXAV',
    :path => "../node_modules/expo-av/ios"
  pod 'EXBackgroundFetch',
    :path => "../node_modules/expo-background-fetch/ios"
  pod 'EXBarCodeScanner',
    :path => "../node_modules/expo-barcode-scanner/ios"
  # pod 'EXBarCodeScannerInterface',
  #   :path => "../node_modules/expo-barcode-scanner-interface/ios"
  pod 'EXBlur',
    :path => "../node_modules/expo-blur/ios"
  pod 'EXBrightness',
    :path => "../node_modules/expo-brightness/ios"
  pod 'EXCalendar',
    :path => "../node_modules/expo-calendar/ios"
  pod 'EXCamera',
    :path => "../node_modules/expo-camera/ios"
  # pod 'EXCameraInterface',
  #   :path => "../node_modules/expo-camera-interface/ios"
  pod 'EXConstants',
    :path => "../node_modules/expo-constants/ios"
  # pod 'EXConstantsInterface',
  #   :path => "../node_modules/expo-constants-interface/ios"
  pod 'EXContacts',
    :path => "../node_modules/expo-contacts/ios"
  pod 'EXCore',
    :path => "../node_modules/expo-core/ios"
  pod 'EXCrypto',
    :path => "../node_modules/expo-crypto/ios"
  pod 'EXDocumentPicker',
    :path => "../node_modules/expo-document-picker/ios"
  # pod 'EXErrors',
  #   :path => "../node_modules/expo-errors/ios"
  pod 'EXFacebook',
    :path => "../node_modules/expo-facebook/ios"
  # pod 'EXFaceDetectorInterface',
  #   :path => "../node_modules/expo-face-detector-interface/ios"
  pod 'EXFacebook',
    :path => "../node_modules/expo-facebook/ios"
  pod 'EXFileSystem',
    :path => "../node_modules/expo-file-system/ios"
  # pod 'EXFileSystemInterface',
  #   :path => "../node_modules/expo-file-system-interface/ios"
  # pod 'EXFont',
  #   :path => "../node_modules/expo-font/ios"
  # pod 'EXFontInterface',
  #   :path => "../node_modules/expo-font-interface/ios"
  pod 'EXGL',
    :path => "../node_modules/expo-gl/ios"
  pod 'EXGL-CPP',
    :path => "../node_modules/expo-gl-cpp/cpp"
  pod 'EXGoogleSignIn',
    :path => "../node_modules/expo-google-sign-in/ios"
  pod 'EXHaptics',
    :path => "../node_modules/expo-haptics/ios"
  # pod 'EXImageLoaderInterface',
  #   :path => "../node_modules/expo-image-loader-interface/ios"
  pod 'EXImageManipulator',
    :path => "../node_modules/expo-image-manipulator/ios"
  pod 'EXImagePicker',
    :path => "../node_modules/expo-image-picker/ios"
  pod 'EXKeepAwake',
    :path => "../node_modules/expo-keep-awake/ios"
  pod 'EXLinearGradient',
    :path => "../node_modules/expo-linear-gradient/ios"
  pod 'EXLocalAuthentication',
    :path => "../node_modules/expo-local-authentication/ios"
  pod 'EXLocalization',
    :path => "../node_modules/expo-localization/ios"
  pod 'EXLocation',
    :path => "../node_modules/expo-location/ios"
  pod 'EXMailComposer',
    :path => "../node_modules/expo-mail-composer/ios"
  pod 'EXMediaLibrary',
    :path => "../node_modules/expo-media-library/ios"
  pod 'EXPermissions',
    :path => "../node_modules/expo-permissions/ios"
  # pod 'EXPermissionsInterface',
  #   :path => "../node_modules/expo-permissions-interface/ios"
  pod 'EXPrint',
    :path => "../node_modules/expo-print/ios"
  pod 'EXRandom',
    :path => "../node_modules/expo-random/ios"
  # pod 'EXReactNativeAdapter',
  #   :path => "../node_modules/expo-react-native-adapter/ios"
  pod 'EXSecureStore',
    :path => "../node_modules/expo-secure-store/ios"
  pod 'EXSensors',
    :path => "../node_modules/expo-sensors/ios"
  # pod 'EXSensorsInterface',
  #   :path => "../node_modules/expo-sensors-interface/ios"
  pod 'EXSMS',
    :path => "../node_modules/expo-sms/ios"
  pod 'EXSpeech',
    :path => "../node_modules/expo-speech/ios"
  pod 'EXSQLite',
    :path => "../node_modules/expo-sqlite/ios"
  pod 'EXTaskManager',
    :path => "../node_modules/expo-task-manager/ios"
  # pod 'EXTaskManagerInterface',
  #   :path => "../node_modules/expo-task-manager-interface/ios"
  pod 'EXWebBrowser',
    :path => "../node_modules/expo-web-browser/ios"

  pod 'React',
    :path => "../node_modules/react-native",
    :inhibit_warnings => true,
    :subspecs => [
      "Core",
      "ART",
      "RCTActionSheet",
      "RCTAnimation",
      "RCTCameraRoll",
      "RCTGeolocation",
      "RCTImage",
      "RCTNetwork",
      "RCTText",
      "RCTVibration",
      "RCTWebSocket",
      "DevSupport",
      "CxxBridge"
    ]
  pod 'yoga',
    :path => "../node_modules/react-native/ReactCommon/yoga",
    :inhibit_warnings => true
  pod 'DoubleConversion',
    :podspec => "../node_modules/react-native/third-party-podspecs/DoubleConversion.podspec",
    :inhibit_warnings => true
  pod 'Folly',
    :podspec => "../node_modules/react-native/third-party-podspecs/Folly.podspec",
    :inhibit_warnings => true
  pod 'glog',
    :podspec => "../node_modules/react-native/third-party-podspecs/glog.podspec",
    :inhibit_warnings => true


  post_install do |installer|
    installer.pods_project.main_group.tab_width = '2';
    installer.pods_project.main_group.indent_width = '2';

    installer.target_installation_results.pod_target_installation_results
      .each do |pod_name, target_installation_result|

    if target.pod_name == 'ExpoKit'
      target.native_target.build_configurations.each do |config|
        config.build_settings['GCC_PREPROCESSOR_DEFINITIONS'] ||= ['$(inherited)']
        config.build_settings['GCC_PREPROCESSOR_DEFINITIONS'] << 'EX_DETACHED=1'

        # needed for GoogleMaps 2.x
        config.build_settings['FRAMEWORK_SEARCH_PATHS'] ||= []
        config.build_settings['FRAMEWORK_SEARCH_PATHS'] << '${PODS_ROOT}/GoogleMaps/Base/Frameworks'
        config.build_settings['FRAMEWORK_SEARCH_PATHS'] << '${PODS_ROOT}/GoogleMaps/Maps/Frameworks'
      end
    end


    if ['Amplitude-iOS','Analytics','AppAuth','Branch','CocoaLumberjack','FBSDKCoreKit','FBSDKLoginKit','FBSDKShareKit','GPUImage','JKBigInteger2'].include? target.pod_name
      target.native_target.build_configurations.each do |config|
        config.build_settings['IPHONEOS_DEPLOYMENT_TARGET'] = '10.0'
      end
    end
    # Can't specify this in the React podspec because we need
    # to use those podspecs for detached projects which don't reference ExponentCPP.
    if target.pod_name.start_with?('React')
      target.native_target.build_configurations.each do |config|
        config.build_settings['IPHONEOS_DEPLOYMENT_TARGET'] = '10.0'
        config.build_settings['HEADER_SEARCH_PATHS'] ||= ['$(inherited)']
      end
    end
    # Build React Native with RCT_DEV enabled and RCT_ENABLE_INSPECTOR and
    # RCT_ENABLE_PACKAGER_CONNECTION disabled
    next unless target.pod_name == 'React'
    target.native_target.build_configurations.each do |config|
      config.build_settings['GCC_PREPROCESSOR_DEFINITIONS'] ||= ['$(inherited)']
      config.build_settings['GCC_PREPROCESSOR_DEFINITIONS'] << 'RCT_DEV=1'
      config.build_settings['GCC_PREPROCESSOR_DEFINITIONS'] << 'RCT_ENABLE_INSPECTOR=0'
      config.build_settings['GCC_PREPROCESSOR_DEFINITIONS'] << 'ENABLE_PACKAGER_CONNECTION=0'
    end

    end
  end
end

1 个答案:

答案 0 :(得分:0)

我收到此错误的原因是我的expo-cli已过时。 我更新了它,现在一切正常。

新版本自动安装了react-native-unimodules软件包,这在弹出的应用程序中现在是必需的。