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

"No bundle URL present" ios crashed for release mode only in React Native

$
0
0

enter image description hereMake sure you're running a packager server or have included a .jsbundle file in your application bundle.2020-05-28 13:42:57.094854+0530 abhigyan[70681:942437] 6.25.0 - [Firebase/Analytics][I-ACS031025] Analytics screen reporting is enabled. Call +[FIRAnalytics setScreenName:setScreenClass:] to set the screen name or override the default screen class name. To disable screen reporting, set the flag FirebaseScreenReportingEnabled to NO (boolean) in the Info.plist2020-05-28 13:42:57.138340+0530 abhigyan[70681:941868] *** Terminating app due to uncaught exception 'RCTFatalException: No bundle URL present.

Make sure you're running a packager server or have included a .jsbundle file in your application bundle.', reason: 'No bundle URL present.

Make sure you're running a packager server or have included a .jsbundle file in your application bundle.'*** First throw call stack:( 0 CoreFoundation 0x00007fff23baa1ee exceptionPreprocess + 350 1 libobjc.A.dylib 0x00007fff50864b20 objc_exception_throw + 48 2 abhigyan 0x000000010f37ffc7 RCTFormatError + 0 3 abhigyan 0x000000010f395608 __28-[RCTCxxBridge handleError:]_block_invoke + 685 4 libdispatch.dylib 0x000000011013fdf8 _dispatch_call_block_and_release + 12 5 libdispatch.dylib 0x0000000110140d6c _dispatch_client_callout + 8 6 libdispatch.dylib 0x000000011014ee24 _dispatch_main_queue_callback_4CF + 1500 7 CoreFoundation 0x00007fff23b0ce49 __CFRUNLOOP_IS_SERVICING_THE_MAIN_DISPATCH_QUEUE+ 9 8 CoreFoundation 0x00007fff23b07aa9 __CFRunLoopRun + 2329 9 CoreFoundation 0x00007fff23b06e66 CFRunLoopRunSpecific + 438 10 GraphicsServices 0x00007fff38346bb0 GSEventRunModal + 65 11 UIKitCore 0x00007fff47578dd0 UIApplicationMain + 1621 12 abhigyan 0x000000010f23d397 main + 80 13 libdyld.dylib 0x00007fff516ecd29 start + 1)libc++abi.dylib: terminating with uncaught exception of type NSException(lldb)


React-Native-Webview: Expected nodeHandle to be not null

$
0
0

I am using react-native-webview for rendering a webview. When I navigate from one page to other inside the webview and then try to go back using this.webviewref.goBack() I get the exception of nodeHandle expected to be non-null.

Here is my piece of code

<View style={{ flex: 1 }}><Header          headingText={headerText}          onpress={() => {            // this.dispatchCustomEvent(BACK_PRESS);            if (this.canGoBack) {              this.webViewRef.goBack();            } else NavigationActions.pop();          }}        /><WebView          source={{ uri: "http://localhost:3001/invite/" }}          bounces={false}          javaScriptEnabled={true}          ref={webViewRef => (this.webViewRef = webViewRef)}          // injectedJavaScript={patchPostMessageJsCode}          onMessage={event => {            const { type, data } = JSON.parse(event.nativeEvent.data);            console.log({ type });            console.log({ data });            this.handleEvent(type, data);          }}          onNavigationStateChange={navState =>            (this.canGoBack = navState.canGoBack)          }        /></View>

console logging this.webViewRef shows that the goBack method exists in the weViewRef

The code for which throws the nodeHandle expected to be non-null can be found here https://github.com/react-native-community/react-native-webview/blob/master/src/WebView.ios.tsx

I am unable to understand what is the problem with getWebViewHandleand why nodeHandle is null.

iOS App gets refreshed while switching the apps

$
0
0

Using React-Native, in iOS, App is getting refreshed whenever i switch from my app to another and coming back.

Its not staying on where i left in the current app, getting refreshed and back to main page.

Easiest way to build both React-Native app (iOS & Android) and a PWA

$
0
0

what is the easiest way to build both React-Native app (iOS & Android) and a PWA ? Shall I start with building PWA using React and then copy the codes to React-Native SDK or vice versa ? Does the 'Controller' part of MVC philosophy differ between React-Native App and PWA ?

react-native View config getter callback for component 'rect' must be a function (received 'undefined')

$
0
0

I am trying to integrate a package known as react-native-simple-maps. I have attached the code below.

import React, { Component } from "react"import ReactDOM from "react-dom"import { ComposableMap, ZoomableGroup, Geographies, Geography } from "react-simple-maps"import {    View} from 'react-native'export default class PlotlyGlobal extends React.Component {    render() {        return (<View><ComposableMap><ZoomableGroup><Geographies geography={"./india.topo.json"}>                            {(geographies, projection) =>                                geographies.map(geography => (<Geography key={geography.id} geography={geography} projection={projection} />                                ))                            }</Geographies></ZoomableGroup></ComposableMap></View>        )    }}

Not able to display the map. Please do guide me. I am new to React-Native.

Check that WiFi is turned on in a React Native iOS app

$
0
0

Do you know how it is possible to check that WiFi is turned on in a React Native iOS app. Due to the aGPS on iOS devices, the WiFi must be turned on in order for our location sensitive app to be able to work effectively and we want to notify the user in cases it is turned off.

Any idea how to achieve this in a React Native app for iOS?

React Native - Show incoming video call screen in Android (VOIP app)

$
0
0

I am trying to implement video calling feature in react native app. I have used React native twilio video webrtc. I have implemented the same and got it working.

I don't exactly know the flow of Video calling in mobile apps. The flow which I am using for video calling is as follows:

  1. User 1 taps to call User 2
  2. Your app generates a unique name for a Room. Perhaps a combination of the two user's IDs.
  3. User 1 connects to Room with generated unique name
  4. Using FCM, send message of high priority with the unique name of the Room and token to User 2
  5. User 2 to receives notification and you display a ringing UI(even when the app is killed and phone is locked)
  6. User 2 accepts and connects to the same Room

Now I am stuck on point 5.I am sending the FCM notification(which shows up in tray (edit: now using voip notif) to user2 and now I need to show ringing UI on user2's mobile even if the app is killed and phone is locked. How can I achieve this?

I guess there is a package called react-native-callkit, which I should be using along with PushKit for the same. But the problem is with android flow. PushKit and CallKit is not supported in android. So, when app is in killed state the notification appears I need to grab the control and display ringing UI and wake the screen if the phone is locked and app is killed.

Some Confusions

Is there any special type of push notification which doesn't get displayed in the tray? (edit: data messages and VOIP notif I guess)

Is there any other package than react-native-callkit(for displaying ringing UI) which can be used for both android and ios?

FATAL ERROR: Ineffective mark-compacts near heap limit Allocation failed - Not able to create main.jsbundle

$
0
0

I do have a problem with my react-native mobile app. We are using

  • "aws-iot-device-sdk": "^2.2.4", "aws-sdk": "^2.678.0",

in our app for our mqtt services.The app is working in the debug mode in ios but when configured for the app-center , it failed and the following error was shown saying about the javascript heap out of memory.

transform[stdout]: ==== JS stack trace========================================= transform[stdout]:  transform[stdout]:     0: ExitFrame [pc: 0xd2c3765be3d]transform[stdout]: Security context: 0x2a26ce71e6e9 <JSObject>transform[stdout]:     1: /* anonymous */ [0x2a26d406ba61][/Users/XXX/Work/XXX/XXX/node_modules/@babel/traverse/lib/index.js:~77][pc=0xd2c379b8dbc](this=0x2a26d40456e1 <JSFunction traverse (sfi =0x2a2688adac91)>,node=0x2a2621d1d6c1 <Node map =0x2a26e47c9639>,opts=0x2a261b943559 <Object map =0x2a26e47831d1>,scope=0x2a26423b0f01 <Scope map =0x2a26e4784569>,sta... transform[stdout]:  transform[stderr]: FATALERROR: Ineffective mark-compacts near heap limit Allocation failed -JavaScript heap out of memory transform[stderr]:  1: 0x10003cf99node::Abort() [/usr/local/bin/node] transform[stderr]:  2: 0x10003d1a3node::OnFatalError(char const*, char const*) [/usr/local/bin/node]transform[stderr]:  3: 0x1001b7835v8::internal::V8::FatalProcessOutOfMemory(v8::internal::Isolate*, charconst*, bool) [/usr/local/bin/node] transform[stderr]:  4: 0x100585682v8::internal::Heap::FatalProcessOutOfMemory(char const*)[/usr/local/bin/node] transform[stderr]:  5: 0x100588155v8::internal::Heap::CheckIneffectiveMarkCompact(unsigned long, double)[/usr/local/bin/node] transform[stderr]:  6: 0x100583fffv8::internal::Heap::PerformGarbageCollection(v8::internal::GarbageCollector,v8::GCCallbackFlags) [/usr/local/bin/node] transform[stderr]:  7:0x1005821d4v8::internal::Heap::CollectGarbage(v8::internal::AllocationSpace,v8::internal::GarbageCollectionReason, v8::GCCallbackFlags)[/usr/local/bin/node] transform[stderr]:  8: 0x10058ea6cv8::internal::Heap::AllocateRawWithLigthRetry(int,v8::internal::AllocationSpace, v8::internal::AllocationAlignment)[/usr/local/bin/node] transform[stderr]:  9: 0x10058eaefv8::internal::Heap::AllocateRawWithRetryOrFail(int,v8::internal::AllocationSpace, v8::internal::AllocationAlignment)[/usr/local/bin/node] transform[stderr]: 10: 0x10055e434v8::internal::Factory::NewFillerObject(int, bool,v8::internal::AllocationSpace) [/usr/local/bin/node]transform[stderr]: 11: 0x1007e6714v8::internal::Runtime_AllocateInNewSpace(int, v8::internal::Object**,v8::internal::Isolate*) [/usr/local/bin/node] transform[stderr]: 12:0xd2c3765be3d  transform[stdout]:  transform[stdout]: <--- Last fewGCs ---> transform[stdout]:  transform[stdout]: [23942:0x102b00000]  374196 ms: Scavenge 1374.0 (1423.8) -> 1373.7 (1424.3) MB, 11.0 / 0.0ms  (average mu = 0.109, current mu = 0.018) allocation failure transform[stdout]: [23942:0x102b00000]   402358 ms: Mark-sweep 1374.4(1424.3) -> 1374.1 (1423.8) MB, 28158.8 / 0.0 ms  (average mu = 0.062,current mu = 0.009) allocation failure scavenge might not succeedtransform[stdout]: [23942:0x102b00000]   402424 ms: Scavenge 1374.8(1423.8) -> 1374.5 (1424.3) MB, 29.1 / 0.0 ms  (average mu = 0.062,current mu = 0.009) allocation failure```

I could see many articles saying about adding :

shellScript = "export NODE_BINARY=\"'node --max_old_space_size=8192'\n../node_modules/react-native/scripts/react-native-xcode.sh\"\n";

in the project.pbxproj file inside the

/* Bundle React Native Code And Images */

section. This was added and app-center build was successful but the application crashed using when installed ipa in real device.

I tried to get create the ipa using the Archive option in Xcode and xcode failed throwing the main.jsbundle could not be found.Tried creating the main.jsbundle using the command

react-native bundle --entry-file index.js --platform ios --dev false--bundle-output ios/main.jsbundle --assets-dest ios

but this also failed showing the heap exception which is the same as I got in app-center.At the same time debug mode is working fine though I had the same heap problem, I started the bundler using the

"node --max-old-space-size=8192 node_modules/react-native/local-cli/cli.js start",

Not sure how to create a release build for iOS. It would be really helpful if someone can help me to identify a fix for this.Did anyone face this problem and able to resolve this ?

System:    OS: macOS 10.15    CPU: (4) x64 Intel(R) Core(TM) i5-5350U CPU @ 1.80GHz    Memory: 685.68 MB / 8.00 GB    Shell: 3.2.57 - /bin/bash  Binaries:    Node: 10.16.0 - /usr/local/bin/node    Yarn: 1.15.2 - /usr/local/bin/yarn    npm: 6.9.0 - /usr/local/bin/npm    Watchman: Not Found  SDKs:    iOS SDK:      Platforms: iOS 13.2, DriverKit 19.0, macOS 10.15, tvOS 13.2, watchOS 6.1    Android SDK:      API Levels: 23, 27, 28, 29  IDEs:    Android Studio: 3.6 AI-192.7142.36.36.6392135    Xcode: 11.3.1/11C504 - /usr/bin/xcodebuild  Languages:    Python: 2.7.17 - /usr/local/bin/python  npmPackages:    @react-native-community/cli: Not Found    react: 16.11.0 => 16.11.0     react-native: 0.62.0 => 0.62.0   npmGlobalPackages:    *react-native*: Not Found

Can't connect to my CarPlay app in the Simulator?

$
0
0

I'm running Xcode 10 on my mac and I'm trying to connect to the CarPlay Simulator. I see content appearing in the Simulator, but I'm also getting a message saying that it can't connect to my app ... please try again!

Has anyone experienced this and know of a way to fix the issue?

Changing the color of a Text item from a FlatList onPress

$
0
0

I have a category list that is being displayed using a FlatList I tried changing the color of a single item OnPress so the user gets a feed back of what item he selected,but all the items in the FlatList change color.

How do I go along about implementing something like this so that the only selected item changes color and gets the original color back when another item is selected

Here is a sample of the code used :

import colors from "../config/colors";function Categories() {  return (<View style={styles.Categories}><FlatList        horizontal        showsHorizontalScrollIndicator={false}        style={{}}        data={category}        keyExtractor={(item) => item.id}        renderItem={({ item }) => {          return <Text style={styles.Text}>{item.title}</Text>;        }}      /></View>  );}

Firebase crashlytics upload dsym automatically

$
0
0

I'm using React Native Firebase. At firebase crashlytics I have missing DSYM's.enter image description here

What's the right way to add dSYMs automatically on every build? I guess it should be added to run script? If so, how can I get the path to /path/to/pods/directory/FirebaseCrashlytics/upload-symbols and /path/to/dSYMs.

Thanks!

React Native Push Notifications not appearing in settings

$
0
0

I am new to react native and I am trying to set up push notifications via iOS.

I have installed pushNotificationios and followed the instructions given. I have also signed up as an Apple Developer.

When I run my app the push notifications don't seem to work. When I go into my iPhone settings and click on the app it does not display notifications.

settings

Here is my code

import PushNotificationIOS from '@react-native-community/push-notification-ios';import PushNotification from "react-native-push-notification";const configure = () => { PushNotification.configure({   onRegister: (token) => {    console.log('TOKEN:', token);     //process token   },   onNotification: (notification) => {     // process the notification     console.log("NOTIFICATION:", notification);     // required on iOS only     notification.finish(PushNotificationIOS.FetchResult.NoData);   },   permissions: {     alert: true,     badge: true,     sound: true   },   popInitialNotification: true,   requestPermissions: true, });}; export {    configure,   };

Xcode 11 unable to CopyPlistFile plist file that was just copied using build phase

$
0
0

I'm trying to follow the instructions here (for iOS) for setting up multiple environments for my React Native project. The idea is that I can make use of Build Phases to copy any plist into GoogleService-Info.plist to enable the use of different Firebase environments for different Xcode schemes.

I've made a user-defined build setting for each of my 4 Xcode configurations called GOOGLE_SERVICE_PLIST_SUFFIX, and I have a build phase (it's the first one that's run before React native Copies and Bundles its required assets) with the following code:

cp -r "GoogleService-Info"$GOOGLE_SERVICE_PLIST_SUFFIX".plist""GoogleService-Info.plist"&wait $!echo "${GOOGLE_SERVICE_PLIST_SUFFIX} Firebase plist copied"

I can tell that the copying is indeed successful, but for some reason the build fails with this error:

The following build commands failed:    CopyPlistFile /Users/andersonaddo/myappname/ios/build/biteup/Build/Products/Prod.Debug-iphonesimulator/Myappname.app/GoogleService-Info.plist /Users/andersonaddo/myappname/ios/GoogleService-Info.plist(1 failure)

Looking at the error trace, this error is explained a bit further:

CopyPlistFile /Users/andersonaddo/myappname/ios/build/myappname/Build/Products/Prod.Debug-iphonesimulator/Myappname.app/GoogleService-Info.plist /Users/andersonaddo/myappname/ios/GoogleService-Info.plist (in target 'myappname' from project 'myappname')    cd /Users/andersonaddo/myappname/ios    builtin-copyPlist --convert binary1 --outdir /Users/andersonaddo/myappname/ios/build/myappname/Build/Products/Prod.Debug-iphonesimulator/Biteup.app -- /Users/andersonaddo/myappname/ios/GoogleService-Info.plisterror: Build input file cannot be found: '/Users/andersonaddo/lunchme/ios/GoogleService-Info.plist' (in target 'biteup' from project 'biteup')

Does anyone have any idea why this behaviour may be happening? If i try and build again after the first failure, I don't run into this issue because the copied file remains in the ios directory from the first attempt.

Trying to upload JavaScript code to Expo for React Native App

$
0
0

So this is what I have so far, as file App.js. I am using the code to get accustomed to Expo platform since coding on Windows and making an iOS app. However, when I am scanning the QR code and see the app on Expo, I still keep a message stating “Open up App.js to start working on your app!” I have opened App.js on my desktop but nothing is showing. I am connecting the QR code on my iphone to a LAN. Any help would be appreciated.

App.js file:

import React, { Component } from ‘react’import {StyleSheet,TouchableOpacity,Text,View,} from ‘react-native’class App extends Component {state = {count: 0}onPress = () => {this.setState({count: this.state.count + 1})}render() {return (Click meYou clicked { this.state.count } times)}}const styles = StyleSheet.create({container: {flex: 1,justifyContent: ‘center’,alignItems: ‘center’,},button: {alignItems: ‘center’,backgroundColor: ‘#DDDDDD’,padding: 10,marginBottom: 10;}})export default App;

Background notification not working ( iOS / react-native-firebase v7)

$
0
0

I`m using react-native-firebase v7 and not getting background notifications. Its happened only ios devices also in the background. It's working in the foreground without any issue.

Using

"@react-native-firebase/messaging": "^7.1.0""react": "16.9.0","react-native": "^0.61.5",

PUBNUB operations throws PNTimeoutCategory often

$
0
0

I am using pubnub server in my chat app. It works fine but often I am getting PNTimeoutCategory error while doing pubnub operations like subscribe, unsubscribe, publish etc. How to handle this?

 pubnub = new PubNub({     authKey: auth_key,     publishKey: publish_key,     subscribeKey: subscribe_key,     ssl: true,     uuid: provider_id,     logVerbosity: __DEV__, });

and I subscribe channels like below:

pubnub.unsubscribe({    channels});

TypeError: null is not an object (evaluating 'RCTToast.SHORT') - React Native iOS Version index.bundle

$
0
0

With my React Native project that I started with

react-native init PROJECTNAME (NOT EXPO), I finished the app and the Android version works properly.  When I started the project, the iOS version works properly too.  However after coding and coding for Android....when I completed the Android version and it works properly, now then I run the iOS version it gave me a few errors....mostly with having to install RNPermission, etc.

After solving those issues, I am now facing this new error that I don't know how to solve:

TypeError: null is not an object (evaluating 'RCTToast.SHORT')

It would seem like this problem happens in the index.bundle.

How to solve?

Alarm for react native application (both android and ios)

$
0
0

I have being trying to build and alarm app in react native, so far I only find some solutions for android but not for ios. So can anyone please suggest some ways I can create an alarm in both android and ios platform using react native.

app works with yarn start but not in simulator

$
0
0

I am using yarn run ios to run a react native project in Xcode simulator. This was working perfectly till two weeks ago but it's not working right now. Now, I get errors like these:

error: /Users/app/ios/Pods/Target Support Files/Pods-Inst/Pods-Inst.debug.xcconfig: unable to open file (in target "Inst" in project "Inst") (in target 'Inst' from project 'Inst')** BUILD FAILED **error Command failed with exit code 1.info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.

I had already tried cleaning cache, removing node modules etc etc but nothing works.

error Command failed with exit code 1. when I try to run yarn

If I simply do yarn start, I think it builds successfully since I can see the flower and all on the terminal. However, when I try using the simulator, it doesn't work. How can I fix this?

react-native landscape mode breaking layout

$
0
0
  • when I change my orintation from protrait to landscape my layout not working
  • I used align items stretch also but both views are not expnading in landscape mode.
  • can you tell me what could be the issue.
  • I researched and tried with this approach, React-Native + Flex not responding to orientation change
  • but still not working
  • providing my styles and html structure below.
<View   onLayout={this.onLayout}                            style={{                                display: 'flex',                                flexDirection: 'row',                                backgroundColor: 'yellow',                            }}><View                                style={{                                    backgroundColor: '#EFEFEF',                                }}><Text                                    style={{                                        fontSize: 16                                    }}>  {item.item.name}</Text><View                                    style={{                                        backgroundColor: 'brown',                                    }}><Text style={{                                        fontSize: 12,                                        paddingTop: 5,                                    }}> tiger: 99999 </Text><Text style={{                                        fontSize: 12,                                        paddingTop: 5,                                    }}> cat: 6 </Text><Text style={{                                        fontSize: 12,                                        paddingTop: 5,                                    }}>                                        Tote lion: 0000345698223418500928342186</Text></View></View><View                                style={{                                    backgroundColor: '#EFEFEF',                                }}><Text                                    style={{                                        fontSize: 16                                    }}>  Honor</Text><View                                    style={{                                        backgroundColor: 'green',                                        width: this.state.width,                                    }}><Text> mouse: 12</Text><Text> rhino: 10</Text><Text> wolf: 3</Text></View></View></View>
Viewing all 16563 articles
Browse latest View live


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