Can't use react-native-svg. Xcode can't open PerformanceBezier and QuartzBookPack - ios

I'm new to React Native and Xcode.
When I npm install react-native-svg I get the following:
Start downloading PerformanceBezier to /Users/username/AwesomeProject/node_modules/react-native-svg/ios/PerformanceBezier
Download PerformanceBezier library from github failed with err: { Error: ENOTEMPTY: directory not empty, rename '/Users/username/AwesomeProject/node_modules/react-native-svg/1511988242148-4207165471078973/PerformanceBezier-master' -> '/Users/username/AwesomeProject/node_modules/react-native-svg/ios/PerformanceBezier'
errno: -66,
code: 'ENOTEMPTY',
syscall: 'rename',
path: '/Users/username/AwesomeProject/node_modules/react-native-svg/1511988242148-4207165471078973/PerformanceBezier-master',
dest: '/Users/username/AwesomeProject/node_modules/react-native-svg/ios/PerformanceBezier' }
Download PerformanceBezier library success!
Start downloading QuartzBookPack to /Users/username/AwesomeProject/node_modules/react-native-svg/ios/QuartzBookPack
Download QuartzBookPack library from github failed with err: { Error: ENOTEMPTY: directory not empty, rename '/Users/username/AwesomeProject/node_modules/react-native-svg/1511988243034-9050633810649857/QuartzBookPack-master' -> '/Users/username/AwesomeProject/node_modules/react-native-svg/ios/QuartzBookPack'
errno: -66,
code: 'ENOTEMPTY',
syscall: 'rename',
path: '/Users/username/AwesomeProject/node_modules/react-native-svg/1511988243034-9050633810649857/QuartzBookPack-master',
dest: '/Users/username/AwesomeProject/node_modules/react-native-svg/ios/QuartzBookPack' }
Download QuartzBookPack library success!
+ react-native-svg#6.0.1-rc.0
Clearly it's having a problem, but then it says that they're both successfully installed. When I try to build the Xcode project I get an error saying that Xcode can't open either of their .xcodeproject files.
Is this something that's going wrong on my end, or is there an issue with the repos that these files are being pulled from?
I have react-native-cli: 2.0.1 and react-native: 0.50.4. and am trying to install react-native-svg#6.0.1-rc.0.

Looks like this has been reported here: https://github.com/react-native-community/react-native-svg/issues/530
Workaround is to run the following:
$ cd node_modules/react-native-svg/
$ rm -rf ios/PerformanceBezier/ ios/QuartzBookPack/
$ npm run postinstall

Related

Issue with react-native run-ios

I spent like 3-4 days trying to figure this out and I cant a solution to it. i googled around and can't find answer.
What happened was everytime I create a new file I get this error.
I used react-native init ProjectName. npm install. cd ios. pod install. cd ..
then react-native run-ios and this is what I get.
asdf#Asdf-MacBook-Pro ProjectName % react-native run-ios
info Found Xcode workspace "ProjectName.xcworkspace"
info Building (using "xcodebuild -workspace ProjectName.xcworkspace -configuration Debug -scheme ProjectName -destination id=3A1A98EB-1D97-4DC2-967F-565F3971D608")
(node:16102) Warning: Accessing non-existent property 'padLevels' of module exports inside circular dependency
(Use `node --trace-warnings ...` to show where the warning was created)
node --trace-warnings ...
node:internal/modules/cjs/loader:959
throw err;
^
Error: Cannot find module '/Users/asdf/Desktop/starter/ProjectName/...'
at Function.Module._resolveFilename (node:internal/modules/cjs/loader:956:15)
at Function.Module._load (node:internal/modules/cjs/loader:804:27)
at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:81:12)
at node:internal/main/run_main_module:17:47 {
code: 'MODULE_NOT_FOUND',
requireStack: []
}
Things I already did
I deleted node_modules and package-lock.json and npm install again.
npm install -g react-native-cli && npm install -g react-native before npm install
upgrade node, nvm, npm
downgrade node, nvm, npm
current version
node v16.17.0
nvm 0.39.1
npm 7.24.2
first apply what you see in the picture via xcode ,you need try this and try yarn ios, and u can try in terminal on your project/ios. arch -arm64 pod install

react native ios build succeeds but path to app bundle is wrong

When I run react-native run-ios build succeeds and created build folder under ios. But after build, when installation starts, get the below error. The project runs successfully when I run it through xcode. What I observed is that path beginning 'DerivedData' is wrong. Instead it should be 'build'. When I rename my 'build' folder to 'DerivedData' and re-run 'react-native run-ios' the whole process completes successfully but of course with the previous build.
How can I change the 'DerivedData' to 'build'?
This error occurred immediately after I upgraded from 0.59.9 to 0.60.0.
Error:
info Installing "DerivedData/Build/Products/Debug-iphonesimulator/mobileappname.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
error Command failed: /usr/libexec/PlistBuddy -c Print:CFBundleIdentifier DerivedData/Build/Products/Debug-iphonesimulator/mobileappname.app/Info.plist
Print: Entry, ":CFBundleIdentifier", Does Not Exist
. Run CLI with --verbose flag for more details.
Error: Command failed: /usr/libexec/PlistBuddy -c Print:CFBundleIdentifier DerivedData/Build/Products/Debug-iphonesimulator/mobileappname.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 (/Users/armaneker/WebstormProjects/mobileappname/node_modules/#react-native-community/cli-platform-ios/build/commands/runIOS/index.js:189:45)
at process._tickCallback (internal/process/next_tick.js:68:7)
React Native version:
System:
OS: macOS 10.15
Binaries:
Node: 10.15.3 - /usr/local/bin/node
npm: 6.13.1 - /usr/local/bin/npm
Watchman: 4.9.0 - /usr/local/bin/watchman
SDKs:
iOS SDK:
Platforms: iOS 13.0, DriverKit 19.0, macOS 10.15, tvOS 13.0, watchOS 6.0
Xcode: 11.0/11A420a - /usr/bin/xcodebuild
npmPackages:
react: 16.8.6 => 16.8.6
react-native: 0.60.0 => 0.60.0
npmGlobalPackages:
create-react-native-app: 1.0.0
react-native-cli: 2.0.1
react-native-git-upgrade: 0.2.7
Steps To Reproduce
used rn-diff-purge to upgrade from 0.59.9 to 0.60.0
android worked correctly
react-native run-ios build succeeded but installation of
app failed
The solution is not obvious, react-native-cli is trying to guess what xcode build configuration is currently setup on your computer which is what is happening on the function getBuildPath()
function getBuildPath(configuration, appName, isDevice, scheme) {
let device;
if (isDevice) {
device = 'iphoneos';
} else if (appName.toLowerCase().includes('tvos')) {
device = 'appletvsimulator';
} else {
device = 'iphonesimulator';
}
let buildPath = `build/${scheme}/Build/Products/${configuration}-${device}/${appName}.app`; // Check wether app file exist, sometimes `-derivedDataPath` option of `xcodebuild` not works as expected.
if (!_fs().default.existsSync(_path().default.join(buildPath))) {
return `DerivedData/Build/Products/${configuration}-${device}/${appName}.app`;
}
return buildPath;
}
The trick is not to patch this file, but to first setup your xcode configuration correctly Xcode > Preferences > Locations (see picture)
and Xcode > Preferences > Locations > Advanced
Once this is done, you have to cleanup your build folder, otherwise, react-native-cli will still assume that xcode is not behaving as expected, which will keep on producing the same error.
cd ios && rm -rf build
you can now execute npx react-native run-ios and everything should be fine again.
It took me quite some time to figure this out, I think that react-native-cli should output more details on what is going on under the hood for people not to be blocked.
Problem solved. I had to edit a file inside #react-native-community.
If anyone else has the same problem solution is below.
File location:
-> file:
-> node_modules
-> #react-native-community
-> cli-platform-ios
-> build
-> commands
-> runIOS
-> index.js line 314
Change:DerivedData/Build/Products/${configuration}-${device}/${appName}.app
To:build/Build/Products/${configuration}-${device}/${appName}.app
Cheers.

Couldn't find the 'yo' binary. Make sure it's installed and in your $PATH. Could you tell me what the problem is?

I'm using npm install -g yo gulp to install yeoman and this is the error I'm getting
npm WARN deprecated cross-spawn-async#2.2.5: cross-spawn no longer requires a build toolchain, use it instead
C:\Usr\local\gulp -> C:\Usr\local\node_modules\gulp\bin\gulp.js
C:\Usr\local\yo -> C:\Usr\local\node_modules\yo\lib\cli.js
C:\Usr\local\yo-complete -> C:\Usr\local\node_modules\yo\lib\completion\index.js
> yo#3.1.0 postinstall C:\Usr\local\node_modules\yo
> yodoctor
Yeoman Doctor
Running sanity checks on your system
√ No .bowerrc file in home directory
√ Global configuration file is valid
√ NODE_PATH matches the npm root
√ No .yo-rc.json file in home directory
√ Node.js version
{ Error: Couldn't find the 'yo' binary. Make sure it's installed and in your $PATH
at notFoundError (C:\Usr\local\node_modules\yo\node_modules\cross-spawn-async\lib\enoent.js:8:11)
at verifyENOENT (C:\Usr\local\node_modules\yo\node_modules\cross-spawn-async\lib\enoent.js:43:16)
at ChildProcess.cp.emit (C:\Usr\local\node_modules\yo\node_modules\cross-spawn-async\lib\enoent.js:30:19)
at Process.ChildProcess._handle.onexit (internal/child_process.js:198:12)
errno: 'ENOENT',
code: 'ENOENT',
syscall: 'spawn yo',
cmd: 'C:\\WINDOWS\\system32\\cmd.exe /s /c "yo "--version""' }
× yo version
{ Error: Couldn't find the 'yo' binary. Make sure it's installed and in your $PATH
at notFoundError (C:\Usr\local\node_modules\yo\node_modules\cross-spawn-async\lib\enoent.js:8:11)
at verifyENOENT (C:\Usr\local\node_modules\yo\node_modules\cross-spawn-async\lib\enoent.js:43:16)
at ChildProcess.cp.emit (C:\Usr\local\node_modules\yo\node_modules\cross-spawn-async\lib\enoent.js:30:19)
at Process.ChildProcess._handle.onexit (internal/child_process.js:198:12)
errno: 'ENOENT',
code: 'ENOENT',
syscall: 'spawn yo',
cmd: 'C:\\WINDOWS\\system32\\cmd.exe /s /c "yo "--version""' }
√ npm version
Found potential issues on your machine :(
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents#1.2.9 (node_modules\gulp\node_modules\fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents#1.2.9: wanted {"os":"darwin","arch":"any"} (current: {"os":"win32","arch":"x64"})
+ gulp#4.0.2
+ yo#3.1.0
updated 2 packages in 23.31s
Run the following command to see where npm puts global packages
npm config get prefix
You'll get output similar to this
/usr/local/Cellar/node/10.5.0_1
Copy the output or path and then using any code editor open your .bashrc or .zshrc file depending on the terminal you use and paste like so
export PATH="$PATH:"/usr/local/Cellar/node/10.5.0_1/bin/""
Then after saving run
source ~/.zshrc
Like Xander Cage said.
I have uninstalled node.js -> procedure here
I have restarted my PC.
Then I installed again node.js
It work.
The above didn't work for me at all.
The following solved my problem:
clean installed nodejs and followed steps by dv-here in thread: https://github.com/zkat/npx/issues/100
Note that my npm kept pointing to C:\usr...
I think I set the npm config set prefix= to something mistakenly due to which I was >getting the error. Here's how I fixed it:
Open CMD in "Administrator" mode.
npm cache clear --force
npm install
npm config set cache C:\Users\myname\AppData\Roaming\npm-cache
npm config set prefix C:\Users\myname\AppData\Roaming\npm
I just ran into this issue on MacOS, and saw that all of my global npm binaries were symlinked into the /usr/local/bin directory, except for yo. I created a symlink using this command:
ln -s /usr/local/Cellar/node/12.10.0/bin/yo /usr/local/bin/yo
(Yours may vary)
And yo is now callable.
I had same issue and I really didn't want uninstall nodejs as I have a lot of package installed.
Tried also with the second answer and did not worked.
Then I found this ticked, that is been closed:
https://github.com/yeoman/yeoman/issues/1716
install with yarn command for me worked.
yarn global add yo
Seem then the installation went through with also binary installed.
Nevermind try to install it with npm getting same error, so looking for provide more infos

Ionic - app hangs on splash screen

My ionic app is hanging on the splash screen - it was working fine and then I added some code, and went to test, and it's getting stuck.
It gets to this point:
------ Debug phase ------
Starting debug of 2e5ac6066864be48322a757c4d0ccdfde52cf356 (N51AP, iPhone 5s (GSM), iphoneos, arm64) a.k.a. 'Eamon White’s iPhone' connected through USB...
[ 0%] Looking up developer disk image
[ 90%] Mounting developer disk image
[ 95%] Developer disk image already mounted
[100%] Connecting to remote debug server
-------------------------
(lldb) command source -s 0 '/tmp/2F06F4BB-A7E5-4B97-87EC-A01CBEE5661A/fruitstrap-lldb-prep-cmds-2e5ac6066864be48322a757c4d0ccdfde52cf356'
Executing commands in '/tmp/2F06F4BB-A7E5-4B97-87EC-A01CBEE5661A/fruitstrap-lldb-prep-cmds-2e5ac6066864be48322a757c4d0ccdfde52cf356'.
(lldb) platform select remote-ios --sysroot '/Users/eamonwhite/Library/Developer/Xcode/iOS DeviceSupport/10.3.3 (14G60)/Symbols'
Platform: remote-ios
Connected: no
SDK Path: "/Users/eamonwhite/Library/Developer/Xcode/iOS DeviceSupport/10.3.3 (14G60)/Symbols"
(lldb) target create "/Users/eamonwhite/ionicmane/myapp/platforms/ios/build/device/myApp.app"
Current executable set to '/Users/eamonwhite/ionicmane/myapp/platforms/ios/build/device/myApp.app' (arm64).
(lldb) script fruitstrap_device_app="/private/var/containers/Bundle/Application/5EBCC0EF-FDB9-4DE7-A961-D91B6139AEA0/myApp.app"
(lldb) script fruitstrap_connect_url="connect://127.0.0.1:50188"
(lldb) target modules search-paths add /usr "/Users/eamonwhite/Library/Developer/Xcode/iOS DeviceSupport/10.3.3 (14G60)/Symbols/usr" /System "/Users/eamonwhite/Library/Developer/Xcode/iOS DeviceSupport/10.3.3 (14G60)/Symbols/System" "/private/var/containers/Bundle/Application/5EBCC0EF-FDB9-4DE7-A961-D91B6139AEA0" "/Users/eamonwhite/ionicmane/myapp/platforms/ios/build/device" "/var/containers/Bundle/Application/5EBCC0EF-FDB9-4DE7-A961-D91B6139AEA0" "/Users/eamonwhite/ionicmane/myapp/platforms/ios/build/device" /Developer "/Users/eamonwhite/Library/Developer/Xcode/iOS DeviceSupport/10.3.3 (14G60)/Symbols/Developer"
(lldb) command script import "/tmp/2F06F4BB-A7E5-4B97-87EC-A01CBEE5661A/fruitstrap_2e5ac6066864be48322a757c4d0ccdfde52cf356.py"
(lldb) command script add -f fruitstrap_2e5ac6066864be48322a757c4d0ccdfde52cf356.connect_command connect
(lldb) command script add -s asynchronous -f fruitstrap_2e5ac6066864be48322a757c4d0ccdfde52cf356.run_command run
(lldb) command script add -s asynchronous -f fruitstrap_2e5ac6066864be48322a757c4d0ccdfde52cf356.autoexit_command autoexit
(lldb) command script add -s asynchronous -f fruitstrap_2e5ac6066864be48322a757c4d0ccdfde52cf356.safequit_command safequit
(lldb) connect
(lldb) run
success
(lldb) safequit
Process 7681 detached
The deviceready message never comes.
One thing I did that is kind of relevant is, when I was building or something ionic asked me to upgrade ios-deploy from 1.9.1 to 1.9.2. I think this started happening after I did that. I try to revert back to 1.9.1 but it won't let me:
ld: framework not found MobileDevice
clang: error: linker command failed with exit code 1 (use -v to see invocation)
** BUILD FAILED **
The following build commands failed:
Ld build/Release/ios-deploy normal x86_64
(1 failure)
npm ERR! Darwin 17.0.0
npm ERR! argv "/usr/local/Cellar/node/7.7.3/bin/node" "/usr/local/bin/npm" "install" "-g" "ios-deploy#1.9.1"
npm ERR! node v7.7.3
npm ERR! npm v4.1.2
npm ERR! code ELIFECYCLE
npm ERR! ios-deploy#1.9.1 preinstall: `./src/scripts/check_reqs.js && xcodebuild`
npm ERR! Exit status 65
npm ERR!
npm ERR! Failed at the ios-deploy#1.9.1 preinstall script './src/scripts/check_reqs.js && xcodebuild'.
npm ERR! Make sure you have the latest version of node.js and npm installed.
npm ERR! If you do, this is most likely a problem with the ios-deploy package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! ./src/scripts/check_reqs.js && xcodebuild
npm ERR! You can get information on how to open an issue for this project with:
npm ERR! npm bugs ios-deploy
npm ERR! Or if that isn't available, you can get their info via:
npm ERR! npm owner ls ios-deploy
npm ERR! There is likely additional logging output above.
npm ERR! Please include the following file with any support request:
npm ERR! /Users/eamonwhite/Downloads/ionicmane-master/npm-debug.log
That might not be the problem. I could really use some help I'm close to a deadline.
UPDATE
When I try to run in xcode the same thing happens, but xcode gives these errors:
2017-10-10 15:49:17.417901-0400 myApp[8476:3520766] Resetting plugins due to page load.
2017-10-10 15:49:38.433127-0400 myApp[8476:3520766] Failed to load webpage with error: The request timed out.
UPDATE
I figured out what was causing this - it's livereload - if I run it without that its fine...but I kind of need it to work to develop.
I didn't have my wifi enabled on my phone so it couldn't connect to ionic.
From my experience we have the same issue deviceready is never shown in our console log, the most possible case would be inconsistency of the Cordova Plugin one thing that you could do is to reinstall the plugins and try to delete your platform folder and make a clean build with npm cache clean .
Update:
Based on your update , how are you running your ios app ?
Are you running your app using the -l -c commands like below:
ionic run ios -l -c
if that is the case you may be noticed that this command changes a line in the config.xml file:
// from
<content src="index.html"/>
// to
<content src="localhost//192.1.168.0:8000" original-src="index.html"/>
So Changing it back to <content src="index.html"/> might fixes the issue.
Solution 2:
You probably need to whitelist the localhost in the following way:
<allow-navigation href="http://localhost:8100/*"/>
My best guess is that your iPhone did not yet prepare the debugger for iOS11. It does so when running your app the first time on an new iOS version. You have to open and run your project once using XCode then you should be fine. Please also make sure you have the most recent version of cordova-ios which is 4.5.1 (check the <engine name=ios"> tag in your config.xml).
Check whether you have the following tag in your config.xml
<allow-navigation href="*"/>
Also can you check whether this is observed only in iOS or also in Android.
Ran into this with Ionic 4. After adding iOS platform, running the following worked:
ionic cordova prepare ios

Twitter-Node Failing to Build Node.js (npm install twitter-node)

I am trying to install "Twitter-Node" (npm install twitter-node). Version .3.2-pre of Node JS.
When I try and install I receive the follow error. Any thoughts on what I may be doing wrong? Seems like a pretty straight forward install to me. I was able successfully install socket-io too...
m ERR! Error: twitter-node#0.0.2 preinstall: `./build.sh`
npm ERR! `sh` failed with 1
npm ERR! at ChildProcess.<anonymous> (/usr/local/lib/node/.npm/npm/0.2.12- 1/package/lib/utils/exec.js:25:18)
npm ERR! at ChildProcess.emit (events.js:34:17)
npm ERR! at ChildProcess.onexit (child_process.js:164:12)
npm ERR!
npm ERR! Failed at the twitter-node#0.0.2 preinstall script.
npm ERR! This is most likely a problem with the twitter-node package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! ./build.sh
Simple solution
Just grab it from here:
https://github.com/patmcnally/twitter-node
The module on npm is old (last update August 31th) and broken by design, it compiles its own base64 encoder instead of using Node's built in functionality.
To install:
Download the archive and extract it
cd into the folder and run npm install .
Have a nice day :)
Old answer
The install runs gcc to compile a base64 module that depends on nodes Buffer class (the C++ implementation), since there were quite some changes to that in 3.x, it explodes!
Waf: Entering directory `/home/ivo/.local/lib/node/.npm/twitter-node/0.0.2/package/vendor/node-base64/build'
[1/2] cxx: base64.cc -> build/default/base64_1.o
../base64.cc: In function ‘v8::Handle<v8::Value> base64_encode_binding(const v8::Arguments&)’:
../base64.cc:178: error: ‘class node::Buffer’ has no member named ‘data’
../base64.cc:178: error: ‘class node::Buffer’ has no member named ‘length’
../base64.cc: In function ‘v8::Handle<v8::Value> base64_decode_binding(const v8::Arguments&)’:
../base64.cc:199: error: ‘class node::Buffer’ has no member named ‘data’
../base64.cc:199: error: ‘class node::Buffer’ has no member named ‘length’
Waf: Leaving directory `/home/ivo/.local/lib/node/.npm/twitter-node/0.0.2/package/vendor/node-base64/build'
Build failed: -> task failed (err #1):
{task: cxx base64.cc -> base64_1.o}
This commit removed the two members and replaced them with static inlined methods.
In .npm/twitter-node/0.0.2/package/vendor/node-base64/base64.cc you need to replace the lines 177/178 and 198/199 which look like this:
Buffer *buffer = ObjectWrap::Unwrap<Buffer>(args[0]->ToObject());
char *str = base64_encode((unsigned char*)buffer->data(), buffer->length(),&len);
With this:
Local<Object> buffer = args[0]->ToObject();
char *str = base64_encode((unsigned char*)Buffer::Data(buffer), Buffer::Length(buffer),&len);
Then run npm rebuild twitter-node and you're done! Don't use install, as it will re-download and overwrite the changes.
PS: I had to use require('twitter-node#0.0.2') to get it to import, since npm didn't create the symlink in .local/lib/node but you can easily fix that on your own.
Update
I did take a look at the module, this is hilarious, they compile a 80kb lib which is prone to failure with changed to Node.js just to use a base64 encode ONE TIME.
// Returns a Basic Auth header fit for HTTP.
var basicAuth = function basicAuth(user, pass) {
return "Basic " + b64.encode(user + ":" + pass);
};
This does the exact same thing and doesn't explode on every other change to Node.js:
new Buffer(user + ':' + pass).toString('base64')

Resources