创建RN项目run-ios后报错了,可能是版本依赖的问题,但就是不知道在怎么解决.



  • 创建RN项目run-ios后报了Print: Entry, ":CFBundleIdentifier", Does Not Exist错误,求助!
    可能是版本依赖的问题,但就是不知道在怎么解决.

    liuwendeiMac:Desktop facglt$ react-native init RNDemo
    This will walk you through creating a new React Native project in /Users/facglt/Desktop/RNDemo
    Using yarn v0.24.5
    Installing react-native...
    yarn add v0.24.5
    info No lockfile found.
    [1/4] 🔍 Resolving packages...
    [2/4] 🚚 Fetching packages...
    [3/4] 🔗 Linking dependencies...
    warning "react-native@0.45.0" has unmet peer dependency "react@16.0.0-alpha.12".
    [4/4] 📃 Building fresh packages...
    success Saved lockfile.
    success Saved 469 new dependencies.

    ...........

    export SYSTEM_DEVELOPER_USR_DIR=/Applications/Xcode.app/Contents/Developer/usr
    export SYSTEM_DEVELOPER_UTILITIES_DIR=/Applications/Xcode.app/Contents/Developer/Applications/Utilities
    export SYSTEM_DOCUMENTATION_DIR=/Library/Documentation
    export SYSTEM_KEXT_INSTALL_PATH=/System/Library/Extensions
    export SYSTEM_LIBRARY_DIR=/System/Library
    export TAPI_VERIFY_MODE=ErrorsOnly
    export TARGETED_DEVICE_FAMILY=1
    export TARGETNAME=double-conversion
    export TARGET_BUILD_DIR=/Users/facglt/Desktop/RNDemo/ios/build/Build/Products/Debug-iphonesimulator
    export TARGET_DEVICE_IDENTIFIER=32AEAFC5-825A-4306-ABDE-25B7A825525E
    export TARGET_DEVICE_MODEL=iPhone9,1
    export TARGET_DEVICE_OS_VERSION=10.3.1
    export TARGET_NAME=double-conversion
    export TARGET_TEMP_DIR=/Users/facglt/Desktop/RNDemo/ios/build/Build/Intermediates/React.build/Debug-iphonesimulator/double-conversion.build
    export TEMP_DIR=/Users/facglt/Desktop/RNDemo/ios/build/Build/Intermediates/React.build/Debug-iphonesimulator/double-conversion.build
    export TEMP_FILES_DIR=/Users/facglt/Desktop/RNDemo/ios/build/Build/Intermediates/React.build/Debug-iphonesimulator/double-conversion.build
    export TEMP_FILE_DIR=/Users/facglt/Desktop/RNDemo/ios/build/Build/Intermediates/React.build/Debug-iphonesimulator/double-conversion.build
    export TEMP_ROOT=/Users/facglt/Desktop/RNDemo/ios/build/Build/Intermediates
    export TOOLCHAINS=com.apple.dt.toolchain.XcodeDefault
    export TOOLCHAIN_DIR=/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain
    export TREAT_MISSING_BASELINES_AS_TEST_FAILURES=NO
    export UID=504
    export UNSTRIPPED_PRODUCT=NO
    export USER=facglt
    export USER_APPS_DIR=/Users/facglt/Applications
    export USER_LIBRARY_DIR=/Users/facglt/Library
    export USE_DYNAMIC_NO_PIC=YES
    export USE_HEADERMAP=YES
    export USE_HEADER_SYMLINKS=NO
    export VALIDATE_PRODUCT=NO
    export VALID_ARCHS="i386 x86_64"
    export VERBOSE_PBXCP=NO
    export VERSION_INFO_BUILDER=facglt
    export VERSION_INFO
    

    _FILE=double-conversion_vers.c
    export VERSION_INFO_STRING=""@(#)PROGRAM:double-conversion PROJECT:React-""
    export WARNING_CFLAGS="-Wextra -Wall -Wno-semicolon-before-method-body"
    export WRAP_ASSET_PACKS_IN_SEPARATE_DIRECTORIES=NO
    export XCODE_APP_SUPPORT_DIR=/Applications/Xcode.app/Contents/Developer/Library/Xcode
    export XCODE_PRODUCT_BUILD_VERSION=8E3004b
    export XCODE_VERSION_ACTUAL=0833
    export XCODE_VERSION_MAJOR=0800
    export XCODE_VERSION_MINOR=0830
    export XPCSERVICES_FOLDER_PATH=/XPCServices
    export YACC=yacc
    export arch=x86_64
    export variant=normal
    /bin/sh -c /Users/facglt/Desktop/RNDemo/ios/build/Build/Intermediates/React.build/Debug-iphonesimulator/double-conversion.build/Script-190EE32F1E6A43DE00A8543A.sh

    Unpacking /Users/facglt/.rncache/glog-0.3.4.tar.gz...

    glog-0.3.4/src/windows/glog/logging.h: (Empty error message)

    tar: Error exit delayed from previous errors.

    Command /bin/sh failed with exit code 1

    ** BUILD FAILED **

    The following commands produced analyzer issues:

    Analyze /Users/facglt/Desktop/RNDemo/node_modules/react-native/ReactCommon/yoga/yoga/YGNodeList.c
    Analyze /Users/facglt/Desktop/RNDemo/node_modules/react-native/ReactCommon/yoga/yoga/Yoga.c
    

    (2 commands with analyzer issues)

    The following build commands failed:
    PhaseScriptExecution Install\ Third\ Party /Users/facglt/Desktop/RNDemo/ios/build/Build/Intermediates/React.build/Debug-iphonesimulator/double-conversion.build/Script-190EE32F1E6A43DE00A8543A.sh
    (1 failure)

    Installing build/Build/Products/Debug-iphonesimulator/RNDemo.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

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



  • 已解决
    不要直接使用 react-native init ProjectName 创建项目,
    后面加个 --version 0.45.0 之前的版本就好了,
    比如:
    react-native init ProjectName --version 0.44.0


登录后回复