Cocoapods error installing libopencv-contrib - ios

I am using this opencv3 library for react native, but when I try to install IOS dependencies using pod install i recieve this error, can someone help me?
[!] Error installing libopencv-contrib
[!] /usr/bin/unzip /var/folders/hj/5y2w85bn64n0t7mmzcc9rtbc0000gn/T/d20200815-25128-1yye817/file.zip -d /var/folders/hj/5y2w85bn64n0t7mmzcc9rtbc0000gn/T/d20200815-25128-1yye817
Archive: /var/folders/hj/5y2w85bn64n0t7mmzcc9rtbc0000gn/T/d20200815-25128-1yye817/file.zip
End-of-central-directory signature not found. Either this file is not
a zipfile, or it constitutes one disk of a multi-part archive. In the
latter case the central directory and zipfile comment will be found on
the last disk(s) of this archive.
unzip: cannot find zipfile directory in one of /var/folders/hj/5y2w85bn64n0t7mmzcc9rtbc0000gn/T/d20200815-25128-1yye817/file.zip or
/var/folders/hj/5y2w85bn64n0t7mmzcc9rtbc0000gn/T/d20200815-25128-1yye817/file.zip.zip, and cannot find /var/folders/hj/5y2w85bn64n0t7mmzcc9rtbc0000gn/T/d20200815-25128-1yye817/file.zip.ZIP, period.

The following silly fix solved the issue for me:
run pod spec edit libopencv-contrib
locate the source url (a dropbox link)
replace ?dl=0 with ?dl=1
save the file && run pod install
Now the installation should complete without errors.

Related

Can't build and run react-native project on Mac

Referring this issue, I've the same problem. I've MacOs El Captain on VMware.
Node v. 7.8.0
npm v.4.6.1
react-native-cli 2.0.1
react-native 0.46.4
Xcode v. 8.2.1
I've two issues:
- when trying to init a new react-native project, the packages fetching hangs on getting react-native 0.46.4 package from repo. Other packages were downloaded successfully. So I've execute npm install from Windows and then copied the node_modules folder on Mac.
- when trying to run the project on iOS simulator I recieve the following error:
** BUILD FAILED **
...
In file included from /Users/michelebombardi/Desktop/ReactNativeProjects/caliup/node_modules/react-native/React/../third-party/folly-2016.09.26.00/folly/Bits.h:70:
/Users/michelebombardi/Desktop/ReactNativeProjects/caliup/node_modules/react-native/React/../third-party/folly-2016.09.26.00/folly/detail/BitIteratorDetail.h:21:10: fatal error: 'boost/iterator/iterator_adaptor.hpp' file not found
#include <boost/iterator/iterator_adaptor.hpp>
The following build commands failed:
CompileC /Users/michelebombardi/Desktop/ReactNativeProjects/caliup/ios/build/Build/Intermediates/React.build/Debug-iphonesimulator/third-party.build/Objects-normal/x86_64/Conv.o /Users/michelebombardi/Desktop/ReactNativeProjects/caliup/node_modules/react-native/third-party/folly-2016.09.26.00/folly/Conv.cpp normal x86_64 c++ com.apple.compilers.llvm.clang.1_0.compiler
(1 failure)
Installing build/Build/Products/Debug-iphonesimulator/CaliUp.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/CaliUp.app/Info.plist
Print: Entry, ":CFBundleIdentifier", Does Not Exist`
I really need to publish my app on the app store before the end of the week.
I've already try all suggested solutions but nothin works.
Could anyone help me?
First try this:
watchman watch-del-all && rm -rf node_modules
If you install node using Homebrew uninstall it and install node from here.(https://nodejs.org/en/)
Now if you used yarn to install node modules:
Try npm install
This error is caused by a failed third party library download in the build step. In your home folder there should be a ~/.rncache directory with a number of compressed C++ libraries. The error occurs when one or more of these files fails to download completely from the github amazon s3 servers. (likely in China)
The problem sticks around because the script in the react-native xcode build doesn't know how to resume the broken download. So you can fix this by deleting your ~/.rncache folder and because these folders are extracted into your modules you should also rm -rf node_modules and reinstall.
More info can be found here and here
May be this will work. Try these steps:
Backup your icons, images etc from ios folder.
Check that app name is set for key "name" in {project-root}\app.json file.
Delete ios/ and android/ directories
Run react-native eject
Replace the icons,images etc you copied earlier
Run react-native link
Launch you app from Xcode using short cut key command+r

React-native - Build failed due to double-conversion

I have created new react-native project through terminal.
react-native init PlayWithAnimation
when I run the react-native app through Xcode. I got this error.
/bin/sh -c \"/Users/sumit/Desktop/React\ Native/RNN/ios/build/Build/Intermediates/React.build/Debug-iphonesimulator/double-conversion.build/Script-190EE32F1E6A43DE00A8543A.sh\"
/Users/sumit/Desktop/React >Native/RNN/ios/build/Build/Intermediates/React.build/Debug-iphonesimulator/double-conversion.build/Script-190EE32F1E6A43DE00A8543A.sh: line 2: cd: /Users/sumit/Desktop/React: No such file or directory
/Users/sumit/Desktop/React >Native/RNN/ios/build/Build/Intermediates/React.build/Debug-iphonesimulator/double-conversion.build/Script-190EE32F1E6A43DE00A8543A.sh: line 3: /Users/sumit/Desktop/React Native/RNN/node_modules/react-native/React/scripts/ios-install-third-party.sh: No such file or directory
/Users/sumit/Desktop/React
Native/RNN/ios/build/Build/Intermediates/React.build/Debug-iphonesimulator/double-conversion.build/Script-190EE32F1E6A43DE00A8543A.sh: line 3: exec: /Users/sumit/Desktop/React Native/RNN/node_modules/react-native/React/scripts/ios-install-third-party.sh: cannot execute: No such file or directory
The following build commands failed:
PhaseScriptExecution Install\ Third\ Party /Users/sumit/Desktop/React\
Native/RNN/ios/build/Build/Intermediates/React.build/Debug-iphonesimulator/double-conversion.build/Script-190EE32F1E6A43DE00A8543A.sh
(1 failure)
These are the version which I have used:
node v8.0.0
npm 5.0.3
react-native-cli: 2.0.1
react-native: 0.46.0
xcode 8.3.3
I have checked related to other stackoverflow Q & A but did't get proper solution.
Temporary Solution:
It works smoothly if I create react-native with version="0.44.0". But in version 0.45.0, 0.46.0, 0.47.0 builds are failed and same "double-conversion" issue is getting. And one more thing, when I create new project third-party directory is missing.
node_modules/react-native/ (missing third-party directory)
What would be the problem ?
Tried Solution 1:
I did the following steps:
download the files needed inside the .sh, put it in the ~/.rncache/.
copy the downloaded files into node_modules/react-native/third-party/, ran tar -zxf *** to each file.
build again. But not worked.
Tried Solution 2:
Handling third party build error on react-native 0.46x.
and tried with github issue.
I was really excited to finally get started with React Native but this bug absolutely kills my ability to proceed. I'd really appreciate if someone could help me out with this.
Got the solution from jerry han here: The life saver
Hi Bala, As you can see the error log, That error was from ‘WhiteSpace’ on your working path.
Real Path : /Users/sumit/Desktop/React\ Native/
On cd cmd log : /Users/sumit/Desktop/React:
You should rename your working path to ‘/Users/sumit/Desktop/react_native’.
That will be helpful for you.
With developing or operation work, you may be better not to use ‘space’ on the path.
For me, what worked was just updating the Code Signing preference in Xcode to something different and back again.
E.g. I have Automatically manage signing originally turned on. Turning that off and back on again seems to resolve this issue.

Error installing grails with SDK - Curl issue

I am having trouble installing Grails via SDK.I installed SDK via the instruction on https://grails.org/download.html#sdkman and sdk installed correctly
$ sdk version
SDKMAN 5.1.4+78`
But when I executed
$ sdk install grails
I am getting output in the terminal
$ sdk install grails
Downloading: grails 3.2.0.RC2
In progress...
######################################################################## 100.0%
curl: (56) SSLRead() return error -36
End-of-central-directory signature not found. Either this file is not
a zipfile, or it constitutes one disk of a multi-part archive. In the
latter case the central directory and zipfile comment will be found on
the last disk(s) of this archive.
unzip: cannot find zipfile directory in one of /Users/hwmehwme/.sdkman/archives/grails-3.2.0.RC2.zip or
/Users/hwmehwme/.sdkman/archives/grails-3.2.0.RC2.zip.zip, and cannot find /Users/hwmehwme/.sdkman/archives/grails-3.2.0.RC2.zip.ZIP, period.
Stop! The archive was corrupt and has been removed! Please try installing again.
I do restarting the terminal and installed again but same issue again.
What am I missing in installation? is there other dependency is needed ? Any help is much appreciated!

Error when installing RestKit without CocoaPods

I'm new to RestKit and I'm trying to add it to my existing iOS Project - following this tutorial.
After installing it as a Git submodule (I'm not using CocoaPods as I already have multiple plugins manually setup) and adding the linker flags, search paths, I'm not able to build it.
Nothing appears in the Issue Navigator, but on the Report navigator I get these errors:
(Check Dependencies)
The file "Pods-RestKit.debug.xconfig" couldn't be opened because there is no such file.
(Run custom shell script 'Check Pods Manifest.lock')
Diff: /../Podfile.lock: No such file or directory
Diff: /Manifest.lock: No such file or directory
The sandbox is not in synch with the Podfile.lock. Run 'pod install' or update your CocoaPods Installation.
After this I tried to run 'pod install' in the subdirectory for RestKit, it installed with success, and when I then try to run the project, I get a 'normal' error that says:
error: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/libtool: can't locate file for: -lPods-RestKit
error: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/libtool: file: -lPods-RestKit is not an object file (not allowed in a library)
Been stuck at this for a week so would really appreciate any assistance - I've tried researching extensively online but can't find any solution this this.

How to correctly create carthage cartfile?

I'm looking into cartfile. Can't wait to "simply create a cartfile" like all the instructions say to do.
Only... how do you "simply" create a Cartfile?
I've created a plain text document, named it cartfile and copied some dependencies in it.
Ran carthage update inside my root project directory
Get this error: "No such file in directory"
Downloaded an example carthage project and the Cartfile is actually an executable.. So how do I "simply create" a Cartfile, cause there aren't any instructions on how to
From the command line, navigate to your project directory.
touch Cartfile
Now the Cartfile is created, make it executable with:
chmod +x [YourDirectory/Cartfile]
You can open it with any text editor. Then insert whatever library and source you want (Example: github "SwiftyJSON/SwiftyJSON" >= 2.1.2)
Carthage Tutorial: Getting Started is a must read. It explains things much better than the Carthage documentation does.
Steps
In a Terminal, cd to the root directory of the project that you want to add the framework to. This should be the same directory as your *.xcodeproj file.
cd ~/Path/To/Your/Project/
Create an empty file called Cartfile like this:
touch Cartfile
Open that file with Xcode:
open -a Xcode Cartfile
Paste the framework info that you need into the Cartfile. For example:
github "stephencelis/SQLite.swift" ~> 0.10.1
Close the file in Xcode and in Terminal run the following command to make Carthage update the dependencies in your project. (You should still be in the same directory as your Cartfile.)
carthage update --platform iOS
Notes
Using the method above, there is no need to change the execution permissions of the Cartfile.
You will still need to add the framework link to your project before you can use it. See the tutorial I linked to at the top for more information.
Install by running below command if carthage is not installed.
brew install carthage
if you are using for the first time carthage
download the package first
Download the latest Carthage pkg and of course run it to install it.
and follow above steps
2 In a Terminal, cd to the root directory of the project that you want to add the framework to. This should be the same directory as your *.xcodeproj file.
cd ~/Path/To/Your/Project/
Create an empty file called Cartfile like this:
touch Cartfile
4.Open that file with Xcode:
open -a Xcode Cartfile
5.Paste the framework info that you need into the Cartfile. For example:
github "stephencelis/SQLite.swift" ~> 0.10.1
6.Close the file in Xcode and in Terminal run the following command to make Carthage update the dependencies in your project. (You should still be in the same directory as your Cartfile.)
carthage update --platform iOS
Cartfile is a usual text file without any extensions. You can create it using any possibilities like command line or any applications. This file is case sensitive.
If you create cartfile(from lower case) or Cartfile.txt(with extension) and run carthage update you get something like this:
2021-04-23 17:00:27.692 carthage[94911:3694738] INFO: fetch-response is unable to open the file /Users/alex/Library/Caches/carthage/fsCachedData/F1841822-AACC-4E8A-ACB0-D801D3C72063. Errno: 2
Failed to read file or folder at <some_path>/Cartfile: Error Domain=NSCocoaErrorDomain Code=260 "The file “Cartfile” couldn’t be opened because there is no such file." UserInfo={NSFilePath=<some_path>/Cartfile, NSUnderlyingError=0x7ff8f7727240 {Error Domain=NSPOSIXErrorDomain Code=2 "No such file or directory"}}
To check extension
Right click on Cartfile -> Get Info -> [Name & Extension:]
//you are able to remove the extension here

Resources