Xcode build error for react-native - xcode

maybe the same question here
, I follow official website tutorial workflow and try to build AwesomeProject, but even I choose different version, problem still exist
I can't describe clearly and directly screenshot below
certainly I installed react-native by following official guide step
$ npm install -g react-native-cli
$ react-native init AwesomeProject
could anybody help me out of this error, thx ..

Find out where react-native is installed, using which react-native, then change the reference to react-native, within the script called by Xcode, to /full/path/to/react-native.
Harder way: Modify the $PATH that Xcode uses so it looks in the new path. I wouldn't do this as it's hassle and appears to change with every version of OSX. I think it's done by editing /etc/paths and restarting; not sure though.

Related

I have a Podfile in the project, but No `Podfile' found in the project directory

recently I bought new macbook 16(intel, catalina)
I have started new project, I cannot install pods in my xcode project.
I successfully installed cocoapods and pod init.
but I cannot run command pod install.
This is what I get when I type command
ruby -rrbconfig -e 'puts RbConfig::CONFIG["rubyhdrdir"]'
/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/include/ruby-2.6.0
Please help if you have similar experience or good guess.
Thank you.
I had the same message about no 'Podfile'. I've solved this by moving my project to different directory with simple path. The previous one was too complicated - with backspaces, foreign language characters, with special characters.I think, the installer didn't like something about that.

CFBundleIdentifier does not exist on react-native

Easy bounty here for grabs. Does not necessarily require any react-native experience. Problem seems to be in open source code, which is available out there:
Updated xcode, and now when I try to run my react-native app by issuing following command: react-native run-ios I get an error:
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
error Command failed: /usr/libexec/PlistBuddy -c Print:CFBundleIdentifier DerivedData/Build/Products/Debug-iphonesimulator/MyAppName.app/Info.plist
Print: Entry, ":CFBundleIdentifier", Does Not Exist
debug Error: Command failed: /usr/libexec/PlistBuddy -c Print:CFBundleIdentifier DerivedData/Build/Products/Debug-iphonesimulator/MyAppName.app/Info.plist
Print: Entry, ":CFBundleIdentifier", Does Not Exist
at checkExecSyncError (child_process.js:616:11)
at Object.execFileSync (child_process.js:634:13)
at runOnSimulator (project-root-dir/node_modules/#react-native-community/cli/build/commands/runIOS/runIOS.js:181:45)
Before those errors, the command prints out info about successful build, and that it is about to install the build:
info ** BUILD SUCCEEDED **
info Installing DerivedData/Build/Products/Debug-iphonesimulator/MyAppName.app
So it seems the build is ok, but when it tries to install the app it fails?
Think I've tried "everything" I found from other questions with this similar error message, but nothing has worked for me.
Some specs:
react-native: 0.59.10
react: 16.8.3
xcode-version: Version 12.2 (12B45b)
I know there are similar questions on stackoverflow. But since none of the solutions provided there worked for me, and I wish to get it fixed, I made this separate question.
I do not know where the Info.plist file is that it tries to find: DerivedData/Build/Products/Debug-iphonesimulator/MyAppName.app/Info.plist
Inside my ios folder, there is a folder called DerivedData, but inside that there are no folder with a name Build. So I think it might be looking from a wrong location?
UPDATE:
I've been able to pinpoint where the cli launch goes wrong:
https://github.com/react-native-community/cli/blob/ba298d9c47af522f0377325bebc6c2075d41790a/packages/platform-ios/src/commands/runIOS/index.ts#L378
If I change that line let buildPath = build/${scheme}/Build/Products/${configuration}-${device}/${appName}.app
to -> build/${scheme}/Build/Products/${configuration}-${device}/MyAppRealName.app;
Then the dev launch works nicely, there's no problem. So it seems that getting the appName goes wrong. The appName is resolved here: https://github.com/react-native-community/cli/blob/ba298d9c47af522f0377325bebc6c2075d41790a/packages/platform-ios/src/commands/runIOS/index.ts#L387
const productNameMatch = /export FULL_PRODUCT_NAME="?(.+).app"?$/m.exec(buildOutput);
I could do a post install npm script that just sets the name of the app correct and call it a day. But that's pretty hacky way. I wonder if there's an alternative that works better? I see that the runIOS file has been updated from the version that I have quite much, but the function getProductName still remains the same. So Im not sure if updating just the cli would work, or if it would even be possible, because it might require a newer react-native version, which is not an option for me right now.
newer version of #react-native-community/cli is not working on older version react-native because in newer version they have change getProductName to getPlatformName. for more detail you can read summary of this PR
Solution
As a local workaround, patch the package by patch-package node_modules/#react-native-community/cli-platform-ios/build/commands/runIOS/index.js and edited getProductName (lines 362–365) to read:
function getProductName(buildOutput) {
const productNameMatch = /export FULL_PRODUCT_NAME\\?="?(.+).app"?$/m.exec(buildOutput);
return productNameMatch ? productNameMatch[1].replace(/(?:\\(.))/g, '$1') : null;
}
The result from react-native run-ios is:
DerivedData/Build/Products/Debug-iphonesimulator/MyAppName.app/Info.plist
The correct should be:
DerivedData/Build/Products/Debug-iphonesimulator/MyAppRealName.app/Info.plist
Then you could fix it by edit Xcode project as:
Open Product menu (status bar)
Scheme -> Edit Scheme
Under build section, add a post-action
In provide build settings from: choose target of your app
Use the script to copy wrongname.app to realname.app: cp ${BUILT_PRODUCTS_DIR}/${PRODUCT_NAME}.app ${BUILT_PRODUCTS_DIR}/real_name.app
Or you can use symlinks instead of copying.

Why can't I run yarn start?

For a few days I have been getting these messages:
*> yarn run v1.21.1 $ react-scripts start
There might be a problem with the project dependency tree. It is
likely not a bug in Create React App, but something you need to fix
locally.
The react-scripts package provided by Create React App requires a
dependency:
"eslint": "^6.6.0"
Don't try to install it manually: your package manager does it
automatically. However, a different version of eslint was detected
higher up in the tree:
/home/sol/Repository/node_modules/eslint (version: 6.3.0)
Manually installing incompatible versions is known to cause
hard-to-debug issues.
If you would prefer to ignore this check, add
SKIP_PREFLIGHT_CHECK=true to an .env file in your project. That will
permanently disable this message but you might encounter other issues.
To fix the dependency tree, try following the steps below in the exact
order:
Delete package-lock.json (not package.json!) and/or yarn.lock in your project folder.
Delete node_modules in your project folder.
Remove "eslint" from dependencies and/or devDependencies in the package.json file in your project folder.
Run npm install or yarn, depending on the package manager you use.
In most cases, this should be enough to fix the problem. If this has
not helped, there are a few other things you can try:
If you used npm, install yarn (http://yarnpkg.com/) and repeat the above steps with it instead.
This may help because npm has known issues with package hoisting which may get resolved in future versions.
Check if /home/sol/Repository/node_modules/eslint is outside your project directory.
For example, you might have accidentally installed something in your home folder.
Try running npm ls eslint in your project folder.
This will tell you which other package (apart from the expected react-scripts) installed eslint.
If nothing else helps, add SKIP_PREFLIGHT_CHECK=true to an .env file
in your project. That would permanently disable this preflight check
in case you want to proceed anyway.
P.S. We know this message is long but please read the steps above :-)
We hope you find them helpful!
error Command failed with exit code 1. info Visit
https://yarnpkg.com/en/docs/cli/run for documentation about this
command.*
I tried everything above, but nothing helps and I'm really upset about this situation because I can't get my code to work.
Can someone help me with easy instructions because I don't have time anymore to try and find a solution to the problem.
I could not solve the problem:
There might be a problem with the project dependency tree.
It is likely not a bug in Create React App, but something you need to fix locally.
The react-scripts package provided by Create React App requires a dependency:
"eslint": "^6.6.0"
Don't try to install it manually: your package manager does it automatically.
However, a different version of eslint was detected higher up in the tree:
/Users/elvestrindade/node_modules/eslint (version: 6.2.2)

Upgraded React Native and now getting glog/logging.h file not found

I've upgraded React Native from 0.52 to 0.59 I'm aware this is a massive jump but I thought might as well go for it, and now getting glog/logging.h file not found.
I'm also aware that there are similar questions on here. But I've literally tried everything out there and I just can't seem to get this issue fixed.
Here's one of the things that I've tried:
cd node_modules/react-native/scripts && ./ios-install-third-party.sh && cd ../../../
cd node_modules/react-native/third-party/glog-0.3.4/ && ../../scripts/ios-configure-glog.sh && cd ../../../../
Anyone would think this would solve it right? I've left no stone unterned and it just doesn't want to go away. Fun!
Found a reference to the XCode app name having spaces here:
https://github.com/facebook/react-native/issues/19774
I also found that as I was using multiple versions, I had "XCode 10.1.app". When I changed it to XCode.app (and run something like sudo xcode-select --switch /Applications/Xcode.app to update the XCode path), my app built without this problem or any of the others I'd experienced to date with glog.

Has anyone managed to add custom icons into Ionic in Windows?

I refer the instructions here
What I did (on Windows):
Install fontforge through web instead of 'brew'
Install SASS through Ruby GEM
Place my-icon.svg inside src/ (of the ionicons-master)
Run the python ./builder/generate.py
I think I am very closed. Until i saw this error message:
windowsError: The system cannot find the file specified
And I think I get even closer when I saw the last post of this link
But, I don't get what it means. I downloaded the .exe but it doesn't work.
Is it the python build only meant for MAC? Has anyone managed to make this work in Windows?

Resources