【问题标题】:config.h file not found and :CFBundleIdentifier does not exist. ERROR未找到 config.h 文件并且 :CFBundleIdentifier 不存在。错误
【发布时间】:2019-04-26 12:14:39
【问题描述】:

我已经尝试了我在互联网上找到的所有方法来解决这个问题,但仍然给我同样的错误

我已经试过几次了:

$ rm -rf node_modules/ && yarn cache clean && yarn install
$ ls node_modules/react-native/ (missing third-party directory)

Xcode 构建失败:找不到“config.h”文件

$ node_modules/react-native/ios-install-third-party.sh or node_modules/react-native/scripts/ios-install-third-party.sh
$ ls node_modules/react-native/ (third-party directory found)

    react-native run-ios
Found Xcode project albums.xcodeproj
Building using "xcodebuild -project albums.xcodeproj -configuration Debug -scheme albums -destination id=1ADEA58D-63BF-431C-B743-C1B73366A9B8 -derivedDataPath build"
    Capabilities for albums may not function correctly because its entitlements use a placeholder team ID. To resolve this, select a development team in the build settings editor. (in target 'albums')
▸ Running script 'Install Third Party'
▸ Compiling raw_logging.cc

❌  /Users/servandoberna/Downloads/React Native + Redux - Steven Grider/albums/node_modules/react-native/third-party/glog-0.3.5/src/base/mutex.h:105:10: 'config.h' file not found

#include "config.h"           // to figure out pthreads support
         ^~~~~~~~~~


▸ Compiling signalhandler.cc

❌  /Users/servandoberna/Downloads/React Native + Redux - Steven Grider/albums/node_modules/react-native/third-party/glog-0.3.5/src/base/mutex.h:105:10: 'config.h' file not found

#include "config.h"           // to figure out pthreads support
         ^~~~~~~~~~


▸ Compiling Conv.cpp
▸ Compiling StringBase.cpp
▸ Compiling dynamic.cpp
▸ Compiling utilities.cc

❌  /Users/servandoberna/Downloads/React Native + Redux - Steven Grider/albums/node_modules/react-native/third-party/glog-0.3.5/src/base/mutex.h:105:10: 'config.h' file not found

#include "config.h"           // to figure out pthreads support
         ^~~~~~~~~~


▸ Compiling vlog_is_on.cc

❌  /Users/servandoberna/Downloads/React Native + Redux - Steven Grider/albums/node_modules/react-native/third-party/glog-0.3.5/src/base/mutex.h:105:10: 'config.h' file not found

#include "config.h"           // to figure out pthreads support
         ^~~~~~~~~~


▸ Compiling Unicode.cpp
▸ Compiling symbolize.cc

❌  /Users/servandoberna/Downloads/React Native + Redux - Steven Grider/albums/node_modules/react-native/third-party/glog-0.3.5/src/base/mutex.h:105:10: 'config.h' file not found

#include "config.h"           // to figure out pthreads support
         ^~~~~~~~~~


▸ Compiling Bits.cpp
▸ Compiling demangle.cc

❌  /Users/servandoberna/Downloads/React Native + Redux - Steven Grider/albums/node_modules/react-native/third-party/glog-0.3.5/src/demangle.h:73:10: 'config.h' file not found

#include "config.h"
         ^~~~~~~~~~


▸ Compiling Demangle.cpp
** BUILD FAILED **


The following build commands failed:

    CompileC /Users/servandoberna/Downloads/React\ Native\ +\ Redux\ -\ Steven\ Grider/albums/ios/build/Build/Intermediates.noindex/React.build/Debug-iphonesimulator/third-party.build/Objects-normal/x86_64/demangle-9e475ebb43be38e662a2b7ccf64e02d2c67a869564183b68ceff63bc9453d1d1.o /Users/servandoberna/Downloads/React\ Native\ +\ Redux\ -\ Steven\ Grider/albums/node_modules/react-native/third-party/glog-0.3.5/src/demangle.cc normal x86_64 c++ com.apple.compilers.llvm.clang.1_0.compiler
(1 failure)

Installing build/Build/Products/Debug-iphonesimulator/albums.app
An error was encountered processing the command (domain=NSPOSIXErrorDomain, code=22):
Failed to install the requested application
The bundle identifier of the application could not be determined.
Ensure that the application's Info.plist contains a value for CFBundleIdentifier.
Print: Entry, ":CFBundleIdentifier", Does Not Exist

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


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

    at checkExecSyncError (child_process.js:602:13)
    at Object.execFileSync (child_process.js:622:13)
    at Promise.then (/Users/servandoberna/Downloads/React Native + Redux - Steven Grider/albums/node_modules/react-native/local-cli/runIOS/runIOS.js:208:5)
    at <anonymous>
    at process._tickCallback (internal/process/next_tick.js:189:7)

环境:

OSX - 莫哈韦
节点 - 8.12.0
react-native-cli - 2.0.1
反应原生 - 0.33.0
Xcode - 10.1

【问题讨论】:

    标签: ios xcode reactjs react-native redux


    【解决方案1】:

    使用 xCode 10

    $ cd ./node_modules/react-native && scripts/ios-install-third-party.sh && cd third-party && cd $(ls | grep 'glog' | awk '{print $1}') && ./configure
    

    【讨论】:

    • 我和 Servando 有同样的问题,这对开发有用,但对生产没有用。我可以在物理设备上构建和运行 jsbundle,但是当我尝试存档命令时,同样的错误仍然存​​在。你知道如何解决吗?谢谢!
    猜你喜欢
    • 1970-01-01
    • 2019-10-17
    • 1970-01-01
    • 2019-04-07
    • 2018-12-18
    • 1970-01-01
    • 2021-10-04
    • 2018-11-22
    相关资源
    最近更新 更多