React Native IOS Build CFBundleIdentifier Does not

2020-03-19 02:57发布

I have create sample React Native project and following the tutorial as per react native website.

I have try to run the application IOS simulator, its throwing error as below ,

 ** BUILD FAILED **


        The following build commands failed:
            PhaseScriptExecution Install\ Third\ Party /Users/Test/Documents/REACTJS/SampleReactNative/ios/build/Build/Intermediates.noindex/React.build/Debug-iphonesimulator/double-conversion.build/Script-190EE32F1E6A43DE00A8543A.sh
        (1 failure)

        Installing build/Build/Products/Debug-iphonesimulator/SampleReactNative.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/SampleReactNative.app/Info.plist
        Print: Entry, ":CFBundleIdentifier", Does Not Exist

my environment setup information,

  • node version v9.8.0 npm version 5.6.0 react-native-cli: 2.0.1 react-native: 0.54.2 xcode 9.2

Please help us to resolve the issues.

9条回答
做自己的国王
2楼-- · 2020-03-19 03:29

Do you have CFBundleIdentifier in your Info.plist?

If not than add it for eg. com.ios.learning

enter image description here

查看更多
Bombasti
3楼-- · 2020-03-19 03:35

npm uninstall react-native

delete ios and android folder then run :

npm install react-native

react-native upgrade

查看更多
何必那么认真
4楼-- · 2020-03-19 03:36

Try to add CFBundleIdentifier in the Info.plist as:

 <key>CFBundleIdentifier</key>
<string>org.reactjs.native.example.$(PRODUCT_NAME:rfc1034identifier)</string>
查看更多
Bombasti
5楼-- · 2020-03-19 03:37

I have the same problem right after init:

react-native init myapp cd myapp react-native run-ios

..although run-android was fine.

Not a solution but a workaround for the moment, maybe be to init using a lower version of RN:

react-native init myapp --version react-native@0.51.0

That builds okay. Similar in an existing project, install an older version of RN.

Other versions before 0.54.2 might work but I haven't tried.

(edited 2018/4/2) Found my solution from this link: https://github.com/facebook/react-native/issues/18238

RN 0.54 requires types available since iOS 11. So you have to upgrade your xcode and set minimum iOS version in your app to 11

In short, upgraded OSX & Xcode to the latest. (As of today, OSX 10.13.4 Xcode & 9.3)

查看更多
欢心
6楼-- · 2020-03-19 03:39

I have same problem

react-native upgrade Take my project to v0.57.3 And it works perfect now.

查看更多
小情绪 Triste *
7楼-- · 2020-03-19 03:43

This may happen because of some library files not found.You need to follow some steps That I have done and it is worked perfectly for me. 1.) go to Xcode project -> Target -> select build Phase -> Go to target dependies -> Click on + -> add "react" and press add.

2.) Xcode > Product -> scheme > manage sceme -> click on + button -> targetName(React) -> Okay -> make shared of this by select checkbox under shared column.

3.) Clean your project and try to build, If it is getting some error like "glog/logging.h file not found" or "cofig.h file not found" in Xcode and "CFBundleIdentifier not exist" then do not worry. You are just one step far. This is may occurs if you are missing config.h file, For this you need to update config.h file. For this

4.) follow below steps a.) close your Xcode b.) Open terminal with the project (Or you can directly left click your project and drag your folder to closed terminal, [It will automatically take the path from your that corresponding folder]) c.) write command

cd node_modules/react-native/third-party/glog-0.3.4/

d.) Run the configure scripted file by the command

./configure

e.) now close terminal and go to terminal with your project root path. now try final run your iOS project by

react-native run-ios

Happy Coding :)

查看更多
登录 后发表回答