在本地运行React-Native App(FB F8应用程序) - 构建失败错误

时间:2016-08-04 01:58:18

标签: android ios react-native

我正在尝试运行本地F8使用的react-native应用程序。我按照此处的说明操作:http://makeitopen.com/tutorials/building-the-f8-app/local-setup/

我让一切正常(我可以转到http://localhost:8080/dashboard/appshttp://localhost:8080/graphql查看数据并运行查询)

但是,当我尝试为iOS和Android运行构建时,我遇到了错误。

Android错误:

FAILURE: Build failed with an exception.

* Where:
Build file '/Users/thisuser/f8app/android/app/build.gradle' line: 124

* What went wrong:
A problem occurred evaluating project ':app'.
> SDK location not found. Define location with sdk.dir in the local.properties file or with an ANDROID_HOME environment variable.

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.

BUILD FAILED

Total time: 1 mins 4.006 secs
Could not install the app on the device, read the error above for details.
Make sure you have an Android emulator running or a device connected and have
set up your Android development environment:
https://facebook.github.io/react-native/docs/android-setup.html

iOS错误:

=== BUILD TARGET CodePush OF PROJECT Pods WITH CONFIGURATION Debug ===

Check dependencies

** BUILD FAILED **


The following build commands failed:
    CompileC /Users/thisuser/f8app/ios/build/Build/Intermediates/Pods.build/Debug-iphonesimulator/react-native-fbsdk.build/Objects-normal/x86_64/RCTConvert+FBSDKSharingContent.o /Users/thisuser/f8app/node_modules/react-native-fbsdk/iOS/RCTFBSDK/share/RCTConvert+FBSDKSharingContent.m normal x86_64 objective-c com.apple.compilers.llvm.clang.1_0.compiler
(1 failure)
Installing build/Build/Products/Debug-iphonesimulator/F8v2.app
An error was encountered processing the command (domain=NSPOSIXErrorDomain, code=2):
Failed to install the requested application
An application bundle was not found at the provided path.
Provide a valid path to the desired application bundle.
Print: Entry, ":CFBundleIdentifier", Does Not Exist
/Users/thisuser/f8app/node_modules/react-native/node_modules/promise/lib/done.js:10
      throw err;
      ^

Error: Command failed: /usr/libexec/PlistBuddy -c Print:CFBundleIdentifier build/Build/Products/Debug-iphonesimulator/F8v2.app/Info.plist
Print: Entry, ":CFBundleIdentifier", Does Not Exist

    at checkExecSyncError (child_process.js:464:13)
    at Object.execFileSync (child_process.js:484:13)
    at _runIOS (/Users/thisuser/f8app/node_modules/react-native/local-cli/runIOS/runIOS.js:82:32)
    at /Users/thisuser/f8app/node_modules/react-native/local-cli/runIOS/runIOS.js:24:5
    at tryCallTwo (/Users/thisuser/f8app/node_modules/react-native/node_modules/promise/lib/core.js:45:5)
    at doResolve (/Users/thisuser/f8app/node_modules/react-native/node_modules/promise/lib/core.js:200:13)
    at new Promise (/Users/thisuser/f8app/node_modules/react-native/node_modules/promise/lib/core.js:66:3)
    at Array.runIOS (/Users/thisuser/f8app/node_modules/react-native/local-cli/runIOS/runIOS.js:23:10)
    at Object.run (/Users/thisuser/f8app/node_modules/react-native/local-cli/cliEntry.js:96:13)
    at Object.<anonymous> (/usr/local/lib/node_modules/react-native-cli/index.js:88:7)

我如何使这些工作?

1 个答案:

答案 0 :(得分:0)

仅适用于Android

您需要将Android SDK path设置为this,且必须至少Android SDK Build-Tools Rev 23.0.1