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

Application tried to present a nil modal view controller on target in React Native Objective-C extension

$
0
0

I am trying to port an iOS app over to React Native.

In this iOS app, one of the functions that needs to be done is to integrate it with a PayPal library (which is currently deprecated - we want to move away from it at some point later this year, but do not have the resources to do so now).

All we're doing with this library is obtaining a unique code from PayPal - that requires a View Controller to pop up, accept client credentials and return a code giving access.

I am extremely new to Objective-C.

I've got this so far (note: I have not included all the methods/properties but can include any missing):

@implementation PaypalSdk- (IBAction)obtainConsent {  // Choose whichever scope-values apply in your case. See `PayPalOAuthScopes.h` for a complete list of available scope-values.  NSSet *scopeValues = [NSSet setWithArray:@[kPayPalOAuth2ScopeOpenId, kPayPalOAuth2ScopeEmail, kPayPalOAuth2ScopeAddress, kPayPalOAuth2ScopePhone]];  PayPalProfileSharingViewController *psViewController;  psViewController = [[PayPalProfileSharingViewController alloc] initWithScopeValues:scopeValues                                                                       configuration:self.payPalConfig                                                                            delegate:self];  // Present the PayPalProfileSharingViewController  [self presentViewController:psViewController animated:YES completion:nil];}RCT_EXPORT_MODULE()RCT_EXPORT_METHOD(generateCode: (RCTResponseSenderBlock)callback) {    [PayPalMobile initializeWithClientIdsForEnvironments:@{PayPalEnvironmentProduction : @"PRODUCTIONKEYHERE",                                                           PayPalEnvironmentSandbox : @"SANDBOXKEYHERE"}];    [self obtainConsent];    // TODO: eventually pass correctly generated code here    callback(@[[NSNull null], @"code"]);}@end

I am basing this off of this library:

https://github.com/paypal/PayPal-iOS-SDK/blob/master/SampleApp/PayPal-iOS-SDK-Sample-App/ZZMainViewController.m

And this documentation:

https://github.com/paypal/PayPal-iOS-SDK/blob/master/docs/profile_sharing_mobile.md

However when trying what I am above, I get the following error:

React Native error screen

How exactly should I resolve this? It seems to need a View Controller but I'm not totally sure how to launch one from React Native in this context.

All we're trying to get is the shared profile information.

And just for reference, this is my .h file:

#import "RCTBridgeModule.h"@interface PaypalSdk : UIViewController <RCTBridgeModule, PayPalProfileSharingDelegate>@property(nonatomic, strong, readwrite) NSString *environment;@property(nonatomic, strong, readwrite) NSString *resultText;@end

unable to read property list from Info.plist

$
0
0

I'm trying to release an ios App using Xcode 11.3.1 after test it in a simulator it's work well but when I Archive I got this error!

unable to read property list from file myApp/Info.plist: The operation couldn’t be completed. (XCBUtil.PropertyListConversionError error 1.)

I don't change anything except add NSPhotoLibraryUsageDescription & NSCameraUsageDescription and as i say in simulator i don't get any issue

And change CFBundleVersion to 2 because i send an app previously to App store So that's it!

info.plist

<?xml version="1.0" encoding="UTF-8"?><!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN""http://www.apple.com/DTDs/PropertyList-1.0.dtd"><plist version="1.0"><dict><key>NSPhotoLibraryUsageDescription</key><string>This app requires access to the photo library</string><key>NSCameraUsageDescription</key><string>This app requires access to the camera</string><key>CFBundleDevelopmentRegion</key><string>en</string><key>CFBundleDisplayName</key><string>My App</string><key>CFBundleExecutable</key><string>$(EXECUTABLE_NAME)</string><key>CFBundleIdentifier</key><string>$(PRODUCT_BUNDLE_IDENTIFIER)</string><key>CFBundleInfoDictionaryVersion</key><string>6.0</string><key>CFBundleName</key><string>$(PRODUCT_NAME)</string><key>CFBundlePackageType</key><string>APPL</string><key>CFBundleShortVersionString</key><string>1.0</string><key>CFBundleSignature</key><string>????</string><key>CFBundleURLTypes</key><array><dict><key>CFBundleURLSchemes</key><array><string>fb1925390554405438553</string></array></dict><dict><key>CFBundleTypeRole</key><string>Editor</string><key>CFBundleURLSchemes</key><array>    <string>com.googleusercontent.apps.15678542661-g6ogpnitc5bldoficd2sgob9mrqcb295</string></array></dict></array><key>CFBundleVersion</key><string>2</string><key>FacebookAppID</key><string>192532214438553</string><key>FacebookDisplayName</key><string>3-Rap</string><key>GADApplicationIdentifier</key><string>ca-app-pub-1970767340436749~5956897205</string><key>LSApplicationCategoryType</key><string></string><key>LSApplicationQueriesSchemes</key><array><string>fbapi</string><string>fbapi20130214</string><string>fbapi20130410</string><string>fbapi20130702</string><string>fbapi20131010</string><string>fbapi20131219</string><string>fbapi20140410</string><string>fbapi20140116</string><string>fbapi20150313</string><string>fbapi20150629</string><string>fbapi20160328</string><string>fbauth</string><string>fbauth2</string><string>fbshareextension</string></array><key>LSRequiresIPhoneOS</key><true/><key>NSAppTransportSecurity</key><dict><key>NSAllowsArbitraryLoads</key><true/><key>NSExceptionDomains</key><dict><key>localhost</key><dict><key>NSExceptionAllowsInsecureHTTPLoads</key><true/></dict></dict></dict><key>NSLocationWhenInUseUsageDescription</key><string></string><key>UIAppFonts</key><array><string>Changa-Variable.ttf</string><string>Feather.ttf</string><string>Fontisto.ttf</string><string>AntDesign.ttf</string><string>Entypo.ttf</string><string>EvilIcons.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>MaterialCommunityIcons.ttf</string><string>MaterialIcons.ttf</string><string>SimpleLineIcons.ttf</string><string>Zocial.ttf</string><string>Octicons.ttf</string></array><key>UILaunchStoryboardName</key><string>Launch Screen</string><key>UIRequiredDeviceCapabilities</key><array><string>armv7</string></array><key>UISupportedInterfaceOrientations</key><array><string>UIInterfaceOrientationPortrait</string><string>UIInterfaceOrientationLandscapeLeft</string><string>UIInterfaceOrientationLandscapeRight</string></array><key>UIViewControllerBasedStatusBarAppearance</key><false/></dict></plist>

How to test npm library having native dependecy

$
0
0

I am new to the world of testing.

I have react-native-formly npm library written entirely in javascript but have a component or two which are dependent on native libraries like react-native-image-picker.

Recently, I updated all my dependencies thinking it won't cause any breaking changes but it turned out it actually did.

My primary goal here is to write test cases for the component which require native implementation (test case as simple as app doesn't crash on initialising my component).

How to handle certificates after changing Bundle ID of uploaded app that got accepted

$
0
0

I want to know if anyone tried to change bundle id after uploading IPA to App Store Connect and got accepted, I had to change bundle id and I know that I have to create a new project on App Store connect if bundle id changed and I will do so ... My issue here is when I change bundle id and use expo build:ios -c to clear cached certificates including provisioning profile then let expo handles creating provisioning profile I find my self with the same old bundle id how to get rid of all what is related to old project that I am gonna remove and build my app as the first time I would do so?

Error message that terminates the build:

Error: validateProvisioningProfile: wrong bundleIdentifier found in provisioning profile; expected: com.companyname.appname, found (in provisioning profile): com.companyname.AppNameat _ensureBundleIdentifierIsValid (/usr/local/turtle-js/node_modules/@expo/xdl/build/detach/IosCodeSigning.js:167:11)at Object.validateProvisioningProfile (/usr/local/turtle-js/node_modules/@expo/xdl/build/detach/IosCodeSigning.js:144:3)at Object.build (/usr/local/turtle-js/node_modules/@expo/xdl/build/detach/IosIPABuilder.js:133:24)at async buildAndSignIPA (/usr/local/turtle-js/build/builders/ios/archive.js:61:5)at async Object.buildArchive [as default] (/usr/local/turtle-js/build/builders/ios/archive.js:28:9)at async Object.iosBuilder [as ios] (/usr/local/turtle-js/build/builders/ios/index.js:29:13)at async build (/usr/local/turtle-js/build/jobManager.js:158:24)at async processJob (/usr/local/turtle-js/build/jobManager.js:103:32)at async Object.doJob (/usr/local/turtle-js/build/jobManager.js:35:5)at async main (/usr/local/turtle-js/build/server.js:44:13)

Integrate react-native version 0.62.2 into existing IOs app error

$
0
0

Following react-native document to integrate react-native to existing IOs app. The structure of directory as document to integrate is

android/ios/   Podfile   #...other ios filenode_modules/  react-native  react  @react-native-community  package.json.... 

So that when run pod install from Podfile can call function use_native_modules

require_relative './libs/react-native-libs/node_modules/@react-native-community/cli-platform-ios/native_modules'...use_native_modules!

But I want to organize the project different due to not change my existing project structure,

so I add react-native-integrate module like as a part of my IOs project like this

my_ios_project  Podfile  libs/     ... other modules     react-native-integrate         node_modules             react-native             @react-native-community             react          package.json

And then I change the path of relative-module:

require_relative './libs/react-native-libs/node_modules/@react-native-community/cli-platform-ios/native_modules'...use_native_module!   

But the problem is in native_modules files and others libraries in node_modules use absolute require. For example in @react-community/cli-platform-ios/native_module.rb there is a line such as

cli_resolve_script = "try {console.log(require('@react-native-community/cli').bin);} catch (e) {console.log(require('@react-native/cli'))}"

that require absolute path '@react-native-community'. So that when I run Pod install my pod file from parent directory the node can not recognize my children module so that it cause error. enter image description here

As I know the node_module 'spaths list is basically a list of node_modules directories under every directory from the current directory to the root directory. And the current directory is that the directory of the Podfile that call require 'native_module.rb'Could you please give me a solution solve this problem like add node path from children directory or something else ? Thank you.

What is the difference between react-native cli and Expo with Bare workflow?

$
0
0

I am going to build a very big application with multiple complex functionalities. but I am stuck on bellow points -

  1. What is the difference between react-native cli and Expo with Bare workflow?
  2. what Should I include in my project and why?
  3. is Facebook created expo?

StatusBar background color iOS React Native

$
0
0

Is there a method to set background color or transparent Statusbar on iOS?

"react-native": "0.54.2"

enter image description here

How to install react-native-track-player

$
0
0

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 the react-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 the SWIFT_VERSION attribute set. Please contact the author or set the SWIFT_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?


No such module 'React' - Integrating React Native into existing apps

$
0
0

I'm trying to add React Native into an existing iOS app developed in Swift.

I created a new Swift project and followed the instructions at the official documentation:

At the "Code Integration" step of this documentation, when I try to "import React" it gives me the following error:

enter image description here

I can "Jump to Definition":

enter image description here

Everything is installed either via yarn or pods.

Tech stack versions are:

MacOS: 10.15.4Xcode: 11.4React-Native: 0.62.2React: 16.11.0RN Cli: 4.8.0

I've been looking around for an answer but couldn't find anything related to this. I'm new to React-Native and I've just started to learn Xcode and its underlying principles. So it is possible that I'm missing something very fundamental here. Yet I couldn't figured it out.

Could you point me in the right direction?

How to call Await functions inside Realm.open function?

$
0
0

i was trying to integrate Realm db to my project

Model File : export const CHAT_LIST_SCHEMA = {  name: 'ImList',  properties: {    name: 'string',    rid: 'string',    lastMessage: 'string',    time: 'string',  },};
Code : init = async () => {    try {      Realm.open({ schema: CHAT_LIST_SCHEMA }).then((realm) => {        let cachedData = realm.objects('ImList');        console.log('Cached Data', cachedData);        if (cachedData === '') {          console.log('called123');          this.setState({ data: cachedData });        } else {          console.log('called');        const result = await RocketChat.getIMlist(); // API Call        const data = await RocketChat.getRoomsList(result); // Filtering          realm.write(() => {            data.map((items) => {              realm.create('ImList', {                name: items.name,                rid: items.rid,                lastMessage: items.lastMessage,                time: items.time,              });            });          });        }      });    } catch (error) {      console.log(error);    }  };

But it shows I cant call await outside an async function, but I only need to get data from the API, if the DB is empty. What to do?

How to convert timestamp value to specific time format using react native?

$
0
0

In my scenario, I need to convert timestamp value to specific time format in react native. I tired below code but can't able to achieve exact formate output. How to achieve it?

 var dateTime = new Date(23456789 * 1000);    this.setState({DateTime:('0'+ dateTime.getUTCDate()).slice(-2) +'/'+ ('0'+ dateTime.getUTCMonth()).slice(-2) +'/'+ dateTime.getUTCFullYear() +''+ ('0'+ dateTime.getUTCHours()).slice(-2)        });

Exact output expecting : Wed, 2/01/2000 - 1.10 AM

"RCTBundleURLProvider.h" file not found - AppDelegate.m

$
0
0

I am trying to run my React Native app in XCode and I keep getting this error. I cannot figure out how to resolve the issue. Any suggestions?

Screen Shot of Error in XCode:

screenshot

Disable Strong Password yellow highlight in ReactNative TextInput field for iOS when secureTextEntry is used

$
0
0

How can I disable the password autofill feature in iOS 12 and higher in ReactNative TextInput when secureTextEntry is used.From searching in SO i have found some workaround likely-blurOnSubmit={false}onSubmitEditing={()=> Keyboard.dismiss()}`and textContentType='oneTimeCode' or textContentType='none'

but this issue keeps appearing.Can anyone guide me through this to solve the problem in ReactNative side.Also I have found solution for native iOS side but i don't know how to do it for ReactNative here's the link iOS 11 disable password autofill accessory view option?Imageenter image description here

How to remove reference from Xcode after deleting file from library?

$
0
0

Xcode is not allowing to upload app with deprecated webview API. So I have deleted this file from react-native to resolved this issue. But on build time it gives me below error. How can I solve this issue?If I am removing any from the library, how to remove its reference from Xcode. I want to remove file reference using CLI or any custom command to do this.

The following build commands failed:    PBXCp Views/RCTWebView.h /Users/runner/Library/Developer/Xcode/DerivedData/community_app-cldwyrbdtciuokgdmkewvkkfdofo/Build/Intermediates.noindex/ArchiveIntermediates/community_app/BuildProductsPath/Release-iphoneos/include/React/RCTWebView.h    PBXCp Views/RCTWebViewManager.h /Users/runner/Library/Developer/Xcode/DerivedData/community_app-cldwyrbdtciuokgdmkewvkkfdofo/Build/Intermediates.noindex/ArchiveIntermediates/community_app/BuildProductsPath/Release-iphoneos/include/React/RCTWebViewManager.h(2 failures)

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?



React Native blank screen on navigation while iOS keyboard is active

$
0
0

I have a weird bug when I try to navigate while iOS keyboard is active (watch the video below)

video:https://streamable.com/qzbfiy

My code for the submit button:

.then(() => {        dispatchAfterMutationSuccess()      }).then(() => {        clearAfterMutation()      }).then(() => {        props.navigation.navigate('RequestList')      }).catch((error) => {        console.log(error)        modalMutationErrorHandlerVisibility(true, 'green')      })

Those functions are toggled after a GraphQL mutation and I removed everything except the navigation and still got the same problem. I also tried to dismiss the keyboard in my submit function and didn't work but if I dismiss the keyboard by pressing away and then press the submit button, everything is good. Sometimes the blank screen hide and show just like in the video but it can stick there and I have to reboot the entire app.

my package.json:

{"main": "node_modules/expo/AppEntry.js","scripts": {"start": "expo start","android": "expo start --android","ios": "expo start --ios","web": "expo start --web","eject": "expo eject","test": "jest"  },"dependencies": {"@apollo/react-hooks": "latest","@dudigital/react-native-zoomable-view": "^1.0.15","@expo/samples": "~3.0.3","@expo/vector-icons": "^10.0.0","@react-native-community/art": "^1.1.2","@react-native-community/async-storage": "^1.6.2","@react-native-community/datetimepicker": "2.2.2","@react-navigation/web": "^1.0.0-alpha.9","apollo-boost": "^0.4.4","apollo-upload-client": "^12.1.0","babel-eslint": "^10.0.3","cache": "^2.3.1","color": "latest","expo": "^37.0.0","expo-asset": "~8.1.4","expo-cli": "^3.19.2","expo-constants": "~9.0.0","expo-crypto": "~8.1.0","expo-document-picker": "~8.1.0","expo-file-system": "~8.1.0","expo-font": "~8.1.0","expo-image-manipulator": "~8.1.0","expo-image-picker": "~8.1.0","expo-local-authentication": "~9.0.0","expo-localization": "~8.1.0","expo-network": "~2.1.0","expo-permissions": "~8.1.0","expo-web-browser": "~8.1.0","global": "^4.4.0","graphql": "^14.5.8","graphql-tag": "^2.10.1","i18n-js": "^3.3.0","jwt-decode": "^2.2.0","messaging-api-telegram": "^0.8.2","moment": "^2.24.0","native-base": "^2.13.8","react": "16.9.0","react-apollo": "^3.1.3","react-dom": "16.9.0","react-hook-form": "^3.28.9","react-i18next": "^11.0.1","react-native": "https://github.com/expo/react-native/archive/sdk-37.0.0.tar.gz","react-native-appearance": "~0.3.3","react-native-appstate-hook": "^1.0.3","react-native-document-picker": "^3.2.4","react-native-dropdown-autocomplete": "^1.0.18","react-native-easy-toast": "^1.2.0","react-native-extra-dimensions-android": "^1.2.5","react-native-fetch-blob": "^0.10.8","react-native-gesture-handler": "~1.6.0","react-native-gifted-chat": "^0.13.0","react-native-linear-gradient": "^2.5.6","react-native-loading-spinner-overlay": "^1.1.0","react-native-markdown-renderer": "^3.2.8","react-native-modal-datetime-picker": "^8.5.4","react-native-picker-select": "^6.3.4","react-native-progress": "^4.0.3","react-native-read-more-text": "^1.1.0","react-native-reanimated": "~1.7.0","react-native-responsive-fontsize": "^0.3.0","react-native-restart": "^0.0.13","react-native-s3-upload": "^0.0.12","react-native-safe-area-context": "0.7.3","react-native-screens": "~2.2.0","react-native-segmented-control-tab": "^3.4.1","react-native-view-more-text": "^2.1.0","react-native-web": "^0.11.7","react-navigation": "^4.0.10","react-navigation-drawer": "^2.3.3","react-navigation-fluid-transitions": "^0.3.2","react-navigation-hooks": "^1.1.0","react-navigation-stack": "^1.9.4","reset": "^0.1.0","standard": "^14.3.1","tdlib": "^0.0.0-alpha.0","telegram-mtproto": "^1.0.5","toggle-switch-react-native": "^2.1.0","url": "^0.11.0","waait": "^1.0.5","yarn": "^1.22.0"  },"devDependencies": {"@apollo/react-testing": "^3.1.3","@testing-library/jest-dom": "^4.2.4","@testing-library/react": "^9.3.2","babel-preset-expo": "^8.1.0","eslint": "^6.6.0","eslint-plugin-react": "^7.16.0","jest-expo": "^37.0.0","jest-expo-enzyme": "^0.0.1","react-app-rewired": "^2.1.5"  },"private": true}

Conditionaly build for simulators

$
0
0

My application uses a native library that only runs on devices, the EZVIZ SDK, is there a way to conditionally build so that those files are left out both on the the native and JS side when the app is built for a simulator

How to set zoom level in google map according to miles in react native?

$
0
0

I have react native application using react-native-maps,in which there is a feature to display near by users based on radius chosen by user that works fine using geocode. but I am facing problem to set zoom level of Map based on user radius? if user selects maximum meter of radius then map should display whole world? How can I achieve this? to set zoom level dynamically based on radius chosen by user?

to set radius used react-native-slider, How can set zoom level on slide of slider?

react-native run-ios fails with ld: symbol(s) not found for architecture x86_64

$
0
0

I am trying to build my react-native project on iOS simulator and getting the below error:

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 MyProject.xcworkspace...ld: symbol(s) not found for architecture x86_64clang: error: linker command failed with exit code 1 (use -v to see invocation)** BUILD FAILED **

I have researched my part and tried possible solutions here and here which seem to not work.

I am using react-native version ~0.61.4 and Xcode Version 11.4.1 on macOS Catalina version 10.15.2Even the app doesn't start on simulator.

EDIT

I cleaned the Xcode Workspace, ran pod deintregate and pod install and then react-native run-ios with gives me these following details:

Undefined symbols for architecture x86_64:"__swift_FORCE_LOAD_$_swiftCompatibility50", referenced from:      __swift_FORCE_LOAD_$_swiftCompatibility50_$_Lottie in liblottie-ios.a(AnimatedButton.o)      __swift_FORCE_LOAD_$_swiftCompatibility50_$_Lottie in liblottie-ios.a(AnimatedControl.o)      __swift_FORCE_LOAD_$_swiftCompatibility50_$_Lottie in liblottie-ios.a(AnimationContainer.o)      __swift_FORCE_LOAD_$_swiftCompatibility50_$_Lottie in liblottie-ios.a(AnimationSubview.o)      __swift_FORCE_LOAD_$_swiftCompatibility50_$_Lottie in liblottie-ios.a(CompatibleAnimationView.o)      __swift_FORCE_LOAD_$_swiftCompatibility50_$_Lottie in liblottie-ios.a(CompositionLayer.o)      __swift_FORCE_LOAD_$_swiftCompatibility50_$_Lottie in liblottie-ios.a(NullCompositionLayer.o)      ...     (maybe you meant: __swift_FORCE_LOAD_$_swiftCompatibility50_$_lottie_react_native, __swift_FORCE_LOAD_$_swiftCompatibility50_$_Lottie )"__swift_FORCE_LOAD_$_swiftCompatibilityDynamicReplacements", referenced from:      __swift_FORCE_LOAD_$_swiftCompatibilityDynamicReplacements_$_Lottie in liblottie-ios.a(AnimatedButton.o)      __swift_FORCE_LOAD_$_swiftCompatibilityDynamicReplacements_$_Lottie in liblottie-ios.a(AnimatedControl.o)      __swift_FORCE_LOAD_$_swiftCompatibilityDynamicReplacements_$_Lottie in liblottie-ios.a(AnimationContainer.o)      __swift_FORCE_LOAD_$_swiftCompatibilityDynamicReplacements_$_Lottie in liblottie-ios.a(AnimationSubview.o)      __swift_FORCE_LOAD_$_swiftCompatibilityDynamicReplacements_$_Lottie in liblottie-ios.a(CompatibleAnimationView.o)      __swift_FORCE_LOAD_$_swiftCompatibilityDynamicReplacements_$_Lottie in liblottie-ios.a(CompositionLayer.o)      __swift_FORCE_LOAD_$_swiftCompatibilityDynamicReplacements_$_Lottie in liblottie-ios.a(NullCompositionLayer.o)      ...     (maybe you meant: __swift_FORCE_LOAD_$_swiftCompatibilityDynamicReplacements_$_lottie_react_native, __swift_FORCE_LOAD_$_swiftCompatibilityDynamicReplacements_$_Lottie )"_main", referenced from:     implicit entry/start for main executable     (maybe you meant: _OBJC_IVAR_$_RCTScrollView._maintainVisibleContentPosition)

Referring to this question, I tried the solution with nothing good. Any suggestions on how to fix this?

ios universal redirection link is not working on real device, but working on emulator

$
0
0

I am using univeral link in react native. It working on ios emulator but not working on real device.Follow is apple-app-site-association file.

{"applinks": {"apps": [],"details": [            {"appID": "L439KYBPK7.com.****.****","paths": [ "/auth/redirect"]            }        ]    }}

Follow is xcode configuration:

applink screenshoturl scheme screenshot

As I said, app is working on ios emulator(13.4.1) but not working on real device(13.4.1), that is, after oauth complete, no redirect to app on real device.I hope your help. Thanks for your advance.

Viewing all 16558 articles
Browse latest View live


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