I'm trying to develop a React Native mobile app for iOS on Windows 10. Using the react native cli, I've generated a RN iOS project with the standard file structure, including a "Podfile" file with the default RN pods.
However, when I try to use "pod install" in order to add other pods of my own, I get the following error code:
[!] CDN: trunk URL couldn't be downloaded: https://cdn.cocoapods.org/CocoaPods-version.yml Response: SSL peer certificate or SSH remote key was not OK
I've been googling this error but I've run into a dead end. I've tried using pod update, I've changed my cURL version, I've gone over the setup instructions for Ruby, curl, and others, and I'm at a loss. What can I do?
Note: I haven't run the app yet, and am trying to install the react-native-mapbox-gl pod first, but I can't even properly install Trunk.
cURL Version:7.70.0
CocoaPods Version: 1.9.3
You won't be able to develop for iOS on Windows – because the iOS SDK and build tools are only available on macOS. No way to legally do it without an access to an Apple computer.
You can try Expo though – it doesn't require macOS for development, but keep in mind that you will be limited to the APIs Expo provides.
As for the actual error – it seems that the CocoaPods rubygem has not been tested on Windows at all, and is likely invoking curl in a way that doesn't account for Windows's SSL certificate management system.
Related
I have a new flutter app. When i build it locally everything works. But I pushed it to the repository and it didn't pass the pipeline to build iOS app. The error:
Warning: CocoaPods not installed. Skipping pod install.
CocoaPods is used to retrieve the iOS and macOS platform side's plugin code that responds to your plugin usage on the Dart side.
Without CocoaPods, plugins will not work on iOS or macOS.
CocoaPods not installed or not in valid state.
Am I missing something? I saw similar posts and everyone said gem install cocoapods, but how can I install it if everything works fine locally and the problem is only in the repository build?
Getting a flipper error log while i am trying to run ios app from xcode.
flipper: Desktop failed to provide certificates. Error from flipper desktop:
rsocket::StreamInterruptedException: connection error
App is working smoothly, no issues found. But this log is coming in every 1 second.
Is there any way to fix this issue?
I had the same issue and I finally found a way to resolve this.
I assume you're getting this error when you try to debug your app with a real iOS device.
These are the steps I took.
You need to run Flipper Desktop on your background. It has an integrated React-devtools plugin. Download it from fbflipper.com. Follow the instructions on their docs it's simple and quite straightforward.
At this point you won't have the same error message. (It will say that the certificate is ok.) However, if you encounter any issues with idb binary location (which I did on my M1 machine), this new message will pop every second and Flipper interface will tell you that the device is not found. Just make sure to find the right idb binary location and configure it, restart Flipper, and this will be resolved one and for all. Mine was in "/opt/homebrew/bin/idb".
TL: DR;
idb_companion was built for newer Swift enviroments, but I was still using Big Sur. After upgrading my MacOS, Flipper managed to connect to my iOS device fine.
Of course I explain below that I build idb from the source to match the version 1.1.8 for both idb_companion and idb.
Below I also explain how I found the error that was crashing idb_companion preventing Flipper from maintaining a stable connection and restarting several times yielding the message: [conn] ... restarted 4 times in 20 seconds.
What I learned:
idb_companion runs on my Mac in the background as a server that knows how to control or get logs from iOS physical devices;
idb is a command line interface that Flipper can use for communicating with idb_companion.
I was able to install idb_companion#1.1.8 using Homebrew. But I was not able to install the same version 1.1.8 for the cli (aka idb (aka fb-idb)).
So I decided to build the idb from the github repo. The command line for building it was
pip3.9 install .
First I struggled with an error related to grpclib version. Apparently idb required the version 0.4.1 but I had 0.4.3 installed. To downgrade grpclib I used the following command:
pip3.9 install grpclib==0.4.1
I also tried to make sure there was no other grpclib installed in other python version, so I ran a bunch of
pip3 install grpclib==0.4.1
pip3.7 install grpclib==0.4.1
pip3.9 install grpclib==0.4.1
To see which version of python I had, I ran a bunch of
which pip
which pip3
which pip3.6
which pip3.7
which pip3.8
which pip3.9
which pip3.10
Anyways...
As I was randomly trying to build idb with those different python versions, with and without sudo, I also faced the following error, which was fixed just by adding sudo again to the build command.
ERROR: Could not install packages due to an OSError: [Errno 13] Permission denied: '/Users/alexandrelage/Library/Python/3.9/lib'
Check the permissions.
Anyways...
Basically after fixing the grpclib requirement, pip3.9 install . inside the source folder was enough for building idb (client, on version 1.1.8).
Of course I had to go to Flipper >> Settings and update the idb path. All seemed good.
Unfortunately that was not enough, Flipper kept on trying to connect to my iPhone device with no success. Then I copied the idb command Flipper was trying to run:
/Library/Frameworks/Python.framework/Versions/3.7/bin/idb file pull --log DEBUG --udid 00008020-000A7D2C36DUMMYDUMMY --bundle-id org.reactjs.native.example.MyExample 'Library/Application Support/sonar/app.csr' '/var/folders/r6/xrp3nw8j4wj45mvdpnlzlv740000gn/T/tmp-10199-CW6olKXUvwek/app.csr'
I was lucky to run the command above while I was also running idb_companion on another tab. The command I used to manually start idb_companion was:
idb_companion --uidid 00008020-000A7D2C36DUMMYDUMMY
I was lucky because I noticed the idb_companion tab stopped running when I tried to run the idb (client) command above I copied from Flipper. I restarted idb_companion again and tried to run the idb (client) command again. Then I realized idb_companion was crashing with an error message:
...
2022-10-21 18:14:11.853-0300 Starting swift server on tcp port 10882
2022-10-21 18:14:11.854-0300 Swift server started on [IPv6]::/:::10882
{"grpc_swift_port":10882,"grpc_port":10882}
2022-10-21 18:14:11.854-0300 Companion will stay alive if target goes offline
2022-10-21 18:14:30.997-0300 Start of connect
dyld: lazy symbol binding failed:
can't resolve symbol _$sScCMa in
/usr/local/Cellar/idb-companion/1.1.8/bin/../Frameworks/IDBGRPCSwift.framework/Versions/A/IDBGRPCSwift
because dependent dylib #rpath/libswift_Concurrency.dylib could not be loaded
dyld: can't resolve symbol _$sScCMa in
/usr/local/Cellar/idb-companion/1.1.8/bin/../Frameworks/IDBGRPCSwift.framework/Versions/A/IDBGRPCSwift
because dependent dylib #rpath/libswift_Concurrency.dylib could not be loaded
That indicated there was something else going on. It seemed idb_companion was built for a Swift environment different to mine. I looked for this error on Google and realized my XCode was outdated. In fact I was still using Big Sur.
Now I upgraded my MacOS to Montrey, Flipper manages to connect to my iOS device fine. And I haven't even upgraded my XCode yet.
Open Flipper > Settings > Enable physical iOS devices
Just grouping everything together, because I had a hard time with this issue...
Open Flipper. In the lower-left corner, click on the gear icon and then on Settings.
Be sure to enable the "Enable physical iOS devices" option.
On "IDB binary location", you'll probably see an alert sign (⚠️). If that is the case, it means you do not have an idb client or it is not right located.
Follow ALL these steps to install the idb companion and idb client.
If you do not have python install: brew install python3. Then try to repeat step 4.
If everything went right, your idb and idb-companion should be located at "/opt/homebrew/bin". So now you can go back to Flipper > Gear Icon > Settings, paste the path "/opt/homebrew/bin/idb" and the alert sign (⚠️) on the right will disappear.
If you still have the alert sign it means your idb file is not in the right location. There are several alternatives in this git post that solve this issue, so check them out.
So I have an app that I have been working on for a far few months now. I developed it on Ubuntu and tested on my android phone and tablet. The app is setup using the basic react native library and I also added in expo later on for some little thing expo had that I needed. Let me know if you need more information about this.
The app is 'feature complete' and just needs to be play tested and released. So naturally I need to get it up and running on iOS. I am currently renting a mac that I can remote into (as I own no apple products).
It has been nearly a week now and I just cannot move past this error (see bottom) (or variations of what seem to be the same/similar errors). I can build a fresh app on this mac so everything is there to build react native apps. I have tried: Deleting pod and and running
pod install
running
pod deintegrate && pod install
deleting node modules and running
npm install
Initially I had an error complaining that some libraries were manually linked and this was bad so I unlinked them and now I get this error. I am opening that app using the workspace file when I run in xcode. I also get the error if running through command line i.e.
npx react-native run-ios
Using different simulators makes no difference...not sure if it is even getting that far in the build process for that to matter. I think this has something to do with the linking of RN libraries and this new auto link thing. Any thoughts? There are loads of posts with this error (or close to) that have all sorts of 'solutions', but none seem to make a difference. Overwhelmingly peoples solve this by pod install after deleting pod folder or running the pod deintegrate command. Looking at the error you can see that it prints out loads of libraries some of which I installed and others probably come with my 3rd party libraries, but some look like the core libraries and even low level looking ones that presumably RN is built on (but I honestly wouldn't know).
I was having issues before 'compiling' stuff and again I think it was to do with the linking.
Also, is there a 'react native' support service or something i.e. I pay some who knows apple and will just fix the damn thing for me
ERROR (scroll to the bottom for what is probably the important bit):
https://pastebin.com/HMdP4x3P
[EDIT]
I think this has something to do with my podfile: https://pastebin.com/5J7BbG2Q other pod files do not look like mine.
We use Swift package manager embedded in XCode for the dependencies in our project. Everything works fine when using it on the local machine. However when I try to build the project on our ci slaves I get the following error (when run from both XCode and the console) :
xcodebuild -resolvePackageDependencies
Resolve Package Graph
Fetching https://github.com/hmlongco/Resolver.git
xcodebuild: error: Could not resolve package dependencies:
An unknown error occurred
The difference between running it locally and on the ci slave is that the ci machines are configured behind a proxy. We already whitelisted all the URLs that were accessed when running this command, however the problem still persists. I couldn't find any detailed log about this error.
From examining the network packages sent when I run the command we can still see that some app is trying to access the direct URL instead of going through the proxy and here timeout is received. We only use public packages on github and there isn't any authentication needed.
From other side if the project is set up the old way using Package.swift and we run:
swift package resolve the dependencies are successfully resolved without errors.
I have already gone through the following but there wasn't any helpful solution:
Configuration for enterprise networks
XCode proxy settings
SPM in real life projects
Same issue on developer forum
SSH error resolving dependencies - no ssh dependencies
Also there isn't any documentation about how resolving the packages through XCode is different than using 'swift package'.
Currently I'm not sure whether it's possible to configure something so XCode uses the proxy settings for SPM or the Xcode SPM through proxy is just not supported. Any ideas? Any help is appreciated!
From what I just found, at least for Xcode 12.4, there's -scmProvider option for xcodebuild:
-scmProvider which implementation to use for Git operations (system/xcode)
If I guess it correctly, -scmProvider system would force xcodebuild use "system" git. That, in turn, in my case, makes it respect the git config settings I have, particularly proxies.
Hence, answering the original question, it's probably worth trying
xcodebuild -resolvePackageDependencies -scmProvider system
(as long as Git config is properly set up)
Turns out there was an easy fix if we just configure the proxy for using it with git:
Getting Git to work with a proxy server - fails with "Request timed out"
I've somehow found myself trying to build an app through bitrise to deploy to testflight. I'm a total novice at all of this, so apologies for what probably seems stupid.
Bitrise manages to build everything but then finally refuses to deploy, citing the following in the log:
[06:06:44]: [Transporter Error Output]: description length:10500450
[06:08:55]: [Transporter Error Output]: ERROR ITMS-90725: "SDK Version Issue. This app was built with the iOS 11.4 SDK. All iOS apps submitted to the App Store must be built with the iOS 11 SDK or later, included in Xcode 9 or later. Further, starting March 2019, all iOS apps submitted to the App Store must be built with the iOS 12.1 SDK or later, included in Xcode 10.1 or later."
[06:08:55]: Transporter transfer failed.
[06:08:55]:
[06:08:55]: description length:10500450
ERROR ITMS-90725: "SDK Version Issue. This app was built with the iOS 11.4 SDK. All iOS apps submitted to the App Store must be built with the iOS 11 SDK or later, included in Xcode 9 or later. Further, starting March 2019, all iOS apps submitted to the App Store must be built with the iOS 12.1 SDK or later, included in Xcode 10.1 or later."
Fine, I think, I'll clone the repo, open up the project in xcode and thereby update the sdk version. This just seems to mean more problems... When I try to build the project within Xcode, I encounter the following error:
Users/[...]/ios/Pods/Target Support Files/Pods-x/Pods-x.debug.xxconfig: unable to open file (in target "x" in project "x")(in target 'x')
In addition to this, there are a few issues, including:
The file "Pods-x.release.xcconfig" couldn't be opened because there is no such file.
If I ignore this error, push it and build it anew on bitrise, I get the following:
Resolving dependencies of `Podfile`
[!] CocoaPods could not find compatible versions for pod "DoubleConversion":
In snapshot (Podfile.lock):
DoubleConversion (from `../node_modules/react-native/third-party-podspecs/DoubleConversion.podspec`)
In Podfile:
DoubleConversion (from `../node_modules/react-native/third-party-podspecs/DoubleConversion.podspec`)
None of your spec sources contain a spec satisfying the dependencies: `DoubleConversion (from `../node_modules/react-native/third-party-podspecs/DoubleConversion.podspec`), DoubleConversion (from `../node_modules/react-native/third-party-podspecs/DoubleConversion.podspec`)`.
You have either:
* out-of-date source repos which you can update with `pod repo update` or with `pod install --repo-update`.
* mistyped the name or version.
* not added the source repo that hosts the Podspec to your Podfile.
Note: as of CocoaPods 1.0, `pod repo update` does not happen on `pod install` by default.
So, it's looking like there's something badly amiss with the CocoaPods installation. And indeed, when I check into the files, there is no Pods folder at all -- just Podfile and Podfile.lock. (I have no idea how it would have build fine previously without this?)
So, I try to reinstall CocoaPods into the project, by running pod install from a terminal in the iOS folder. I get that same error in the terminal: No such file or directory # rb_sysopen -- /Users/[...]DoubleConversion.podspec. pod update generates the same error. In addition, I'm told there's a new version of CocoaPods available. I install it using sudo gem install cocoapods, which generates a Pods folder with subfolders in ios, but all are empty.
As you can tell, I'm a bit baffled. If an intrinsic part of CocoaPods functionality is missing from the project files, how did it ever build previously? I'm guessing it's due to CocoaPods being installed as part of the bitrise workflow (and it is indeed there) -- but, if so, what about that is now causing it to fail during build? What is it about trying to open up the project to update the SDK used that is introducing this problem?
I'm sure all this seems a bit daft (at least I hope so). Thanks for your patience and any help would be enormously appreciated.