Alamofire is not working - alamofire

I'm trying to install Alamofire onto my app, and I created a test app just in case, and no matter how many times I try and do it, it fails because there are like 250 errors all in the Alamofire section:
I've no idea what to do, I am stuck. I am still relatively new to coding, so I am not sure what to do here, but I was also wondering if there is a better thing to do rather then using Alamofire, because I have tried over 20 different apps to try and download Alamofire and they all have the same problem, as is seen above.

This could be caused by different swift versions vs different alamofire versions. For Swift 3 you need AlamoFire 4.3..
Also, try building your project with alamofire imported.
If that doesn't work and you're using CocoaPods then navigate to your app folder via terminal (cd /path/to/app) then do pod reinstall - make sure you have a podfile.

Related

React-Native, React-Native-Web and React-Navigation/Stack

Has anyone been able to get React-Native 0.7, React-Native-Web and React-Navigation/Stack 6.2.3 to work on web? I have a small app working on iOS and Android which I am trying to enable on web too. iOS and Android portion work fine and using metro.
However, webpack build continues to error out with "Module parse failed: Unexpected token" on the NavigationContainer.
I tried searching both react-native-web and react-navigation Issues on their respective GitHub Repositories. However, could not find something to solve my issue. Also tried modifying webpack.config with several different configurations/loaders.
Used links below as a reference too:
https://arry.medium.com/how-to-add-react-native-web-to-an-existing-react-native-project-eb98c952c12f
https://gist.github.com/skabbes/0bfa0a969aac8ec13f716dda1ad2ab43
Yes, it happens that I maintain a library that does just that: creates a bare React Native app that also runs on the web: 🌒 Luna - https://github.com/criszz77/luna
Here is the live example: https://criszz77.github.io/luna/
You can find more on the wiki page about how it's implemented and you can also implement it by yourself: https://github.com/criszz77/luna/wiki
By using react-scripts, you don't have to handle webpack, babel and other hard configs by yourself.
It currently doesn't run on 0.7 (didn't have time to make the update), but it's in plan to support all the latest versions of course ASAP.
EDIT: Updated to 0.70.3 🎉

how to add ios support for existing React Native application with only Android support?

I know it might be very basic question. But I am very new and got a codebase with only android support. I need to add iOS for it. Please help me
As you're aiming to build a cross-platform app, React Native provides two ways to organize the code and seperate it by platform: platform module or platform-specific file extensions.
As you already have an Android app, I assume it has more complexity so you might want to split the code out into separate files.
You say you have an Android app but i don't thing that at any point you specified that the app should only build for Android (you can review in the package and the project configuration). So, the following command should be enough:
react-native run-ios
If you created your react native app from a template (e.g. using npx react-native init ProjectName), it already provides an ios and android folder, so it already supports it. If the file is not there, you could follow the instructions that #Rajan shared above to recreate the ios folder.
If your problem is running the iOS application using npm run ios, and its failing to build or the javascript throws an error, the quickest thing to try is cd ios, then pod install. If this does not work, it might be because you have additional dependencies you have installed, which require specific instructions and configuration to be done in the ios folder. This is library dependent, if needed, will be explained in depth in the README.md of the library. For example, react-native-firebase has a lot of steps, and is different to the android configuration.
Sometimes it is helpful to modify these configurations in XCode instead of editing the files manually (e.g. plist, xml, xproj). You can open xcode quickly using xed ios when in the root project folder.
Note: As usual, remember to have the libraries available in the node_modules folder, npm install.
In the future, you might choose to run different javascript code based on the platform (platform-specific code). React native allows that by using file.android.js and file.ios.js. However, your IDE is likely to struggle with the 2 files, and won't be as helpful compared to file.js. Alternatively, you can import Platform and conditionally check at runtime, what your platform is.
If you used Expo, you don't have access to the native code, but will already support iOS.

Application is freeze when "this.props.navigation.navigate"

I am using expo 34 and I am tried with 32,33 and 31.
It works when I run it with Expo client on Ios Simulator but
In the "this.props.navigation.navigate" commands, the program freezes and the cpu rises.
I'm not getting a mistake either.
I have the same problem with Android tests.
Expo client version 2.12.1
I tried it separately on Windows and Apple operating systems to solve this problem, but the problem still persisted.
Not: In the meantime, the application I am talking about is now online.
I mean, he was definitely working before, but I can't even test him now.
You need to install that in your project.
npm install react-navigation --save
Also you need to pass in the view name. For example:
this.props.navigation.navigate('ViewName');

Adding React Native to an existing iOS app - fails to compile

I followed the official guide on adding React Native to existing iOS apps (Swift).
pod install finished successfully and I got to the point when I import React in a Swift file and try to compile the app.
The build fails with an error in the yoga dependency. Xcode cannot find the C++ standard library:
However, then I click "Go to definition" on <algorithm>, Xcode can find it:
These are my project settings (I tried a few different combinations):
I'm fairly new to iOS development, so this might be a simple issue with our existing project, Xcode, Command Line Tools, or my machine. I Googled around a bit, no luck so far.
Any help from someone familiar with iOS development is appreciated! When we find the solution I'd like to update the official guide so others don't get stuck adding React Native to their app.
I believe your issue is fixed by this PR https://github.com/facebook/react-native/pull/17764, which reduces the number of exported Yoga headers to those that are actually needed to be able to build and as part of that removes headers that require C++ and its stdlib.

Failed to build ios project with CorePlot

I'm new to ios. I want to use CorePlot in my project.
I followed the steps in the instruction from CorePlot wiki and tried to build my project by Xcode 3.2.2. But i got some errors like
"'CALayer' may not respond to '-encodeWithCoder:' ",
"'NSMutableSet' may not respond to '-sortedArrayUsingDescriptors:'".
I tried to build the examples in the coreplot source code package and got the same errors.
Anyone knows the reason? How can i solve these problems? Any help would be appreciated.
The latest Core Plot projects are set up for Xcode 4.2. You may have to adjust some of the build settings to get them to work in older versions. I don't have that version of Xcode installed any more, but the first thing I would check is to make sure the Base SDK is set to one that you have instead of the generic "Latest iOS".