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

Build issue after installing react native vector icons

$
0
0

I'm trying to compile my app after installing react-native-vector and I get this error

build error

I installed it following this:

npm i react-native-vector-icons

ANDROID:Folder Android>App>build.gradle:

apply from: "../../node_modules/react-native-vector-icons/fonts.gradle"

IOS:Podfile:

pod 'RNVectorIcons', :path => '../node_modules/react-native-vector-icons'

iOS folder myApp>Info.plist adding the following lines:

<key>UIAppFonts</key> <array> <string>AntDesign.ttf</string> <string>Entypo.ttf</string> <string>EvilIcons.ttf</string> <string>Feather.ttf</string> <string>FontAwesome.ttf</string> <string>FontAwesome5_Brands.ttf</string> <string>FontAwesome5_Regular.ttf</string> <string>FontAwesome5_Solid.ttf</string> <string>Foundation.ttf</string> <string>Ionicons.ttf</string> <string>MaterialIcons.ttf</string> <string>MaterialCommunityIcons.ttf</string> <string>SimpleLineIcons.ttf</string> <string>Octicons.ttf</string> <string>Zocial.ttf</string> </array>

I used pod update and pod install

updating


Change entire System(Mobile) Font with react native

$
0
0

I am working on an react native app and is clueless about how I can change the entire device font. I don't want to root the system in order to change the font. The font must be changed throughout the system.

Requiring unknown module "498" error in ReactNative getting started example

$
0
0

I'm trying to build and run an iOS simulator version of the getting started React Native project from the instructions at:

https://facebook.github.io/react-native/docs/getting-started.html

The app launches in the XCode simulator, displays it's window very briefly but then an exception occurs that opens a red screen with the message

"Requiring unknown module "498".If you are sure the module is there, try restarting Metro Bundler. You may also want to run yarn, or npm install (depending on your environment).

loadModuleImplementation require.js:176:29

viewPropTypes.js:15:30

loadModuleImplementation require.js:212:12

View.js:20:22

loadModuleImplementation require.js:212:12

AppContainer.js:22:13"

etc

Line 15 of ViewPropTypes is

const PlatformViewPropTypes = require('PlatformViewPropTypes');

Line 20 of node_modules/react_native/Libraries/Components/Views/View.js is

const ViewPropTypes = require('ViewPropTypes');

Note: There is another, 15 line View.js files in the directory structure at node_modules/react_native/lib/ it's basically a stub containing

// This is a forwarding module to allow React to require React Native internals// as node dependencymodule.exports = require('View');

I'm on the latest of everything, MacOS High Sierra (10.13.4), XCode 9.3 with 9.3 command line tools installed. I've tried running yarn and npm install, and a fresh install. Obviously I have NPM and Watchman installed. Any ideas why the stock example won't run for me?

React Native - secureTextEntry Disable IOS 13+ Strong Password behavior

$
0
0

I have an create account form in my app and now on iOS devices running 13+ I'm having an issue where if the the user presses the "done" key while entering a password the normal secure password dots are replaced with the following (see below). How to disable this behavior so it continues to work as it did on older devices?

enter image description here

How to place an image above another image using Styled Components in React Native App

$
0
0

I need to put an icon image above my cardVideo component. I just want to put the image above, without any action.

The path for the play icon: import image from '../../../assets/book_covers/icon-play.png';

Thank you.

My component:

import React from 'react';import { SafeAreaView } from 'react-native';import { Container, Capa, TextBox, Title } from './CardVideo.style';import image from '../../../assets/book_covers/imageCollection';const CardVideo = ({ item, first=false, last=false }) => (<SafeAreaView><Container first={first} last={last}><Capa source={image[item.imagem_livro]} resizeMode="cover" /><TextBox><Title numberOfLines={1}>{item.titulo_livro}</Title></TextBox></Container></SafeAreaView>);export default CardVideo;

VideoCard style:

import styled from 'styled-components/native';export const Container = styled.View`  margin-left: ${props => (props.first ? '16px' : '12px')};  margin-right: ${props => (props.last ? '16px' : '0')};  justify-content: space-between;`;export const Capa = styled.Image`  width: 280px;  height: 160px;  margin: 0 0 12px;  opacity: 0.3;  border-radius: 10px;  background-color: #000000;`;export const TextBox = styled.View`  width: 280px;  height: 42px;`;export const Title = styled.Text`  font-family: Roboto;  font-size: 14px;  font-weight: normal;  font-style: normal;  color: #232728;`;export const IconPlay = styled.Image`  width: 56px;  height: 56px;  object-fit: contain;`;

The component image without the Icon

How should it be

How it looks like in the iOS simulator

Unable to resolve module 'react-navigation' from .../App.js: Module 'react-navigation' does not exist in the Haste module map

$
0
0

So I've just set up an app to start building it out and I keep getting this error from my App.js. This is a part of a udemy course in which I've followed every instruction to a T...so im beyond confused of what the hell is happening and I've followed every suggestion I can find. Unable to resolve module react-navigation from /Users/3x7r3m157/Development/React-Native/food/App.js: Module react-navigation does not exist in the Haste module map

This might be related to https://github.com/facebook/react-native/issues/4968To resolve try the following:  1. Clear watchman watches: `watchman watch-del-all`.  2. Delete the `node_modules` folder: `rm -rf node_modules && npm install`.  3. Reset Metro Bundler cache: `rm -rf /tmp/metro-bundler-cache-*` or `npm start -- --reset-cache`.  4. Remove haste cache: `rm -rf /tmp/haste-map-react-native-packager-*`.facebook::ReactABI35_0_0::JSIExecutor::defaultTimeoutInvoker(std::__1::function<void ()> const&, std::__1::function<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > ()>)facebook::ReactABI35_0_0::JSIExecutor::defaultTimeoutInvoker(std::__1::function<void ()> const&, std::__1::function<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > ()>)ED0789CD-8D80-39F4-9651-D8707D9C0337ED0789CD-8D80-39F4-9651-D8707D9C0337_dispatch_main_queue_callback_4CF97285ACB-7B21-393A-ABF6-03F1DBB5D2A297285ACB-7B21-393A-ABF6-03F1DBB5D2A2CFRunLoopRunSpecificGSEventRunModalUIApplicationMainExponent0DC9A4BA-C3E8-3487-99DB-1B5C86597AF5

Heres my App.js:

import { createAppContainer } from 'react-navigation';import { createStackNavigator } from 'react-navigation-stack';import SearchScreen from './src/screens/SearchScreen';const navigator = createStackNavigator ({  Search: SearchScreen}, {  initialRouteName: 'Search',  defaultNavigationOptions: {    title: 'BusinessSearch'  }});export default createAppContainer(navigator);

Swift._ArrayBuffer._copyContents on Xcode

$
0
0
"Swift._ArrayBuffer._copyContents(initializing: Swift.UnsafeMutableBufferPointer<A>) -> (Swift.IndexingIterator<Swift._ArrayBuffer<A>>, Swift.Int)", referenced from:      generic specialization <serialized, Swift._ArrayBuffer<Swift.Int8>> of Swift._copyCollectionToContiguousArray<A where A: Swift.Collection>(A) -> Swift.ContiguousArray<A.Element> in libAlamofire.a(NetworkReachabilityManager.o)ld: symbol(s) not found for architecture arm64clang: error: linker command failed with exit code 1 (use -v to see invocation)

I upgrade Xcode 12.5 with ios 14.5 version. and I tried to excute my app...and I got an above problem... I don't know how to solve this problem. does anyone who solve this ???

React Native - Reanimated Bottom Sheet: Content in Snapable Container only scrollable on iOS

$
0
0

I have a container with 3 snap points which also contains a scrollView where I display more information. For some reason, this scrollview only works on iOS and not on Android. However, on Android the scrolling works when I do a sort of vertical pinch to zoom move on the screen. On iOS everything works absolutely seamlessly.

Here the repo for the reanimated-bottom-sheet:https://github.com/osdnk/react-native-reanimated-bottom-sheet

I already tried playing around with the props provided on the repository page of the Bottom Sheet library as well as attempted using these props as mentioned in other StackOverflow questions which sadly didn´t do the trick for me. On Android only either the scrolling worked or the snap points. Never the two (Only the two-finger pinching).

Can't scroll Flatlist inside react-native-reanimated-bottom-sheet

enabledInnerScrolling={true}enabledContentGestureInteraction={false}

Help is much appreciated since it´s the final project of our WebDev course and we don´t have too much time left >.<Here is the code snippet.

  const bs = React.createRef();  return (<View style={styles.container}><BottomSheet        ref={bs}        snapPoints={['85%', '39%', '17%']}        initialSnap={1}        renderContent={renderContent}        enabledInnerScrolling={true}      /><TouchableWithoutFeedback onPress={() => bs.current.snapTo(0)}><Image          style={styles.background}          source={require('../assets/images/TEST-flower-02.jpg')}        /></TouchableWithoutFeedback></View>  );```

Build is failing for older projects for React-Native iOS XCode Version 12.5

$
0
0

It is very new to me see this problem which started happening recently. Previously my app used to work fine on the iOS simulator by running this command react-native run-ios. Now I have done a lot of research and made my app run via XCode. But somehow the metro bundler is not linked when the app runs via XCode.

I tried running the app via react-native run-ios and every time I am seeing this error. It is too big to copy paste every error here, but here are some of them:

Undefined symbols for architecture x86_64:"Swift._ArrayBuffer._copyContents(initializing: Swift.UnsafeMutableBufferPointer<A>) -> (Swift.IndexingIterator<Swift._ArrayBuffer<A>>, Swift.Int)", referenced from:      generic specialization <serialized, Swift._ArrayBuffer<Swift.Int8>> of Swift._copyCollectionToContiguousArray<A where A: Swift.Collection>(A) -> Swift.ContiguousArray<A.Element> in libMixpanel-swift.a(AutomaticProperties.o)ld: symbol(s) not found for architecture x86_64clang: error: linker command failed with exit code 1 (use -v to see invocation)** BUILD FAILED **The following build commands failed:        Ld /Users/careerlabsdev/Library/Developer/Xcode/DerivedData/CareerLabs_Elev8-gxcfanteiuxazegkgwkjkrjxbdmw/Build/Products/Debug-iphonesimulator/CareerLabs.app/CareerLabs normal(1 failure)

I have done a lot of things to make it to work. The only success I got here is, while running the command react-native run-ios, it opens up the metro bundler server. After that it fails with giving a 1000 lines of error. I picked the error which had some cream part. Some key words to pick from the error:

  • ld: symbol(s) not found for architecture x86_64
  • clang: error: linker command failed with exit code 1 (use -v to see invocation)
  • Did not understand the word Ld, which is listed under BUILD FAILED

What I did is as follows:

  1. Deleting node_modules, Pods. Cleaning the build from XCode. Running npm install and then cd ios && pod install and then ran the command react-native run-ios
  2. Deleting Pods, Podfile.lock. Did pod install and then in the root react-native run-ios
  3. Doing these:
rm -rf ~/Library/Caches/CocoaPodsrm -rf Podsrm -rf ~/Library/Developer/Xcode/DerivedData/*pod deintegratepod setuppod installcd ..react-native run-ios
  1. Restarted the system, and ran the command again react-native run-ios
  2. Added arm64 in the Excluded Architecture from XCode. Please note, this enabled me to build and run the app successfully on XCode. But it doesn't get attached to the metro bundler server. Looks like it runs the release mode only.
  3. Updated my package react-native-gesture-handler to the latest one which is 1.10.3, to see if that removes my problem. But no luck :(

My Podfile look like this:

  platform :ios, '10.0'  use_flipper!({'Flipper' => '0.81.0'})  post_install do |installer|    flipper_post_install(installer)    installer.pods_project.targets.each do |target|      target.build_configurations.each do |config|        config.build_settings.delete 'IPHONEOS_DEPLOYMENT_TARGET'      end    end  end

I am out of options now, and waiting for some insight to be given. It is indeed frustrating to see an error on something which never created a problem. I am using Apple M1 Chip Macbook. Would appreciate any kind of help on this.

Update V1.0

  • I have tried commenting down the use_flipper!(), from the /ios/Podfile, and then redid the same things, like removing Pods, Podfile.lock. Running this command, pod update && pod install && cd.. && npm run ios. Ran into multiple issues. God knows what actually the issue is with XCode and React Native on Apple M1.

Update V2.0

I have found some significant places where the developers are complaining about the same. XCode has forced updated my version to 12.5, without my notice. And now XCode is creating a problem with RN Older projects. Here are the supportive links for the same:

I hope this may give some insight to the developers who are confused like me. Please take a look, and looks like Facebook is fixing it, but don't know when. Have to keep an eye on it :/

React Native iOS: library not found for -lDoubleConversion

$
0
0

I tried to run react-native run-ios and build on xcode.

I get the following error: library not found for -lDoubleConversion

React Native Error: Payload cannot exceed 104857600 bytes

$
0
0

Just recently when working with react native and metro as bundler I've been getting this error whenever the app refreshes on the IOS Simulator, causing the app to disconnect from Metro.

Full Stack trace:

error: A WebSocket client got a connection error. Please reload your device to get HMR working again: Error: payload cannot exceed 104857600 bytesat Receiver.error (/Users/zebras/Repos/provotum/voter_app_2/node_modules/metro/node_modules/ws/lib/Receiver.js:321:18)at Receiver.maxPayloadExceeded (/Users/zebras/Repos/provotum/voter_app_2/node_modules/metro/node_modules/ws/lib/Receiver.js:389:8)at Receiver.<anonymous> (/Users/zebras/Repos/provotum/voter_app_2/node_modules/metro/node_modules/ws/lib/Receiver.js:479:20)at Receiver.add (/Users/zebras/Repos/provotum/voter_app_2/node_modules/metro/node_modules/ws/lib/Receiver.js:103:24)at Socket.realHandler (/Users/zebras/Repos/provotum/voter_app_2/node_modules/metro/node_modules/ws/lib/WebSocket.js:825:20)at Socket.emit (events.js:315:20)at addChunk (internal/streams/readable.js:309:12)at readableAddChunk (internal/streams/readable.js:284:9)at Socket.Readable.push (internal/streams/readable.js:223:10)at TCP.onStreamRead (internal/stream_base_commons.js:188:23)

I could not really find anything relevant through google and am to unexperienced with RN to make anything from this message myself. I tried re-producing the steps that I think where the last I took before the error occurred, which was:

Creating a new component (Intro), registering the component with the Navigation:

<NavigationContainer><Stack.Navigator><Stack.Screen                name="Login"                component={Login}                options={{ title: 'something', name: 'Login' }}            /><Stack.Screen name="list" component={List} /><Stack.Screen name="intro" component={Intro} />

And creating the template of the component before implementing it:

import React, { useEffect, useState } from 'react';import { PageControlView } from 'react-native-ios-kit';import { Title1, Title3, Body, Button } from 'react-native-ios-kit';import { View } from 'react-native';const styles = require('../style');const Intro = ({ navigation, route, props }) => {return (<View style={styles.container}><PageControlView defaultPage={1}><View style={styles.container}><Title1>First page.</Title1></View><View style={styles.container}><Title1>Second page.</Title1></View><View style={styles.container}><Title1>Third page.</Title1></View></PageControlView></View>)};export default Intro;

Edit: however removing the new component did not change anything.

how to .map an element on my pushnotification?

$
0
0

I used React-native Push Notification and i wanna get my element on my .map to personnalized my notification.Everything works fine when i used static string. But when i add my .map, nothing works.

My function

renderNotif = () => {    return this.state.sport.clubs.map((element) => {        return (            PushNotification.localNotificationSchedule({                message: element.adversaire, // (required)                date: new Date(Date.now() + 10 * 1000), // in 60 secs            }))    })}

My function is also on my componentDidmount

Problems with ejected Expo app on IOS (React-Native)

$
0
0

I'm having troubles with my ejected Expo app for IOS.

Started building the app with Expo, but after some time I needed Bluetooth functionalities, so decided to eject, to use native code. Everything works fine, but when I try to load my app on an IOS-device (after building in xcode), it won't run the way it would like it to.

I would like to try the app, via a hotspot (4G), but it won't start. When there is no Wifi it will start but says 'Connect to Metro to develop Javascript'.

My question is: Can I make my app into a standalone app, without the Expo server running on a pc on the same wifi network?

null is not an object (evaluating 'RCTToastAndroid.SHORT')

$
0
0

I am attempting to convert my react-native project into an expo project, one small issue I've encountered is when I run the expo project I get an error as such

null is not an object (evaluating 'RCTToastAndroid.SHORT')

After doing some research online on how to fix this problem a user requested that a problem like this can simply be resolved by removing the Android part of RCTToastAndroid.SHORT this user stated that RCTToast is universally compatible with both iOS and Android. However when I do this I receive an error saying null is not an object (evaluating 'RCTToast.SHORT')

What can I do that will help ease the transition from my react-native project to an expo project?

Missing realm constructor react native ios but realm is linked

$
0
0

Keep getting the Missing Realm Constructor error and have tried everything from the Realm documentation on this common issue to relinking with rnpm link realm which tells me they're already linked. I've also tried linking in Xcode by adding in the libRealmReact.a file manually, but all to no avail.


React Native 0.64 won't build iOS app after updating Xcode to 12.5 and iOS to 14.5

$
0
0

After upgrading Xcode to 12.5 and iOS to 14.5, I can't run the iOS app on a real device nor in the simulator.

After running npm run ios, I get this message:

The following build commands failed:        CompileC .../Build/Intermediates.noindex/Pods.build/Debug-iphonesimulator/Flipper-Folly.build/Objects-normal/x86_64/DistributedMutex.o /Users/guilherme/Documents/Dood/ios/Pods/Flipper-Folly/folly/synchronization/DistributedMutex.cpp normal x86_64 c++ com.apple.compilers.llvm.clang.1_0.compiler

If I try to run the app on a real device using Xcode, this is the error I get (related to Flipper-Folly):

.../ios/Pods/Headers/Private/Flipper-Folly/folly/synchronization/DistributedMutex-inl.h:1051:5: 'atomic_notify_one<unsigned long>' is unavailable

Ideas? Thanks!

React native build failed in iOS - PhaseScriptExecution

$
0
0

I am facing issue in react-native project. It's working fine in android but build failed in iOS version. I have already tried all possible solution, but didn't get any solution.

The main problem is PhaseScriptExecution.

Xcode version - 12.4

Mac OS version - 11.3 (Big Sur)

npm version - 7.10.0

react-native version - 0.64.0

react version - 17.0.1

For mode detail, i am attaching the screenshot.

enter image description hereenter image description here

React Native Unrecognized font family not fixing

$
0
0

The fonts are in my asset folder, they are also inside xcode copy bundle resources, and also inside resource folder. I already also ran react-native link, but it still doesn't find the font. Is there something I missed? Please see attached images for reference:

enter image description here

enter image description here

enter image description hereenter image description here

enter image description here

enter image description here

iOS App reward referrals using Expo and Firebase

$
0
0

I am working on an iOS app using Expo (React Native) and Firebase. We want to offer referral rewards to users who get others to download the app. Right now, we simply have a "Who told you about us" section when creating an account, but we'd like to be able to send out a referral code with the invite and track whether that user downloads the app, as described here. Unfortunately, I can't seem to find how to do this with Expo specifically. I'd love some help with this :)

Expo Push Notification does not accept tokens for different devices

$
0
0

We have a React-Native app and we built a push notification system where the admin can send push to all users from our app dashboard but for some reason it's not working properly.

Here is the problem when i hardcoded my token it was working super cool but when I changed to this line it didn't send the notification so I don't know how to fix this.

sendPushNotification = () => {    var myHeaders = new Headers();    myHeaders.append("Host", "exp.host");    myHeaders.append("Accept", "application/json");    myHeaders.append("accept-encoding", "gzip, deflate");    myHeaders.append("content-type", "application/json");    var raw = JSON.stringify(        {"to": this.filerArrayPush(),            //"to": "ExponentPushToken[XcsB9hAw0LgHjJb1rCR8YH]","title": this.state.email,"body": this.state.password        }    );    var requestOptions = {        mode: 'no-cors',        method: 'POST',        headers: myHeaders,        body: raw,        redirect: 'follow'    };    fetch("https://exp.host/--/api/v2/push/send", requestOptions)        .then(response => response.text())        .then(result => console.log(result))        .catch(error => console.log('error', error));    alert('Send All Devices')}

enter image description here

Viewing all 16904 articles
Browse latest View live


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