cli icon indicating copy to clipboard operation
cli copied to clipboard

'react-native run-ios' using old bundle identifier name

Open vorousjames opened this issue 6 years ago • 1 comments

Environment

System: OS: macOS 10.15.7 CPU: (4) x64 Intel(R) Core(TM) i5-6360U CPU @ 2.00GHz Memory: 85.24 MB / 8.00 GB Shell: 5.7.1 - /bin/zsh Binaries: Node: 12.13.1 - /usr/local/bin/node npm: 6.13.4 - /usr/local/bin/npm Watchman: 4.9.0 - /usr/local/bin/watchman SDKs: iOS SDK: Platforms: iOS 14.0, DriverKit 19.0, macOS 10.15, tvOS 14.0, watchOS 7.0 Android SDK: API Levels: 23, 25, 26, 28, 29 Build Tools: 26.0.0, 28.0.3, 29.0.0, 29.0.2 System Images: android-26 | Google APIs Intel x86 Atom, android-29 | Google Play Intel x86 Atom Android NDK: 21.3.6528147 IDEs: Android Studio: 4.0 AI-193.6911.18.40.6626763 Xcode: 12.0.1/12A7300 - /usr/bin/xcodebuild npmPackages: @react-native-community/cli: ^4.8.0 => 4.8.0 react: 16.9.0 => 16.9.0 react-native: ^0.61.5 => 0.61.5 npmGlobalPackages: react-native-cli: 2.0.1

Description

I changed my application name a while back, and the cli never successfully ran the app after that. Xcode builds/runs it fine

some locations (that I can remember) changing/automatically had the new name: Identity (Display Name & Bundle Identifier) Project name (in the project navigator) all of the project's Targets have new app name <NEW_NAME>.xcworkspace name = <NEW_NAME>; (project.pbxproj in "BeginNativeTarget section" in the <NEW_NAME> object) PRODUCT_BUNDLE_IDENTIFIER = com.org.<NEW_NAME>; (I think these next two are the only places I explicitly changed in .pbxproj file) PRODUCT_NAME = <NEW_NAME>;

locations that still have remnants of old name (because it was too confusing to change without breaking app): <OLD_NAME>.entitlements (file) <OLD_NAME> (directory in project navigator pane, the kind with the plain yellow folder) <OLD_NAME>Tests (directory in project navigator pane, the kind with the plain yellow folder) <OLD_NAME>-tvOS.xcscheme, <OLD_NAME>.xcscheme (from <OLD_NAME>/ios/,NEW_NAME.xcodeproj/xcshareddata/xcschemes/) productName = <OLD_NAME>; (project.pbxproj in "BeginNativeTarget section" in the <NEW_NAME> object)

Reproducible Demo

do the above and try running 'react-native run-ios'.

Error: Command failed: /usr/libexec/PlistBuddy -c Print:CFBundleIdentifier /Users/vorousjames/Library/Developer/Xcode/DerivedData/<OLD_NAME>-gdmnlxiprekjqhfiueouiidqhqnl/Build/Products/Debug-iphonesimulator/<OLD_NAME>.app/Info.plist Print: Entry, ":CFBundleIdentifier", Does Not Exist

vorousjames avatar Nov 08 '20 19:11 vorousjames

Close node server and start using npm start -- --reset-cache its working

rajscet avatar Feb 10 '22 04:02 rajscet