Quantcast
Channel: Active questions tagged react-native+ios - Stack Overflow
Viewing all 16548 articles
Browse latest View live

Building old version of React-Native app with Xcode 11

$
0
0

I just started working on an already existing React-Native app that needs a really small update, but that has not been updated since October 2019.

The first thing I need, in order to start updating it, is to build the app. That is where I cannot find a way to do it.

At the moment, I’m trying to build the app only on iOS and not on Android.

First of all the current toolset versions I’m using are:

React-Native version: 0.53.3Xcode version: 11.4.1iOS SDK: 13.4Node version: 8.16.6NPM version: 6.14.1

I initially had problem with third-party tools, but I managed to fix it through manually installing them in the node-modules/react-native folder.

Now I’m getting errors about Xcode not finding headers of the modules the app is using like, for example, React/RCTViewManager.h file not foundOr, similarly, the GoogleSignIn.h headers in the RNGoogleSignIn module

I believe it’s just an error of how libraries are imported in Xcode, because as a test I have created a new react-native “test app” with the same exact versions of react-native and node, then I installed the core dependencies needed to perform the update on the original app, and I managed to build it without problems.

I’ve also tested building the app on an old Mac with macOS 10.14, using Xcode 9, but I’ve got different errors, always related to importing headers of modules. This is the toolkits versions of the “old Mac”:

React-Native version: 0.53.3Xcode version: 9.4.1iOS SDK: 11.3Node version: 8.16.6NPM version: 6.14.1

Searching online I know that some of the problems I have faced (like the third-party react-native manual install) have been fixed in react-native updates, but I’m not expert enough with the technology to be sure that I can handle the update process without introducing bugs. I would prefer to just make this version run for now and facing the updating process later.

Do you have any suggestion of things about what I can do in order to successfully build the app?



Open react native project in xcode

$
0
0

I'm sure I'm missing something simple. I have a React Native project working and I'm attempting to get it on the app stores. Following those instructions, after I have created my provisioning profile in the Apple Developer Dashboard, it says to double click the developer provisioning profile to launch xcode. It's these instructions exactly:

Now find the files you just downloaded on your computer, and double-click each of them in turn, causing Xcode to launch. Verify the profiles are there by opening a project or starting a new one for this test.

So I double-click my file, and xcode does launch but no windows open up. I do not have an xcode project for my react native app so I have nothing to open. There is no menus for 'build settings' or 'general' so I'm not sure how to proceed.

For reference, here is my react native directory structure:

my_project/    .expo/    assets/    node_modules/    src/    .bablerc    .gitignore    App.js    app.json    package-lock.json    package.json    README.md

Did I miss a step somewhere? How do I get an xcode project from this?

Can't see time at the top of my app because the top bar is dark

$
0
0

So this is a pretty dumb question. But the color scheme of the app includes a lot of black, including the top bar, this hides the black characters of the time. Is there any way to get the time to show up white instead of black specifically for this app? Or should I just change the color scheme.

Clear Xcode Compile Warnings

$
0
0

The app I'm building is currently out for beta testing, in the meantime I'd like to get rid of the 90+ compile warnings.

Is it just a case of manually going through each warning and correcting it, or is there a quicker/better way? I've reviewed some of the warnings and can't seem to correct them.

Example of Errors

How can I get the log of a TestFlight app from xcode

$
0
0

I am building a react native app and I would like to see the logs of a release build in ios.

Is it possible to get the console.log of a TestFlight app from xcode, like in development mode?

Thanks for your help

Exiting because upload-symbols was run in validation mode

$
0
0

Im trying to add Fabric to my xcode project. I've done so succesfully in the past but now facing issues with a react-native project. Having looked around, i've tried pretty much all combinations suggested out there. My setup looks like so:

enter image description here

I've also tried the Pods version using "${PODS_ROOT}/Fabric/run" however no matter what i do im unable to proceed from the Add Run Script step.

In attempt to try and debug i've directed the output of what the Fabric command produces to a file. It yields the following:

Running upload-symbols in Build Phase mode Validating build environment for Crashlytics... Validation succeeded. Exiting because upload-symbols was run in validation mode

Any help much appreciated. Im very unsure as to how to take it from here

ADDITIONAL_INFO:

I've reinstalled the Fabric Mac app from scratch, restarted both xcode,fabric app and the whole system in general. Tried building in release mode and have pretty much tried everything here:

Crashlytics in iOS won't proceed past "Build Your Project" in Fabric app

How to create a distributive react-native app for iOS?

$
0
0

I have created a react-native app using the tools - VS Code, expo, react-native.

I am able to run the app on expo client as well as xcode simulator easily on my laptop. What I want now is to make a distributive file for iOS like we have .apk for androids for this app.

I referred to this question How to build .ipa application for react-native-ios?

and tried

react-native run-ios --configuration=release

but I get an error:

Error iOS project folder not found. Are you sure this is a React Native project?

Don't know what I am missing here? I am a beginner with react-native, would really appreciate any help on this.

Why does React Native iOS emulator's reload shortcut sometimes stop working?

$
0
0

Occasionally the Cmd+R keyboard shortcut to reload the React Native iOS emulator stops working. The Cmd+D command to open the developer menu still works, and I can reload from there, and when I close and re-run the emulator Cmd+R works again, but I'm just curious why it might be that it stops working.

Does anyone have any insight?


Is it possible to build an Android SDK and iOS SDK using React Native?

$
0
0

In my company we are building Android SDKs and iOS SDKs. The reason why we are building SDKs is because we don't want to give away our code and methods to ours customers, we just want to hide how we connect to some services.

So i would like to know if is it possible to build an Android SDK and iOS SDK using React Native?, in the end you have to compile the code in order to create Android and iOS versions.

Thanks!

drawerLockMode : 'locked-closed' not working directly with createStackNavigator

$
0
0

When I specify drawerLockMode direactly with createStackNavigator it is not working.

const drawerStack = createStackNavigator({  HomeScreen: { screen: HomeScreen },}, {  headerMode: 'screen',  navigationOptions: {    drawerLockMode:'locked-closed'  }})

But when I use drawerStack variable to define navigationOptions, it is working.

drawerStack.navigationOptions = ({ navigation }) => {    drawerLockMode = 'locked-closed';    return {       drawerLockMode,    };};

Am I doing any mistake when I am directly using it inside createStackNavigator?

Update

As @bennygenel suggested, we need to user drawerLockMode in drawerNavigator instead of stackNavigator. Here is what i have done.

const drawerNavigator = createDrawerNavigator({    drawerStack: drawerStack}, {    contentComponent: DrawerComponent,    navigationOpions:{       drawerLockMode:'locked-closed'    }})

But it is not working in this way also. The only way it is working is by using the const variable created using createStackNavigator or createDrawerNavigator

Any Drag & Drop app front-end creator with code [closed]

$
0
0

I am a Laravel backend developer and just finished creating the API for my App. I have no knowledge about front-end designing.

I Just want to ask that is there any service or software where I can design the front-end (UI etc) of my app and it throws me the code? So I can integrate my API with that.Any paid/free service like that? Thanks

Integrating a react-native app in iOS project

$
0
0

Looking at these docs keeping in mind I am using RN 62.2 Adding a react-native plugin(app) to iOS app, there is a Ultimately, your Podfile should look something similar to this section that shows what the podfile of our ios app needs to contain. It gives local paths to the dependencies needed for React-Native to run. That being said my team works on a project that distributes a react-native app as a plugin and we have to host the specs on repo. In the integrating app we can add the repo as a source at the top. Our integrating app has its own podspec that says what it needs and it uses the repo to get all of those pods installed. Here is an example of a dev repo for the specs that I push to specs repo. With react-native@58.* it looked like this

  # React is split into a set of subspecs, these are the essentials  s.dependency 'React/Core', react_native_version  s.dependency 'React/CxxBridge', react_native_version  s.dependency 'React/RCTActionSheet', react_native_version  s.dependency 'React/RCTAnimation', react_native_version  s.dependency 'React/RCTImage', react_native_version  s.dependency 'React/RCTLinkingIOS', react_native_version  s.dependency 'React/RCTNetwork', react_native_version  s.dependency 'React/RCTText', react_native_version  # React's Dependencies  s.dependency 'yoga', "#{react_native_version}.React"  react_podspecs = ['../node_modules/react-native/third-party-podspecs/DoubleConversion.podspec','../node_modules/react-native/third-party-podspecs/Folly.podspec','../node_modules/react-native/third-party-podspecs/glog.podspec'  ]  # Native Dependencies  dep_podspecs = [    # CodePush'../node_modules/react-native-code-push/CodePush.podspec',    # ReactNativeI18N'../node_modules/react-native-i18n/RNI18N.podspec',    # ReactNativeAwesomeCardIO'../node_modules/react-native-awesome-card-io/RNAwesomeCardIO.podspec',    # React Native SVG'../node_modules/react-native-svg/RNSVG.podspec',    # React Native Haptic Feedback'../node_modules/react-native-haptic-feedback/RNReactNativeHapticFeedback.podspec',    # @Paciolan/react-native-payments'../node_modules/@paciolan/react-native-payments/lib/ios/ReactNativePayments.podspec',    # React Native Webview'../node_modules/react-native-webview/react-native-webview.podspec',    # React Native Device Info'../node_modules/react-native-device-info/RNDeviceInfo.podspec',    # React Native AsyncStorage'../node_modules/@react-native-community/async-storage/RNCAsyncStorage.podspec'  ]  # Ties the exact versions so host apps don't need to guess the version  # or have a potential mismatch  podspecs = react_podspecs + dep_podspecs  podspecs.each do |podspec_path|    spec = Pod::Specification.from_file podspec_path    s.dependency spec.name, "#{spec.version}"  end

But now the Podfile for a standalone app has changed dramatically. Do I need to explicity take every podspec file referenced in "Ultimately, your Podfile should look something similar to this" section of the first link and add it to the podspec of my plugin? Thats a lot of Pods.

Here is what I have so far in the podspec of my plugin.. basically trying to mimic the dependencies the standalone app requires.

  s.dependency "React-Core", react_native_version  s.dependency "React-Core/DevSupport", react_native_version  s.dependency "React-Core/RCTWebSocket", react_native_version  s.dependency "React-RCTActionSheet", react_native_version  s.dependency "React-RCTAnimation", react_native_version  s.dependency "React-RCTBlob", react_native_version  s.dependency "React-RCTImage", react_native_version  s.dependency "React-RCTLinking", react_native_version  s.dependency "React-RCTNetwork", react_native_version  s.dependency "React-RCTSettings", react_native_version  s.dependency "React-RCTText", react_native_version  s.dependency "React-RCTVibration", react_native_version  # React's Dependencies  react_podspecs = ['../node_modules/react-native/Libraries/FBLazyVector/FBLazyVector.podspec','../node_modules/react-native/Libraries/FBReactNativeSpec/FBReactNativeSpec.podspec','../node_modules/react-native/Libraries/RCTRequired/RCTRequired.podspec','../node_modules/react-native/Libraries/TypeSafety/RCTTypeSafety.podspec','../node_modules/react-native/third-party-podspecs/DoubleConversion.podspec','../node_modules/react-native/third-party-podspecs/Folly.podspec','../node_modules/react-native/third-party-podspecs/glog.podspec','../node_modules/react-native/ReactCommon/yoga/Yoga.podspec','../node_modules/react-native/React-Core.podspec',"../node_modules/react-native/ReactCommon/ReactCommon.podspec",    # '../node_modules/react-native/Libraries/ActionSheetIOS/React-RCTActionSheet.podspec',    # '../node_modules/react-native/Libraries/NativeAnimation/React-RCTAnimation.podspec',    # '../node_modules/react-native/Libraries/Blob/React-RCTBlob.podspec',    # '../node_modules/react-native/Libraries/Image/React-RCTImage.podspec',    # '../node_modules/react-native/Libraries/LinkingIOS/React-RCTLinking.podspec',    # '../node_modules/react-native/Libraries/Network/React-RCTNetwork.podspec',    # '../node_modules/react-native/Libraries/Settings/React-RCTSettings.podspec',    # '../node_modules/react-native/Libraries/Text/React-RCTText.podspec',    # '../node_modules/react-native/Libraries/Vibration/React-RCTVibration.podspec','../node_modules/react-native/ReactCommon/cxxreact/React-cxxreact.podspec','../node_modules/react-native/ReactCommon/jsi/React-jsi.podspec','../node_modules/react-native/ReactCommon/jsiexecutor/React-jsiexecutor.podspec','../node_modules/react-native/ReactCommon/jsinspector/React-jsinspector.podspec',  ]  # Native Dependencies  dep_podspecs = [    # CodePush'../node_modules/react-native-code-push/CodePush.podspec',    # ReactNativeI18N'../node_modules/react-native-i18n/RNI18N.podspec',    # ReactNativeAwesomeCardIO'../node_modules/react-native-awesome-card-io/RNAwesomeCardIO.podspec',    # React Native SVG'../node_modules/react-native-svg/RNSVG.podspec',    # React Native Haptic Feedback'../node_modules/react-native-haptic-feedback/RNReactNativeHapticFeedback.podspec',    # @Paciolan/react-native-payments'../node_modules/@paciolan/react-native-payments/lib/ios/ReactNativePayments.podspec',    # React Native Webview'../node_modules/react-native-webview/react-native-webview.podspec',    # React Native Device Info'../node_modules/react-native-device-info/RNDeviceInfo.podspec',    # React Native AsyncStorage'../node_modules/@react-native-community/async-storage/RNCAsyncStorage.podspec'  ]  # Ties the exact versions so host apps don't need to guess the version  # or have a potential mismatch  podspecs = react_podspecs + dep_podspecs  podspecs.each do |podspec_path|    spec = Pod::Specification.from_file podspec_path    s.dependency spec.name, "#{spec.version}"  end

However, all the s.dependency references dont download the source when I pod install, they just add a SupportFiles folder in the pod. Should they be explicitly listed as all the others? One of our tasks was to distribute our react-native plugin as a framework and we couldn't figure out how to combine into one framework. Now there will be even more frameworks fro every pod. Any thoughts, comments, etc. appreciated. Thanks for reading.

React Native: What is the difference between running app with Xcode vs `react-native run-ios`?

$
0
0

I know that clicking run in Xcode builds and runs the project. But running react-native run-ios also builds and runs it. What's the difference other than that Xcode has more specific error messages?

How to keep react-native app as LTR (right to left)

$
0
0

I have created a simple chat application with react-native, it looks very nice when the device language is left to right, but on devices with RTL (right to left) Language it looks very bad and layout is not responsive.

So how Can I forcefully keep it as LTR(left to right) even on devices with RTL languages like persian, arabic, dari, pashto, urdo..

OS pod install error. Module glog cannot be installed

$
0
0

I'am trying to upgrade "react-native" from "0.50.4" to "0.55".

When I run pod install, i receive an error

checking for a BSD-compatible install... /usr/local/bin/ginstall -cchecking whether build environment is sane... yeschecking for arm-apple-darwin-strip... nochecking for strip... stripchecking for a thread-safe mkdir -p... /usr/local/bin/gmkdir -pchecking for gawk... nochecking for mawk... nochecking for nawk... nochecking for awk... awkchecking whether make sets $(MAKE)... nochecking whether make supports nested variables... nochecking for arm-apple-darwin-gcc...  -arch armv7 -isysroot checking whether the C compiler works... noxcrun: error: invalid active developer path (/Library/Developer/CommandLineTools), missing xcrun at: /Library/Developer/CommandLineTools/usr/bin/xcrunxcrun: error: invalid active developer path (/Library/Developer/CommandLineTools), missing xcrun at: /Library/Developer/CommandLineTools/usr/bin/xcrun/Users/MacBook/Library/Caches/CocoaPods/Pods/Release/glog/0.3.4-1de0b/missing: Unknown `--is-lightweight' optionTry `/Users/MacBook/Library/Caches/CocoaPods/Pods/Release/glog/0.3.4-1de0b/missing --help' for more informationconfigure: WARNING: 'missing' script is too old or missingconfigure: error: in `/Users/MacBook/Library/Caches/CocoaPods/Pods/Release/glog/0.3.4-1de0b':configure: error: C compiler cannot create executablesSee `config.log' for more details[!] Automatically assigning platform `ios` with version `8.0` on target `quanta_react` because no platform was specified. Please specify a platform for this target in your Podfile. See `https://guides.cocoapods.org/syntax/podfile.html#platform`.

I am a beginner in react-native and I can not make a pod install in my iOS project.Thank you in advance.


How to keep react-native app as LTR (left to right)

$
0
0

I have created a simple chat application with react-native, it looks very nice when the device language is left to right, but on devices with RTL (right to left) Language it looks very bad and layout is not responsive.

So how Can I forcefully keep it as LTR(left to right) even on devices with RTL languages like persian, arabic, dari, pashto, urdo..

Cannot send push notifications iOS using APN Auth Key

$
0
0

I attempting to send a push notification to my react native project. When sending to single device (provided FCM Token), it thrown an error

Invalid APNs certificate. Check the certificate in Settings.

So my assumption is the notification message is even not yet sent to APN, which my device obviously will not gonna receive anything

Please help

edit

I already uploaded my APN Authentication Key. Firebase docs says that I need to use either APN Authentication Key or APN Certificates

How to detect Developer Options are enabled in react native?

$
0
0

For some security reasons i want to restrict the users who are enabled the developer options. How can i detect in react native?

Thanks in advance

React Native App crashes on Launch Screen on device

$
0
0

I'm starting with React Native, everything works fine in the iOS simulator. I decide to try it on a device.

The app launches, I can play with it, I close/reopen it around 4 or 5 times, and then somewhat randomly the app crashes on Launch Screen (the one with "Powered By React Native"). It just shows the screen, and the app crashes to the iPhone home screen.

Any idea how I can further debug that?

Edit: I added Bugsnag in my AppDelegate.m, but bugsnag doesn't detect anything when the app crashes.

- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions{  NSURL *jsCodeLocation;  [BugsnagReactNative start];  // Rest of code  }

React-native: How to build for ios from windows

$
0
0

We are starting to work with react-native at my company. We have one mac and the rest of the team is running on windows.

Is there a way to write the app on windows with the ios device connected to the windows machine or local wifi. Then launch the build on the mac (from the windows pc) and get the app launched on the ios device ? So it would like using the mac only as a build/package server.

Hope i am clear enought.

Thanks.

Viewing all 16548 articles
Browse latest View live


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>