I am currently building an app in React Native and using Auth0 for authentication. The configuration needs to use some variables inside the Android code. I do not know too much about deployment, but I would like to know what is the easiest way to substitute environment variables inside Android and iOS for different development and production.
How to use environment variables for Android and iOS in React Native?
Correct approach to specific style code for small and big iOS screen in React Native?
Is there an easy way to make a different style (like smaller and bigger buttons etc. ) for small size ios devices and the big ones in React Native? Like here (https://reactnative.dev/docs/platform-specific-code#platform-specific-extensions) when I need different styles for a specific platform iOS and Android in React Native?
Thanks
How do I send React Application context from non react class?
I need to update status changes like event between android and react native class?
public class MessagingService extends FirebaseMessagingService { @Override public void onMessageReceived(RemoteMessage remoteMessage) { Log.d(TAG, "Push Message Received "); buildLocalNotification(remoteMessage); } public void buildLocalNotification(RemoteMessage message) { ... FBMessagingHelper notificationHelper = new FBMessagingHelper(this.getApplication()); notificationHelper.showNotification(bundle); } }
How can I create a ReactApplicationContext
constructor as class is extended to FBMessingService?
FBMessagingHelper notificationHelper = new FBMessagingHelper(this.getApplication());// Getting Error as a parameter is not react app context
I need to update IN_VIDEO_PROGRESS
status
- Update to
Android
when video starts/stop byReact Native
. - Update to
React Native
when video starts/stop byAndroid
.
public class FBMessagingHelper extends ReactContextBaseJavaModule { private ReactApplicationContext mContext; private static boolean IN_VIDEO_PROGRESS = false; public FBMessagingHelper(ReactApplicationContext reactContext) { // Added into Native Modules mContext = applicationContext; }@ReactMethod public void onVideoProgress(Bolean status){ // ==== on videoProgress ==== IN_VIDEO_PROGRESS = status } @Nonnull @Override public String getName() { return "FBMessagingHelper"; } public void showCustomNotification(Bundle bundle) { if (!IN_VIDEO_PROGRESS && bundle.getString("category").equals("VIDEO") { IN_VIDEO_PROGRESS = true; // start FullScreenNotificationActivity } }}
Created Native Modules:
public class FBMessagingPackage implements ReactPackage{ @Override public List<NativeModule> createNativeModules(ReactApplicationContext reactContext) { List<NativeModule> modules = new ArrayList<>(); modules.add(new FBMessagingHelper(reactContext)); modules.add((NativeModule) new MessagingService(reactContext)); // Error: cannot be cast to nativeModule return modules; } ... ... }
yogakit/yogakit.modulemap' not found React Native
I create a new app using react native. When I try to run the app within an iOS emulator using Xcode I get the following error and the app doesn't run.
fatal error: module map file '/Users/rebekah/Library/Developer/Xcode/DerivedData/example-feduelzeswwgfqdrghxcxxfxavuz/Build/Products/Debug-iphonesimulator/YogaKit/YogaKit.modulemap' not found
I have tried to google this but have been unable to find a way to fix it, is there any way this can be fixed?
React native app stuck on splash screen on device but works in simulator
My React Native app works in the XCode simulator with no issues, but when I run in a physical device, my iPhone, there's a problem. The app launches and gets stuck on the React Native splash screen, the after 10-15 seconds the app crashes/closes. What's the cause of this and how can I prevent it?
React native flex box not using all available space
I have a layout that I want to make full screen. This is how it looks right now:
What I want is for the layout to take up all the space on the screen (so the submit button should be way down at the bottom). I'm trying to use {flex: 1}
but it's not working. Here's the code:
'use strict';const React = require('react-native');const { StyleSheet, Text, View, BackAndroid, TextInput, TouchableNativeFeedback, ScrollView} = React;const ActionButton = require('./action-button');module.exports = React.createClass({ handleBackButtonPress () { if (this.props.navigator) { this.props.navigator.pop(); return true; } return false; }, componentWillMount () { BackAndroid.addEventListener('hardwareBackPress', this.handleBackButtonPress); }, componentWillUnmount () { BackAndroid.removeEventListener('hardwareBackPress', this.handleBackButtonPress); }, onInputFocus (refName) { setTimeout(() => { let scrollResponder = this.refs.scrollView.getScrollResponder(); scrollResponder.scrollResponderScrollNativeHandleToKeyboard( React.findNodeHandle(this.refs[refName]), 0, true ); }, 50); }, render: function() { return (<ScrollView ref='scrollView' style={styles.scroller}><View style={styles.container}><View style={styles.header}><Text>New Post</Text><View style={styles.actions}><ActionButton handler={this.handleBackButtonPress} icon={'fontawesome|close'} size={15} width={15} height={15} /></View></View><View style={styles.content}><TextInput underlineColorAndroid={'white'} placeholder={'Who\'s your professor?'} ref='professor' onFocus={this.onInputFocus.bind(this, 'professor')} style={styles.professor} /><TextInput multiline={true} underlineColorAndroid={'white'} placeholder={'What do you think?'} ref='post' onFocus={this.onInputFocus.bind(this, 'post')} style={styles.post} /></View><View style={styles.footer}><TouchableNativeFeedback background={TouchableNativeFeedback.SelectableBackground()}><View style={{width: 50, height: 25, backgroundColor: 'green'}}><Text>Submit</Text></View></TouchableNativeFeedback></View></View></ScrollView> ); }});const styles = StyleSheet.create({ scroller: { flex: 1, flexDirection: 'column' }, container: { flex: 1, flexDirection: 'column', justifyContent: 'flex-start', backgroundColor: 'white', padding: 5, }, post: { flex: 3 }, professor: { flex: 1 }, actions: { flex: 1, flexDirection: 'row', justifyContent: 'flex-end', alignSelf: 'center' }, header: { flex: 1, padding: 5, flexDirection: 'row' }, content: { flex: 4 }, footer: { flex: 1 }});
From what I can see, I'm setting the flex property all the way down the view hierarchy but that still isn't doing anything (at the top level is a Navigator with {flex: 1} as well). Any suggestions?
React Native iOS starts the development server but never connects and then just crashes
So I run my react-native iOS app from Xcode or react-native run-ios like normal. The server starts and says "Loading dependency graph, done." as normal. The app boots up on the simulator and then stays on the splash screen for around 20 seconds then crashes. It never seems to be able to find the development server and it doesn't print any error in the console.
I haven't been able to solve this issue for the life of me today. I've tried every solution I can find. If someone has any insight, please let me know. Thanks!
What's the proper way of showing multiple type of rows on a react-native list view?
So what we want is something like:
In iOS we could use multiple cellIdentifier for each cell type to create performant listview.
What I have now is something like
render() { const dataBlob = [ { type: "address", data: { address, gotoEditAddress } }, { type: "deliveryTime", data: {...} }, { type: "cartSummary", data: {...} }, ...[items.map(item => {{ type: "item", data: {...} }})], { type: "paymentInformation", data: {...} }, { type: "paymentBreakdown", data: {...} }, { type: "promoCode", data: {...} }, ]; this._dataSource = this._dataSource.cloneWithRows(dataBlob); return (<ListView ref="ScrollView" renderRow={this._renderRow} dataSource={this._dataSource} /> );)
and on the renderRow method
_renderRow = (rowData) => { const { type, data } = rowData; if (type === "address") return <AddressRow {...data} />; if (type === "deliveryTime") return <DeliveryTimeRow {...data} />; if (type === "menuItem") return <MenuItemRow {...data} />; if (type === "cartSummary") return <CartSummaryRow {...data} />; if (type === "promoCode") return <PromoCodeRow {...data} />; if (type === "paymentInformation") return <PaymentRow {...data} />; if (type === "paymentBreakdown") return <PaymentBreakdownRow {...data} />; return null;};
The problem with the above code is that it's making the dataSource.rowHasChanged method to be really complicated to implement correctly.
and for some reason when I removed a row, in RN0.31 you will have some ui-defects as such:
How to go from one screen to another in react native expo project?
I have created an application using React native expo where I have two screens - Splash & Login. So, after the Splash screen appears for 3 seconds it goes to the Login Screen. Now, in the Login Screen I just want to perform a single task - by clicking the Sign in button I want to switch the login Screen back to the Splash Screen.Below I have provided the code of my three classes-
App.js
import React from 'react';import { StyleSheet, Text, View } from 'react-native';import store from './src/store';import {Provider} from 'react-redux';import Splash from './src/Splash';import Login from './src/Login';export default class App extends React.Component { constructor(props) { super(props); this.state ={currentScreen:'Splash'}; console.log('Start doing some tasks for about 3 seconds') setTimeout( ()=> { console.log('Done some tasks for about 3 second') this.setState({currentScreen: 'Login'}) } , 3000) } render() { const {currentScreen} = this.state; let mainScreen = currentScreen === 'Splash' ?<Splash/> : <Login/> return mainScreen }}
Login.js
import React, {Component} from 'react';import { StyleSheet, Text, View, Image, TouchableWithoutFeedback, StatusBar, TextInput, SafeAreaView, Keyboard, TouchableOpacity, KeyboardAvoidingView } from 'react-native'; class Login extends Component { render() { return (<SafeAreaView style={styles.container}><StatusBar barStyle="light-content"/><KeyboardAvoidingView behavior = "padding" style={styles.container}><TouchableWithoutFeedback style = {styles.container} onPress = {Keyboard.dismiss}><View style = {styles.logoContainer}><View style = {styles.logoContainer}><Text style={styles.title}> Account Information</Text></View><View style={styles.infoContainer}><TextInput style = {styles.input} placeholder = "Enter User name/Email" placeholderTextColor = 'rgba(255,255,255,0.8)' keyboardType = 'email-address' returnKeyType = 'next' autoCorrect= {false} onSubmitEditing = {() => this.refs.txtPassword.focus()} /><TextInput style = {styles.input} placeholder = "Enter Password" placeholderTextColor = 'rgba(255,255,255,0.8)' returnKeyType = 'go' autoCorrect= {false} ref = {"textPassword"} /><TouchableOpacity style={styles.buttonContainer}><Text style={styles.buttonText}>SIGN IN</Text></TouchableOpacity></View></View></TouchableWithoutFeedback></KeyboardAvoidingView></SafeAreaView> ); }}export default Login;
Splash.js
import React, {Component} from 'react';import { StyleSheet, Text, View } from 'react-native'; class Splash extends Component { render() { return (<View style={styles.container}><Text style={styles.title}>Hello Splash</Text></View> ); }}export default Splash;
Then I just installed the react navigation using the following command-
npm install --save react-navigation
And then followed the React native expo documantation-https://docs.expo.io/versions/latest/react-native/navigation/
But none of them was working according to the plan. So, I just need one easy solution to go from the Login screen to Splash screen by the Sign In button press. It would be very nice if anyone help me about this.
How can I run background tasks in React Native?
I've built a little iOS app in React Native that does location tracking, sending the lat/lng regularly to a server of the user's choosing. However this only works when the app is in the foreground. How can I run this task in the background when the user is in other apps?
React Native - iOS is not recognizing Branch Links
We are trying to analyze where the users come from with branch's getLatestReferringParams in React Native, however in iOS the params for ['+clicked_branch_link'] is always undefined when the actual sessions comes from a branch link, this problem is only happening with iOS (it's working with Android), and we have also tested trying to open this link via Chrome in the iPhone and it worked. I'm not completely sure if it's related to something going on with Safari or with the OS versions. Any guideline would be very welcome. Thanks Here is a small snippet of the code we are trying to implement
const lastParams = await branch.getLatestReferringParams() const comesFromBranchLink = lastParams['+clicked_branch_link'] # Giving us undefined when it comes from a branch link const isAReferralLink = lastParams['~feature'] === 'referral'
Edit: We tested again and basically it doesn't recognize the branch link, only if it comes from Google Chrome.
How to deploy arbitrary resources for React Native with CodePush
I'm using CodePush to deploy the js bundle and a couple of resources to my react-native iOS app. Instead of using the react-native bundler to collect all the static images from my project I have a build step that just copies a folder called "static" into release/assets. But beside the "static" folder I als have other folders in release/assets that contain images and videos wich are use dynamically in the app via uri (e.g. { uri: 'assets/images/myImage.jpg' }). When building the app in XCode I just include the assets folder in the package.
From the CodePush documentation I gather that deploying the release folder should update all my assets. But it doesn't.
I downloaded the xcappdata via XCode and there you can see, that CodePush downloaded everything and stored it in /Library/Application Support/CodePush/[id]/release. But it still doesn't show up in the app.
Any ideas? Do I misunderstand the functionality of CodePush?
React Native iOS Build Failure - White Screen of Doom
JS Developer here and have been diving into the world of Swift this past weekend (branching over from React Native). I've run into a road block at the moment and was hoping somebody in this community might be willing to share some insight.
At the moment I'm trying to launch an XCode simulator with my ejected React Native code. The code builds successfully and I can see the "LaunchScreen.storyboard" on load, but the application then freezes on a white screen.
The app successfully bundles (see screenshot attached), but there doesn't seem to be an explicit error indicating what the problem might be. I've tried launching React Dev Tools at the same time I've started the application, and have also tried adding "!use_frameworks" to my Podfile, along with a whole other host of potential solutions (but to no avail!).
Please see my LOGS below:
objc[3534]: Class MGLUserLocationHeadingBeamLayer is implemented in both /Users/xxxxx/Library/Developer/CoreSimulator/Devices/1FC4F19A-5BDB-45F5-8CE2-7AD117E5AB5C/data/Containers/Bundle/Application/5B8C7A6C-DAEE-4897-A490-B6DE05053D27/WeatherApp.app/Frameworks/Mapbox.framework/Mapbox (0x10fe2cd68) and /Users/xxxxx/Library/Developer/CoreSimulator/Devices/1FC4F19A-5BDB-45F5-8CE2-7AD117E5AB5C/data/Containers/Bundle/Application/5B8C7A6C-DAEE-4897-A490-B6DE05053D27/WeatherApp.app/WeatherApp (0x10d5e73e8). One of the two will be used. Which one is undefined.flipper: FlipperClient::addPlugin Inspectorflipper: FlipperClient::addPlugin Preferencesflipper: FlipperClient::addPlugin Reactflipper: FlipperClient::addPlugin Network2020-08-10 20:56:51.591510-0500 WeatherApp[3534:22039] [native] Running application WeatherApp ({ initialProps = { }; rootTag = 1;})2020-08-10 20:58:37.785353-0500 WeatherApp[3534:23623] [] nw_socket_handle_socket_event [C5.1:1] Socket SO_ERROR [61: Connection refused]2020-08-10 20:58:37.792114-0500 WeatherApp[3534:23623] [] nw_socket_handle_socket_event [C5.2:1] Socket SO_ERROR [61: Connection refused]2020-08-10 20:58:37.795488-0500 WeatherApp[3534:23615] [] nw_connection_get_connected_socket [C5] Client called nw_connection_get_connected_socket on unconnected nw_connection2020-08-10 20:58:37.796401-0500 WeatherApp[3534:23615] TCP Conn 0x600001b36100 Failed : error 0:61 [61]2020-08-10 20:58:38.099366-0500 WeatherApp[3534:23623] [native] Manifest does not exist - creating a new one.(null)2020-08-10 20:58:38.586201-0500 WeatherApp[3534:23668] [javascript] console.disableYellowBox has been deprecated and will be removed in a future release. Please use LogBox.ignoreAllLogs(value) instead.2020-08-10 20:58:38.608841-0500 WeatherApp[3534:22039] WARNING bundle NSBundle </Users/xxxxx/Library/Developer/CoreSimulator/Devices/1FC4F19A-5BDB-45F5-8CE2-7AD117E5AB5C/data/Containers/Bundle/Application/5B8C7A6C-DAEE-4897-A490-B6DE05053D27/WeatherApp.app> (loaded) version string (1.0) is not a valid semantic version string: http://semver.org2020-08-10 20:58:38.622498-0500 WeatherApp[3534:23668] [javascript] Running "WeatherApp" with {"rootTag":1,"initialProps":{}}
I would be grateful for any insight or direction, and thank you all so much for your help and support!
react-native ios icon Image.xcassets - distill failed for unknown reasons in xcode
I have macOS Catalina version 10.15 Beta (19A501i) in a virtual machine (VMware® Workstation 15 Pro version 15.5.1 build-15018445) Xcode version 11.3.1 (11C504)
Images.xcassets
and AppIcon
This is the Images.xcassets and the AppIcon.
Copy Bundle Resources in the Build Phases
How to install react-native-track-player
I tried to install the react-native-track-player in a bare (just react-native init) App.
After
yarn add react-native-track-playeryarn add react-native-swiftcd iospod instal
I got the message:
- [!] CocoaPods could not find compatible versions for pod "react-native-track-player":In Podfile:react-native-track-player (from
../node_modules/react-native-track-player
)Specs satisfying thereact-native-track-player (from
../node_modules/react-native-track-player)
dependency were found, but they required a higher minimum deployment target.
So I changed in the podfile
platform :ios, '9.0' to: platform :ios, '10.0'
and again
pod install
This results to the message:
- [!] Unable to determine Swift version for the following pods:
react-native-track-player
does not specify a Swift version and none of the targets (mist
) integrating it have theSWIFT_VERSION
attribute set. Please contact the author or set theSWIFT_VERSION
attribute in at least one of the targets that integrate this pod.
In the next step I added s.swift_version = '4.0' to the react-native-track-player.podspec file in the node_modules.
Now the react-native-track-player pod were generated with the warnings:
- [!] [Xcodeproj] Generated duplicate UUIDs:
PBXBuildFile -- Pods.xcodeproj/targets/buildConfigurationList:buildConfigurations:baseConfigurationReference:|,buildSettings:|,displayName:|,isa:|,name:|,,baseConfigurationReference:|,buildSettings:|,displayName:|,isa:|,name:|,,defaultConfigurationIsVisible:0,defaultConfigurationName:Release,displayName:ConfigurationList,isa:XCConfigurationList,,buildPhases:buildActionMask:2147483647,displayName:Headers,files:|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,isa:PBXHeadersBuildPhase,runOnlyForDeploymentPostprocessing:0,,buildActionMask:2147483647,displayName:Sources,files:|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,|,isa:PBXSourcesBuildPhase,runOnlyForDeploymentPostprocessing:0,,buildActionMask:2147483647,displayName:Frameworks,files:,isa:PBXFrameworksBuildPhase,runOnlyForDeploymentPostprocessing:0,,buildActionMask:2147483647,displayName:Copy generated compatibility header,files:,inputFileListPaths:,inputPaths:|,|,|,isa:PBXShellScriptBuildPhase,name:Copy generated compatibility header,outputFileListPaths:,outputPaths:|,|,|,runOnlyForDeploymentPostprocessing:0,shellPath:/bin/sh,shellScript:COMPATIBILITY_HEADER_PATH="${BUILT_PRODUCTS_DIR}/Swift Compatibility Header/${PRODUCT_MODULE_NAME}-Swift.h"MODULE_MAP_PATH="${BUILT_PRODUCTS_DIR}/${PRODUCT_MODULE_NAME}.modulemap"ditto "${DERIVED_SOURCES_DIR}/${PRODUCT_MODULE_NAME}-Swift.h" "${COMPATIBILITY_HEADER_PATH}"ditto "${PODS_ROOT}/Headers/Public/react_native_track_player/react-native-track-player.modulemap" "${MODULE_MAP_PATH}"ditto "${PODS_ROOT}/Headers/Public/react_native_track_player/react-native-track-player-umbrella.h" "${BUILT_PRODUCTS_DIR}"printf "\n\nmodule ${PRODUCT_MODULE_NAME}.Swift {\n header \"${COMPATIBILITY_HEADER_PATH}\"\n requires objc\n}\n" >> "${MODULE_MAP_PATH}",,buildRules:,dependencies:displayName:React,isa:PBXTargetDependency,,displayName:react-native-track-player,isa:PBXNativeTarget,name:react-native-track-player,packageProductDependencies:,productName:react-native-track-player,productReference:displayName:libreact-native-track-player.a,explicitFileType:archive.ar,includeInIndex:0,isa:PBXFileReference,name:libreact-native-track-player.a,path:libreact-native-track-player.a,sourceTree:BUILT_PRODUCTS_DIR,,productType:com.apple.product-type.l ............
So I added "install! 'cocoapods', :deterministic_uuids => false" to the podfile
Now pod install runs without warnings, but the build in xcode or react-native run-ios crashes with the error
- Command CompileSwiftSources failed with a nonzero exit code
This is my configuration:
System:OS: macOS 10.15.3CPU: (6) x64 Intel(R) Core(TM) i5-8500B CPU @ 3.00GHzMemory: 68.81 MB / 8.00 GBShell: 5.7.1 - /bin/zshBinaries:Node: 13.8.0 - /usr/local/bin/nodeYarn: 1.22.0 - /usr/local/bin/yarnnpm: 6.13.7 - /usr/local/bin/npmWatchman: 4.9.0 - /usr/local/bin/watchmanSDKs:iOS SDK:Platforms: iOS 13.2, DriverKit 19.0, macOS 10.15, tvOS 13.2, watchOS 6.1Android SDK:API Levels: 28, 29Build Tools: 28.0.3, 29.0.3System Images: android-28 | Intel x86 Atom_64, android-29 | Google Play Intel x86 AtomIDEs:Android Studio: 3.6 AI-192.7142.36.36.6200805Xcode: 11.3.1/11C504 - /usr/bin/xcodebuildnpmPackages:react: ^16.12.0 => 16.12.0react-native: 0.61.5 => 0.61.5npmGlobalPackages:react-native-cli: 2.0.1
and the packages.json file
{"name": "first","version": "0.0.1","private": true,"scripts": {"android": "react-native run-android","ios": "react-native run-ios","start": "react-native start","test": "jest","lint": "eslint ." },"dependencies": {"react": "16.9.0","react-native": "0.61.5","react-native-swift": "^1.2.2","react-native-track-player": "^1.2.2" },"devDependencies": {"@babel/core": "^7.8.4","@babel/runtime": "^7.8.4","@react-native-community/eslint-config": "^0.0.7","babel-jest": "^25.1.0","eslint": "^6.8.0","jest": "^25.1.0","metro-react-native-babel-preset": "^0.58.0","react-test-renderer": "16.9.0" },"jest": {"preset": "react-native" }}
and the ios/podfile
platform :ios, '10.0'require_relative '../node_modules/@react-native-community/cli-platform-ios/native_modules'install! 'cocoapods', :deterministic_uuids => falseuse_frameworks!target 'neu' do # Pods for neu pod 'FBLazyVector', :path => "../node_modules/react-native/Libraries/FBLazyVector" pod 'FBReactNativeSpec', :path => "../node_modules/react-native/Libraries/FBReactNativeSpec" pod 'RCTRequired', :path => "../node_modules/react-native/Libraries/RCTRequired" pod 'RCTTypeSafety', :path => "../node_modules/react-native/Libraries/TypeSafety" pod 'React', :path => '../node_modules/react-native/' pod 'React-Core', :path => '../node_modules/react-native/' pod 'React-CoreModules', :path => '../node_modules/react-native/React/CoreModules' pod 'React-Core/DevSupport', :path => '../node_modules/react-native/' pod 'React-RCTActionSheet', :path => '../node_modules/react-native/Libraries/ActionSheetIOS' pod 'React-RCTAnimation', :path => '../node_modules/react-native/Libraries/NativeAnimation' pod 'React-RCTBlob', :path => '../node_modules/react-native/Libraries/Blob' pod 'React-RCTImage', :path => '../node_modules/react-native/Libraries/Image' pod 'React-RCTLinking', :path => '../node_modules/react-native/Libraries/LinkingIOS' pod 'React-RCTNetwork', :path => '../node_modules/react-native/Libraries/Network' pod 'React-RCTSettings', :path => '../node_modules/react-native/Libraries/Settings' pod 'React-RCTText', :path => '../node_modules/react-native/Libraries/Text' pod 'React-RCTVibration', :path => '../node_modules/react-native/Libraries/Vibration' pod 'React-Core/RCTWebSocket', :path => '../node_modules/react-native/' pod 'React-cxxreact', :path => '../node_modules/react-native/ReactCommon/cxxreact' pod 'React-jsi', :path => '../node_modules/react-native/ReactCommon/jsi' pod 'React-jsiexecutor', :path => '../node_modules/react-native/ReactCommon/jsiexecutor' pod 'React-jsinspector', :path => '../node_modules/react-native/ReactCommon/jsinspector' pod 'ReactCommon/jscallinvoker', :path => "../node_modules/react-native/ReactCommon" pod 'ReactCommon/turbomodule/core', :path => "../node_modules/react-native/ReactCommon" pod 'Yoga', :path => '../node_modules/react-native/ReactCommon/yoga' pod 'DoubleConversion', :podspec => '../node_modules/react-native/third-party-podspecs/DoubleConversion.podspec' pod 'glog', :podspec => '../node_modules/react-native/third-party-podspecs/glog.podspec' pod 'Folly', :podspec => '../node_modules/react-native/third-party-podspecs/Folly.podspec' target 'neuTests' do inherit! :search_paths # Pods for testing end use_native_modules!endtarget 'neu-tvOS' do # Pods for neu-tvOS target 'neu-tvOSTests' do inherit! :search_paths # Pods for testing endend
I am stranded! Any ideas what's wrong?
React-Native run-ios error w/Andriod Studio Code
I am currently getting unwell because of the below error i get each time i try to run react-native created project. Sorry to past all these here. I thought it would aid in diagnosing the problem easily. I will appreciate if am aided.
Error:Ransfords-MacBook-Pro:NewsMedia ransford$ react-native run-iosinfo Found Xcode workspace "NewsMedia.xcworkspace"info Building (using "xcodebuild -workspace NewsMedia.xcworkspace -configuration Debug -scheme NewsMedia -destination id=F451841C-C075-4289-B03A-EDBE15B25EC3")...............................................................................................................................................................error Failed to build iOS project. We ran "xcodebuild" command but it exited with error code 65. To debug build logs further, consider building your app with Xcode.app, by opening NewsMedia.xcworkspace. Run CLI with --verbose flag for more details.Command line invocation:/Users/ransford/Downloads/Xcode-beta.app/Contents/Developer/usr/bin/xcodebuild -workspace NewsMedia.xcworkspace -configuration Debug -scheme NewsMedia -destination id=F451841C-C075-4289-B03A-EDBE15B25EC3
...
fatal error: too many errors emitted, stopping now [-ferror-limit=]20 errors generated.
warning: The iOS Simulator deployment target 'IPHONEOS_DEPLOYMENT_TARGET' is set to 6.0, but the range of supported deployment target versions is 9.0 to 14.0.99. (in target 'OpenSSL-Universal' from project 'Pods')warning: The iOS Simulator deployment target 'IPHONEOS_DEPLOYMENT_TARGET' is set to 8.0, but the range of supported deployment target versions is 9.0 to 14.0.99. (in target 'YogaKit' from project 'Pods')warning: The iOS Simulator deployment target 'IPHONEOS_DEPLOYMENT_TARGET' is set to 8.0, but the range of supported deployment target versions is 9.0 to 14.0.99. (in target 'boost-for-react-native' from project 'Pods')warning: The iOS Simulator deployment target 'IPHONEOS_DEPLOYMENT_TARGET' is set to 8.4, but the range of supported deployment target versions is 9.0 to 14.0.99. (in target 'Flipper-PeerTalk' from project 'Pods')warning: The iOS Simulator deployment target 'IPHONEOS_DEPLOYMENT_TARGET' is set to 8.0, but the range of supported deployment target versions is 9.0 to 14.0.99. (in target 'CocoaLibEvent' from project 'Pods')warning: The iOS Simulator deployment target 'IPHONEOS_DEPLOYMENT_TARGET' is set to 8.0, but the range of supported deployment target versions is 9.0 to 14.0.99. (in target 'Flipper' from project 'Pods')warning: The iOS Simulator deployment target 'IPHONEOS_DEPLOYMENT_TARGET' is set to 5.0, but the range of supported deployment target versions is 9.0 to 14.0.99. (in target 'CocoaAsyncSocket' from project 'Pods')warning: The iOS Simulator deployment target 'IPHONEOS_DEPLOYMENT_TARGET' is set to 8.0, but the range of supported deployment target versions is 9.0 to 14.0.99. (in target 'Flipper-DoubleConversion' from project 'Pods')warning: The iOS Simulator deployment target 'IPHONEOS_DEPLOYMENT_TARGET' is set to 8.0, but the range of supported deployment target versions is 9.0 to 14.0.99. (in target 'Flipper-Glog' from project 'Pods')warning: The iOS Simulator deployment target 'IPHONEOS_DEPLOYMENT_TARGET' is set to 8.0, but the range of supported deployment target versions is 9.0 to 14.0.99. (in target 'Flipper-RSocket' from project 'Pods')warning: no rule to process file '/Users/ransford/Documents/React Native Projects/NewsMedia/ios/Pods/Flipper-RSocket/rsocket/README.md' of type 'net.daringfireball.markdown' for architecture 'arm64' (in target 'Flipper-RSocket' from project 'Pods')warning: no rule to process file '/Users/ransford/Documents/React Native Projects/NewsMedia/ios/Pods/Flipper-RSocket/rsocket/benchmarks/CMakeLists.txt' of type 'text' for architecture 'arm64' (in target 'Flipper-RSocket' from project 'Pods')warning: no rule to process file '/Users/ransford/Documents/React Native Projects/NewsMedia/ios/Pods/Flipper-RSocket/rsocket/benchmarks/README.md' of type 'net.daringfireball.markdown' for architecture 'arm64' (in target 'Flipper-RSocket' from project 'Pods')warning: The iOS Simulator deployment target 'IPHONEOS_DEPLOYMENT_TARGET' is set to 8.0, but the range of supported deployment target versions is 9.0 to 14.0.99. (in target 'Flipper-Folly' from project 'Pods')
** BUILD FAILED **
The following build commands failed:CompileC /Users/ransford/Library/Developer/Xcode/DerivedData/NewsMedia-eoyvzektsxpbcbacskvnwykryelg/Build/Intermediates.noindex/Pods.build/Debug-iphonesimulator/glog.build/Objects-normal/arm64/vlog_is_on.o /Users/ransford/Documents/React\ Native\ Projects/NewsMedia/ios/Pods/glog/src/vlog_is_on.cc normal arm64 c++ com.apple.compilers.llvm.clang.1_0.compiler
CompileC /Users/ransford/Library/Developer/Xcode/DerivedData/NewsMedia-eoyvzektsxpbcbacskvnwykryelg/Build/Intermediates.noindex/Pods.build/Debug-iphonesimulator/glog.build/Objects-normal/arm64/utilities.o /Users/ransford/Documents/React\ Native\ Projects/NewsMedia/ios/Pods/glog/src/utilities.cc normal arm64 c++ com.apple.compilers.llvm.clang.1_0.compiler CompileC /Users/ransford/Library/Developer/Xcode/DerivedData/NewsMedia-eoyvzektsxpbcbacskvnwykryelg/Build/Intermediates.noindex/Pods.build/Debug-iphonesimulator/glog.build/Objects-normal/arm64/symbolize.o /Users/ransford/Documents/React\ Native\ Projects/NewsMedia/ios/Pods/glog/src/symbolize.cc normal arm64 c++ com.apple.compilers.llvm.clang.1_0.compiler CompileC /Users/ransford/Library/Developer/Xcode/DerivedData/NewsMedia-eoyvzektsxpbcbacskvnwykryelg/Build/Intermediates.noindex/Pods.build/Debug-iphonesimulator/glog.build/Objects-normal/arm64/signalhandler.o /Users/ransford/Documents/React\ Native\ Projects/NewsMedia/ios/Pods/glog/src/signalhandler.cc normal arm64 c++ com.apple.compilers.llvm.clang.1_0.compiler
(4 failures)
registerNotificationActions is not a function in ReactNative
Trying to get action click event in push notification, for this i have user below method
import PushNotification from 'react-native-push-notification';import PushNotificationIOS from '@react-native-community/push-notification-ios';import PushNotificationAndroid from 'react-native-push-notification';PushNotificationAndroid.registerNotificationActions(actions);DeviceEventEmitter.addListener('notificationActionReceived', function ( action, ) { console.log('Notification action received: '+ action); const info = JSON.parse(action.dataJSON); if (info.action == 'Accept') { // Do work pertaining to Accept action here } else if (info.action == 'Reject') { // Do work pertaining to Reject action here } });
While sending push notification, i am getting below error:
TypeError: _reactNativePushNotification.default.registerNotificationActions is not a function. (In '_reactNativePushNotification.default.registerNotificationActions(actions)', '_reactNativePushNotification.default.registerNotificationActions' is undefined)r
react native 063 ld: library not found for -lDoubleConversion
Since I updated my project to 0.63 whenever i build for profiling the app errors on
ld: library not found for -lDoubleConversion
When I run the app normally it works perfectly.
My pods has at the top...
require_relative '../node_modules/react-native/scripts/react_native_pods'
I have even tried adding
pod 'DoubleConversion', :podspec => '../node_modules/react-native/third-party-podspecs/DoubleConversion.podspec'
To no avail.
I tried going to library search paths and removing
"${PODS_CONFIGURATION_BUILD_DIR}/DoubleConversion"
But that didn't help either
I am running .xcworkspace project.
Any other ideas?
Unrecognized module map file Release-iphonesimulator/YogaKit/YogaKit.modulemap' not found
I have created a new react-native project and I am trying to build the iOS code but it is failing with below error:
fatal error: module map file
'/Users/ritz/Library/Developer/Xcode/DerivedData/thoughtrail-blthhaitoghgvzenyxayuwazwzfm/Build/Products/Release-iphonesimulator/YogaKit/YogaKit.modulemap' not found
react-native versions:react-native-cli: 2.0.1react-native: 0.62.2
stack trace from Xcode:
CompileC /Users/ritz/Library/Developer/Xcode/DerivedData/thoughtrail-blthhaitoghgvzenyxayuwazwzfm/Build/Intermediates.noindex/thoughtrail.build/Release-iphonesimulator/thoughtrail.build/Objects-normal/x86_64/thoughtrail_vers.o /Users/ritz/Library/Developer/Xcode/DerivedData/thoughtrail-blthhaitoghgvzenyxayuwazwzfm/Build/Intermediates.noindex/thoughtrail.build/Release-iphonesimulator/thoughtrail.build/DerivedSources/thoughtrail_vers.c normal x86_64 c com.apple.compilers.llvm.clang.1_0.compiler (in target 'thoughtrail' from project 'thoughtrail') cd /Users/ritz/Documents/workspace/threesixnine/thoughtrail/source/mobile/thoughtrail/ios export LANG=en_US.US-ASCII /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang -x c -target x86_64-apple-ios9.0-simulator -fmessage-length=0 -fdiagnostics-show-note-include-stack -fmacro-backtrace-limit=0 -std=gnu99 -fmodules -gmodules -fmodules-cache-path=/Users/ritz/Library/Developer/Xcode/DerivedData/ModuleCache.noindex -fmodules-prune-interval=86400 -fmodules-prune-after=345600 -fbuild-session-file=/Users/ritz/Library/Developer/Xcode/DerivedData/ModuleCache.noindex/Session.modulevalidation -fmodules-validate-once-per-build-session -Wnon-modular-include-in-framework-module -Werror=non-modular-include-in-framework-module -Wno-trigraphs -fpascal-strings -Os -fno-common -Wno-missing-field-initializers -Wno-missing-prototypes -Werror=return-type -Wunreachable-code -Werror=deprecated-objc-isa-usage -Werror=objc-root-class -Wno-missing-braces -Wparentheses -Wswitch -Wunused-function -Wno-unused-label -Wno-unused-parameter -Wunused-variable -Wunused-value -Wempty-body -Wuninitialized -Wconditional-uninitialized -Wno-unknown-pragmas -Wno-shadow -Wno-four-char-constants -Wno-conversion -Wconstant-conversion -Wint-conversion -Wbool-conversion -Wenum-conversion -Wno-float-conversion -Wnon-literal-null-conversion -Wobjc-literal-conversion -Wshorten-64-to-32 -Wpointer-sign -Wno-newline-eof -DCOCOAPODS=1 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.4.sdk -fasm-blocks -fstrict-aliasing -Wdeprecated-declarations -g -fvisibility=hidden -Wno-sign-conversion -Winfinite-recursion -Wcomma -Wblock-capture-autoreleasing -Wstrict-prototypes -Wno-semicolon-before-method-body -iquote /Users/ritz/Library/Developer/Xcode/DerivedData/thoughtrail-blthhaitoghgvzenyxayuwazwzfm/Build/Intermediates.noindex/thoughtrail.build/Release-iphonesimulator/thoughtrail.build/thoughtrail-generated-files.hmap -I/Users/ritz/Library/Developer/Xcode/DerivedData/thoughtrail-blthhaitoghgvzenyxayuwazwzfm/Build/Intermediates.noindex/thoughtrail.build/Release-iphonesimulator/thoughtrail.build/thoughtrail-own-target-headers.hmap -I/Users/ritz/Library/Developer/Xcode/DerivedData/thoughtrail-blthhaitoghgvzenyxayuwazwzfm/Build/Intermediates.noindex/thoughtrail.build/Release-iphonesimulator/thoughtrail.build/thoughtrail-all-target-headers.hmap -iquote /Users/ritz/Library/Developer/Xcode/DerivedData/thoughtrail-blthhaitoghgvzenyxayuwazwzfm/Build/Intermediates.noindex/thoughtrail.build/Release-iphonesimulator/thoughtrail.build/thoughtrail-project-headers.hmap -I/Users/ritz/Library/Developer/Xcode/DerivedData/thoughtrail-blthhaitoghgvzenyxayuwazwzfm/Build/Products/Release-iphonesimulator/include -I/Users/ritz/Documents/workspace/threesixnine/thoughtrail/source/mobile/thoughtrail/ios/Pods/Headers/Public -I/Users/ritz/Documents/workspace/threesixnine/thoughtrail/source/mobile/thoughtrail/ios/Pods/Headers/Public/CocoaAsyncSocket -I/Users/ritz/Documents/workspace/threesixnine/thoughtrail/source/mobile/thoughtrail/ios/Pods/Headers/Public/CocoaLibEvent -I/Users/ritz/Documents/workspace/threesixnine/thoughtrail/source/mobile/thoughtrail/ios/Pods/Headers/Public/DoubleConversion -I/Users/ritz/Documents/workspace/threesixnine/thoughtrail/source/mobile/thoughtrail/ios/Pods/Headers/Public/FBLazyVector -I/Users/ritz/Documents/workspace/threesixnine/thoughtrail/source/mobile/thoughtrail/ios/Pods/Headers/Public/FBReactNativeSpec -I/Users/ritz/Documents/workspace/threesixnine/thoughtrail/source/mobile/thoughtrail/ios/Pods/Headers/Public/Flipper -I/Users/ritz/Documents/workspace/threesixnine/thoughtrail/source/mobile/thoughtrail/ios/Pods/Headers/Public/Flipper-DoubleConversion -I/Users/ritz/Documents/workspace/threesixnine/thoughtrail/source/mobile/thoughtrail/ios/Pods/Headers/Public/Flipper-Folly -I/Users/ritz/Documents/workspace/threesixnine/thoughtrail/source/mobile/thoughtrail/ios/Pods/Headers/Public/Flipper-Glog -I/Users/ritz/Documents/workspace/threesixnine/thoughtrail/source/mobile/thoughtrail/ios/Pods/Headers/Public/Flipper-PeerTalk -I/Users/ritz/Documents/workspace/threesixnine/thoughtrail/source/mobile/thoughtrail/ios/Pods/Headers/Public/Flipper-RSocket -I/Users/ritz/Documents/workspace/threesixnine/thoughtrail/source/mobile/thoughtrail/ios/Pods/Headers/Public/FlipperKit -I/Users/ritz/Documents/workspace/threesixnine/thoughtrail/source/mobile/thoughtrail/ios/Pods/Headers/Public/OpenSSL-Universal -I/Users/ritz/Documents/workspace/threesixnine/thoughtrail/source/mobile/thoughtrail/ios/Pods/Headers/Public/RCTRequired -I/Users/ritz/Documents/workspace/threesixnine/thoughtrail/source/mobile/thoughtrail/ios/Pods/Headers/Public/RCTTypeSafety -I/Users/ritz/Documents/workspace/threesixnine/thoughtrail/source/mobile/thoughtrail/ios/Pods/Headers/Public/React-Core -I/Users/ritz/Documents/workspace/threesixnine/thoughtrail/source/mobile/thoughtrail/ios/Pods/Headers/Public/React-RCTText -I/Users/ritz/Documents/workspace/threesixnine/thoughtrail/source/mobile/thoughtrail/ios/Pods/Headers/Public/React-cxxreact -I/Users/ritz/Documents/workspace/threesixnine/thoughtrail/source/mobile/thoughtrail/ios/Pods/Headers/Public/React-jsi -I/Users/ritz/Documents/workspace/threesixnine/thoughtrail/source/mobile/thoughtrail/ios/Pods/Headers/Public/React-jsiexecutor -I/Users/ritz/Documents/workspace/threesixnine/thoughtrail/source/mobile/thoughtrail/ios/Pods/Headers/Public/React-jsinspector -I/Users/ritz/Documents/workspace/threesixnine/thoughtrail/source/mobile/thoughtrail/ios/Pods/Headers/Public/ReactCommon -I/Users/ritz/Documents/workspace/threesixnine/thoughtrail/source/mobile/thoughtrail/ios/Pods/Headers/Public/Yoga -I/Users/ritz/Documents/workspace/threesixnine/thoughtrail/source/mobile/thoughtrail/ios/Pods/Headers/Public/YogaKit -I/Users/ritz/Documents/workspace/threesixnine/thoughtrail/source/mobile/thoughtrail/ios/Pods/Headers/Public/glog -I/Users/ritz/Documents/workspace/threesixnine/thoughtrail/source/mobile/thoughtrail/ios/Pods/Headers/Public/react-native-webview -I/Users/ritz/Documents/workspace/threesixnine/thoughtrail/source/mobile/thoughtrail/ios/Pods/Headers/Private/React-Core -I/Users/ritz/Library/Developer/Xcode/DerivedData/thoughtrail-blthhaitoghgvzenyxayuwazwzfm/Build/Intermediates.noindex/thoughtrail.build/Release-iphonesimulator/thoughtrail.build/DerivedSources-normal/x86_64 -I/Users/ritz/Library/Developer/Xcode/DerivedData/thoughtrail-blthhaitoghgvzenyxayuwazwzfm/Build/Intermediates.noindex/thoughtrail.build/Release-iphonesimulator/thoughtrail.build/DerivedSources/x86_64 -I/Users/ritz/Library/Developer/Xcode/DerivedData/thoughtrail-blthhaitoghgvzenyxayuwazwzfm/Build/Intermediates.noindex/thoughtrail.build/Release-iphonesimulator/thoughtrail.build/DerivedSources -F/Users/ritz/Library/Developer/Xcode/DerivedData/thoughtrail-blthhaitoghgvzenyxayuwazwzfm/Build/Products/Release-iphonesimulator -fmodule-map-file=/Users/ritz/Library/Developer/Xcode/DerivedData/thoughtrail-blthhaitoghgvzenyxayuwazwzfm/Build/Products/Release-iphonesimulator/YogaKit/YogaKit.modulemap -fmodule-map-file=/Users/ritz/Documents/workspace/threesixnine/thoughtrail/source/mobile/thoughtrail/ios/Pods/Headers/Public/yoga/Yoga.modulemap -MMD -MT dependencies -MF /Users/ritz/Library/Developer/Xcode/DerivedData/thoughtrail-blthhaitoghgvzenyxayuwazwzfm/Build/Intermediates.noindex/thoughtrail.build/Release-iphonesimulator/thoughtrail.build/Objects-normal/x86_64/thoughtrail_vers.d --serialize-diagnostics /Users/ritz/Library/Developer/Xcode/DerivedData/thoughtrail-blthhaitoghgvzenyxayuwazwzfm/Build/Intermediates.noindex/thoughtrail.build/Release-iphonesimulator/thoughtrail.build/Objects-normal/x86_64/thoughtrail_vers.dia -c /Users/ritz/Library/Developer/Xcode/DerivedData/thoughtrail-blthhaitoghgvzenyxayuwazwzfm/Build/Intermediates.noindex/thoughtrail.build/Release-iphonesimulator/thoughtrail.build/DerivedSources/thoughtrail_vers.c -o /Users/ritz/Library/Developer/Xcode/DerivedData/thoughtrail-blthhaitoghgvzenyxayuwazwzfm/Build/Intermediates.noindex/thoughtrail.build/Release-iphonesimulator/thoughtrail.build/Objects-normal/x86_64/thoughtrail_vers.o
Kindly advise.
How can I show the timer current value when the button is clicked in react-native?
I have a react-native project. I have added a Component called a timer to my project. I call my timer in ComponentDidMount on the web. This part works fine.
In the Native (ios) part, I get the values I entered in the textbox. So when I click the button my counter has to start. I get my counter start value from the database. It works fine for the first time when I click the button.
However, when I exit and click the button many times, it does not count back from the correct value because it does not enter componentdidmount. I perform my operations in JoinRoom function. (button click). It calculates the value correctly every time I click the button. But when writing on the screen, it is wrong. In short, I have a problem not calculating the value but showing it on the screen.
I'll be happy if you can help me.