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

running command "xcodebuild" exited with error code 65

$
0
0

I have written a project with react-native and it works on Android. Now I want to run it on ios. When I build my project in Xcode it is okay and I have the "Build succeed" message. But when I run the project in my IDE I have the following 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 MyProjectName.xcodeproj** BUILD FAILED **The following build commands failed:myProjectDirectory/ios/build/MyProjectName/Build/Products/Debug-iphonesimulator/ReactNativeNavigationTests.xctest/ReactNativeNavigationTests normal x86_64(1 failure)....

I have tried bellow solutions, but none of them worked for me:

1- I removed the build folder from ios and rebuild the project again.2- I ran "npm dedupe"3- I built a simple new project and I could see "Welcome to React Native..." page on iphone.Then I installed wix v2 library in this project and I could see the page again. It means my problem is not about xcode version or wix installation steps.4- I have clean and rebuild my project in xcode.

I searched a lot on the internet. But I couldn't find any helpful solution.

Any suggestion will be helpful.


anyone plesae suggestme the steps to learn react native [closed]

$
0
0

"Hello everyone,

I'm eager to dive into app development with React Native, but I'm feeling a bit overwhelmed by the wealth of resources out there. Could anyone share their experiences and offer some guidance on how to effectively learn React Native and kickstart my journey into app development? Any recommended tutorials, courses, or tips would be greatly appreciated!

React Native splash screen on ios

$
0
0

I am developing an app using react native and trying to add a splash screen on ios. I have added the following code on AppDelegate.mm

- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions{  self.moduleName = @"eCare";  // You can add your custom initial props in the dictionary below.  // They will be passed down to the ViewController used by React Native.  self.initialProps = @{};  [RNSplashScreen show]; //Added this line  return [super application:application didFinishLaunchingWithOptions:launchOptions];}

My app is stuck in the splash screen after this. I hid the splash screen on the root screen of react native. I followed the official guide here

Network Request Failed - App running on IOS

$
0
0

Context:

  • I have a mobile app with a login functionality that sends a POST request to a local API hosted on my PC at http://192.168.1.110:8000/api/login or (http://127.0.0.1:8000/api/login).
  • The code works perfectly on an emulator but fails on a physical iPhone with a "Network request failed" error and a console warning about an unhandled promise rejection.

const response = await fetch('http://192.168.1.110:8000/api/login?email='+          `${email}` +'&password='+          `${password}`,        {          method: 'POST',          headers: {            Accept: 'application/json','Content-Type': 'application/json',          },        },      );

Troubleshooting Steps Taken:

  • Verified firewalls on your PC and router are not blocking the connection.
  • Confirmed both the iPhone and PC are on the same Wi-Fi network.

how to get Expo text-to-speech iOS working?

$
0
0

I can't get iOS simulator or my iPhone to narrate the text on iOShere is a summary of my code:

'import React, {useStat } from 'react';    import { View, Text, StyleSheet, ScrollView, Image, Dimensions, Pressable               } from 'react-native';    import { AntDesign } from '@expo/vector-icons';    import * as Speech from 'expo-speech';    const { width } = Dimensions.get('window');    const screenWidthMinus50 = (width) - 50;    const App = () => {     const [isNarrating, setIsNarrating] = useState(false);     const toggleNarration = () => {      if (isNarrating) {        Speech.stop();      } else {        narrateTextElements();      }      setIsNarrating(!isNarrating);    };      const narrateTextElements =  () => {        const textElements = ["Test text"        ];         const textToNarrate = textElements.join('. ');        Speech.speak(textToNarrate, {          rate: 1.0,          pitch: 1.0,          language: 'en-AU'         });    };      return (<ScrollView contentContainerStyle={styles.container}><Pressable onPress={toggleNarration}><AntDesign name="playcircleo" size={18} color={isNarrating ? 'blue' : 'black'} /></Pressable><Text style={styles.description}>           Test text</Text></ScrollView>      );    };     const styles = StyleSheet.create({      container: {        flexGrow: 1,        padding: 20,        alignItems: 'center',        },        image: {        width: screenWidthMinus50,        height: screenWidthMinus50,        resizeMode: 'cover',        marginBottom: 10,       },       description: {         fontSize: 16,        lineHeight: 24,      },    });    export default App;'

tried useEffect with expo-av. with no success. I tried running an MP3 prior to the text-to-speech with no effect. I still can't get the text to be read in my app. it seems like it's an iOS specific problem. I also toggled silent and non silent mode with no effect

Developing a react native application that is using pedometer of android and ios mobile

$
0
0

I am using this library to count steps in react native mobile app. Issue is that my application is receiving wrong data. As I got in my server that a user walk 80k steps instantly. So I put log using mixpanel and got to know that this library return steps like this 3,6,9,.....200, 5000, ....

So there is something wrong with it but inside ios code of library it is just returning what it got from CMPedometer in ios.

Is it possible that sensor returns wrong steps or user can do some cheating. My app is already not working on jailbreak devices.

Terminating app due to uncaught exception 'RCTFatalException: Unsupported'

$
0
0

enter image description hereI am developing a React Native project. It was all fine until I decided to update Reanimated as the app would display error on android "If you want to use Reanimated 2 ....". Since then, the app displays the following error on launch (pasting error from xcode):

Terminating app due to uncaught exception 'RCTFatalException: Unsupported', reason: 'Unsupported'*** First throw call stack:(0 CoreFoundation 0x00000001149e9571 __exceptionPreprocess + 2421 libobjc.A.dylib 0x00000001100977e8 objc_exception_throw + 482 araz 0x000000010250c115 RCTFormatError + 03 araz 0x00000001025230a1 __28-[RCTCxxBridge handleError:]_block_invoke + 5774 libdispatch.dylib 0x00000001155273ec _dispatch_call_block_and_release + 125 libdispatch.dylib 0x00000001155286d8 _dispatch_client_callout + 86 libdispatch.dylib 0x000000011553748c _dispatch_main_queue_drain + 14207 libdispatch.dylib 0x0000000115536ef2 _dispatch_main_queue_callback_4CF + 318 CoreFoundation 0x0000000114945b34 CFRUNLOOP_IS_SERVICING_THE_MAIN_DISPATCH_QUEUE+ 99 CoreFoundation 0x000000011494046f __CFRunLoopRun + 246310 CoreFoundation 0x000000011493f6ed CFRunLoopRunSpecific + 55711 GraphicsServices 0x0000000119b5308f GSEventRunModal + 13712 UIKitCore 0x000000012aa8d6ee -[UIApplication _run] + 97213 UIKitCore 0x000000012aa9216e UIApplicationMain + 12314 araz 0x000000010237f4f0 main + 8015 dyld 0x000000010c0593e0 start_sim + 1016 ??? 0x0000000203e65366 0x0 + 8655360870)libc++abi: terminating due to uncaught exception of type NSException

Versions I am using :

"react-native": "0.63.0",

It was working fine with react-native-reanimated 2.2.2 on ios, but now if I downgrade it back, it still wouldn't launch.

I tried:

  • versions 2.4.0, 2.8.0, 2.9.1, 2.10.0, 2.14.0, 2.17.0

  • deleting the app from simulator and installing again

  • clearing the cache

  • deleting&installing node_modules

  • deleting&installing Pods and Podfile.lock

Any help would be appreciated

Problem in React Native v0.62.2 with Flipper pods and post install hooks

$
0
0

Im new in react native, and i facing the problem: Im using react native with flipper pods, and my pod file contain this code:

add_flipper_pods!  post_install do |installer|    flipper_post_install(installer)  end

But i need change my deployment target version of other pods with

post_install do |pi|    pi.pods_project.targets.each do |t|      t.build_configurations.each do |config|        config.build_settings['IPHONEOS_DEPLOYMENT_TARGET'] = '11.0'      end    end  end

I get 3 different bugs, when try to solve this.How can i get combine this two hooks, or get other solutions to this problem?My pod file:

platform :ios, '9.0'require_relative '../node_modules/@react-native-community/cli-platform-ios/native_modules'def add_flipper_pods!(versions = {})  versions['Flipper'] ||= '~> 0.33.1'  versions['DoubleConversion'] ||= '1.1.7'  versions['Flipper-Folly'] ||= '~> 2.1'  versions['Flipper-Glog'] ||= '0.3.6'  versions['Flipper-PeerTalk'] ||= '~> 0.0.4'  versions['Flipper-RSocket'] ||= '~> 1.0'  pod 'FlipperKit', versions['Flipper'], :configuration => 'Debug'  pod 'FlipperKit/FlipperKitLayoutPlugin', versions['Flipper'], :configuration => 'Debug'  pod 'FlipperKit/SKIOSNetworkPlugin', versions['Flipper'], :configuration => 'Debug'  pod 'FlipperKit/FlipperKitUserDefaultsPlugin', versions['Flipper'], :configuration => 'Debug'  pod 'FlipperKit/FlipperKitReactPlugin', versions['Flipper'], :configuration => 'Debug'  # List all transitive dependencies for FlipperKit pods  # to avoid them being linked in Release builds  pod 'Flipper', versions['Flipper'], :configuration => 'Debug'  pod 'Flipper-DoubleConversion', versions['DoubleConversion'], :configuration => 'Debug'  pod 'Flipper-Folly', versions['Flipper-Folly'], :configuration => 'Debug'  pod 'Flipper-Glog', versions['Flipper-Glog'], :configuration => 'Debug'  pod 'Flipper-PeerTalk', versions['Flipper-PeerTalk'], :configuration => 'Debug'  pod 'Flipper-RSocket', versions['Flipper-RSocket'], :configuration => 'Debug'  pod 'FlipperKit/Core', versions['Flipper'], :configuration => 'Debug'  pod 'FlipperKit/CppBridge', versions['Flipper'], :configuration => 'Debug'  pod 'FlipperKit/FBCxxFollyDynamicConvert', versions['Flipper'], :configuration => 'Debug'  pod 'FlipperKit/FBDefines', versions['Flipper'], :configuration => 'Debug'  pod 'FlipperKit/FKPortForwarding', versions['Flipper'], :configuration => 'Debug'  pod 'FlipperKit/FlipperKitHighlightOverlay', versions['Flipper'], :configuration => 'Debug'  pod 'FlipperKit/FlipperKitLayoutTextSearchable', versions['Flipper'], :configuration => 'Debug'  pod 'FlipperKit/FlipperKitNetworkPlugin', versions['Flipper'], :configuration => 'Debug'end# Post Install processing for Flipperdef flipper_post_install(installer)  installer.pods_project.targets.each do |target|    if target.name == 'YogaKit'      target.build_configurations.each do |config|        config.build_settings['SWIFT_VERSION'] = '4.1'      end    end  endendtarget 'escapenavigator' do  # Pods for escapenavigator  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/callinvoker', :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', :modular_headers => true  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'  pod 'RNCAsyncStorage', :path => '../node_modules/@react-native-community/async-storage'  # post_install do |pi|  #   pi.pods_project.targets.each do |t|  #     t.build_configurations.each do |config|  #       config.build_settings['IPHONEOS_DEPLOYMENT_TARGET'] = '11.0'  #     end  #   end  # end  target 'escapenavigatorTests' do    inherit! :complete    # Pods for testing  end  use_native_modules!  # Enables Flipper.  #  # Note that if you have use_frameworks! enabled, Flipper will not work and  # you should disable these next few lines.  add_flipper_pods!  post_install do |installer|    flipper_post_install(installer)  endendtarget 'escapenavigator-tvOS' do  # Pods for escapenavigator-tvOS  target 'escapenavigator-tvOSTests' do    inherit! :search_paths    # Pods for testing  endend

Thanks!


Expo-notifications not working on device, but getting token

$
0
0

I'm building an React Native Expo app and trying to get expo-notifications working. I'm taking code from an existing app that does create push notifications, but for some reason, it's not working with this current build.

In package.json:"expo-notifications": "^0.27.7"

I have followed the standard implementation:

    import React, { useState, useEffect, useRef } from "react";    import * as Device from "expo-device";    import * as Notifications from "expo-notifications";    import Constants from "expo-constants";    import { Platform } from "react-native";    export const usePushNotifications = () => {      Notifications.setNotificationHandler({        handleNotification: async () => ({          shouldPlaySound: true,          shouldShowAlert: true,          shouldSetBadge: false,        }),      });  // Can use this function below or use Expo's Push Notification Tool from: https://expo.dev/notifications  async function sendPushNotification(expoPushToken) {    const message = {      to: expoPushToken,      sound: "default",      title: "Original Title",      body: "And here is the body!",      data: { someData: "goes here" },    };    await fetch("https://exp.host/--/api/v2/push/send", {      method: "POST",      headers: {        Accept: "application/json","Accept-encoding": "gzip, deflate","Content-Type": "application/json",      },      body: JSON.stringify(message),    });  }  const [expoPushToken, setExpoPushToken] = useState("");  const [notification, setNotification] = useState(false);  const notificationListener = useRef();  const responseListener = useRef();  async function registerForPushNotificationsAsync() {    let token;    if (Platform.OS === "android") {      await Notifications.setNotificationChannelAsync("default", {        name: "default",        importance: Notifications.AndroidImportance.MAX,        vibrationPattern: [0, 250, 250, 250],        lightColor: "#FF231F7C",      });    }    if (Device.isDevice) {      const { status: existingStatus } =        await Notifications.getPermissionsAsync();      let finalStatus = existingStatus;      if (existingStatus !== "granted") {        const { status } = await Notifications.requestPermissionsAsync();        finalStatus = status;      }      if (finalStatus !== "granted") {        alert("Failed to get push token for push notification!");        return;      }      token = await Notifications.getExpoPushTokenAsync({        projectId: Constants.expoConfig?.extra?.eas.projectId,      });    } else {      alert("Must be using a physical device for Push Notifications");    }    return token;  }  useEffect(() => {    registerForPushNotificationsAsync().then((token) =>      setExpoPushToken(token)    );    notificationListener.current =      Notifications.addNotificationReceivedListener((notification) => {        setNotification(notification);      });    notificationListener.current =      Notifications.addNotificationReceivedListener((notification) => {        setNotification(notification);      });    responseListener.current =      Notifications.addNotificationResponseReceivedListener((response) => {        console.log(response);      });    return () => {      Notifications.removeNotificationSubscription(        notificationListener.current      );      Notifications.removeNotificationSubscription(responseListener.current);    };  }, []);  return {    expoPushToken,    notification,  };};

And then within app.js

  const { expoPushToken } = usePushNotifications();  console.log("Push Notifications token :", expoPushToken);

So, nothing crazy. Basic setup.

I run the app (npx expo start --dev-client) and run on my iPhone that is registered on my Expo project. Either using the Expo Notifications page, or running sendPushNotification() using the token I'm getting from the console, everything runs ok (status:200) - but I'm getting nothing to the device. I've checked that notifications are allowed on the device and device is not silent.

Any advice on triage?The response I get from the console if I fire the notification from the app:

Notification Response : {"_bodyBlob": {"_data": {"__collector": [Object], "blobId": "B44199F9-59EE-4CD2-9D2E-DC088353524F", "name": "send.json", "offset": 0, "size": 68, "type": "application/json"}}, "_bodyInit": {"_data": {"__collector": [Object], "blobId": "B44199F9-59EE-4CD2-9D2E-DC088353524F", "name": "send.json", "offset": 0, "size": 68, "type": "application/json"}}, "bodyUsed": false, "headers": {"map": {"alt-svc": "h3=\":443\"; ma=2592000,h3-29=\":443\"; ma=2592000", "content-length": "68", "content-type": "application/json; charset=utf-8", "date": "Sun, 28 Apr 2024 05:19:26 GMT", "etag": "\"44-qrsRHa9ppS08dGDo3z285YOag10\"", "strict-transport-security": "max-age=31536000; includeSubDomains", "vary": "Accept-Encoding, Origin", "via": "1.1 google", "x-content-type-options": "nosniff", "x-frame-options": "SAMEORIGIN"}}, "ok": true, "status": 200, "statusText": "", "type": "default", "url": "https://exp.host/--/api/v2/push/send"}

Status:200

I've even rebuilt the app (create-expo-app) and copied all code across, just to see if there was something strange going on. I've also deleted node_modules and yarn install to recreate.

I'm at a loss....

'Debug-iphoneos/AmplifyRTNCore/AmplifyRTNCore.modulemap' not found

$
0
0

I am getting above error with following configuration:

  • Mackbook Pro [Apple M1 Pro] [Sonoma 14.1]
  • Xcode 15.2
  • Device iPhone 15 Pro [17.3.1]
  • react [18.2.0]
  • react-native [0.73.4]
  • aws-amplify [6.0.17]
  • npm [10.5.0]
  • node [21.7.1]
  • gem [3.5.6]
  • bundler [2.5.6]

to setup my environment I followed this link https://reactnative.dev/docs/environment-setup?package-manager=npm&platform=ios

When I do npm run ios, I am able to build app on simulator and device.Then I followed this link https://reactnative.dev/docs/running-on-deviceto build App from xcode. then I get following errorCompile app_vers.c(arm64) 0.1 seconds'Debug-iphoneos/AmplifyRTNCore/AmplifyRTNCore.modulemap' not found

I have tried following:

  1. Deleting node_modules and re- running npm i > cd ios > bundle exec pod install > cd .. > npx pod-install.
  2. Tried with rosetta [VSCode and terminal] couldn't do for xCode
  3. Updated min_ios_version_supported to 11.0 and 13.0
  4. tried Deleting ~/Library/Developer/Xcode/DerivedDataAnd various other solutions available online

React Native: Fata Error - AmplifyRTNCore/AmplifyRTNCore.modulemap not found

$
0
0

I am trying to build a react native application and get it ready for submission through apple developer portal. When I try to build it in X-code, I get the following error:

/Users/omarjandali/Library/Developer/Xcode/DerivedData/Grubber-ayrnljwcgsxfhigtvjiavybjeacs/Build/Intermediates.noindex/ArchiveIntermediates/Grubber/IntermediateBuildFilesPath/Grubber.build/Release-iphoneos/Grubber.build/DerivedSources/Grubber_vers.c module map file '/Users/omarjandali/Library/Developer/Xcode/DerivedData/Grubber-ayrnljwcgsxfhigtvjiavybjeacs/Build/Intermediates.noindex/ArchiveIntermediates/Grubber/BuildProductsPath/Release-iphoneos/AmplifyRTNCore/AmplifyRTNCore.modulemap' not found

I did integrate AWS amplify into my proejct and it works on my local machine and simulator but when i try to build the project it fails the build. Not sure why it is crashing.

Here is my pod file:

# Resolve react_native_pods.rb with node to allow for hoistingrequire Pod::Executable.execute_command('node', ['-p','require.resolve("react-native/scripts/react_native_pods.rb",    {paths: [process.argv[1]]},  )', __dir__]).stripplatform :ios, min_ios_version_supportedprepare_react_native_project!# If you are using a `react-native-flipper` your iOS build will fail when `NO_FLIPPER=1` is set.# because `react-native-flipper` depends on (FlipperKit,...) that will be excluded## To fix this you can also exclude `react-native-flipper` using a `react-native.config.js`# ```js# module.exports = {#   dependencies: {#     ...(process.env.NO_FLIPPER ? { 'react-native-flipper': { platforms: { ios: null } } } : {}),# ```flipper_config = ENV['NO_FLIPPER'] == "1" ? FlipperConfiguration.disabled : FlipperConfiguration.enabledlinkage = ENV['USE_FRAMEWORKS']if linkage != nil  Pod::UI.puts "Configuring Pod with #{linkage}ally linked Frameworks".green  use_frameworks! :linkage => linkage.to_symendtarget 'Grubber' do  config = use_native_modules!  use_react_native!(    :path => config[:reactNativePath],    # Enables Flipper.    #    # Note that if you have use_frameworks! enabled, Flipper will not work and    # you should disable the next line.    # :flipper_configuration => flipper_config,    # An absolute path to your application root.    :app_path => "#{Pod::Config.instance.installation_root}/.."  )  target 'GrubberTests' do    inherit! :complete    # Pods for testing  end  post_install do |installer|    # https://github.com/facebook/react-native/blob/main/packages/react-native/scripts/react_native_pods.rb#L197-L202    react_native_post_install(      installer,      config[:reactNativePath],      :mac_catalyst_enabled => false    )  endend

xvode minimum development version

I did run pod install and it runns the install command perfectly with no issues and it completes the install process. I can add additional information if needed.

----------- UPDATE --------------------

I tried to go in and switch the Architectures to arm64 like I read and I ran into a different error:

original architecture

I switched to arm64

nwe architecutre

This is the build error I gett when running after chagnes:

PhaseScriptExecution [CP]\ Embed\ Pods\ Frameworks /Users/omarjandali/Library/Developer/Xcode/DerivedData/Grubber-ayrnljwcgsxfhigtvjiavybjeacs/Build/Intermediates.noindex/ArchiveIntermediates/Grubber/IntermediateBuildFilesPath/Grubber.build/Release-iphoneos/Grubber.build/Script-EBD8442A6D35B47C0D374CB4.sh (in target 'Grubber' from project 'Grubber')    cd /Users/omarjandali/GrubberInc/Grubber/ios    /bin/sh -c /Users/omarjandali/Library/Developer/Xcode/DerivedData/Grubber-ayrnljwcgsxfhigtvjiavybjeacs/Build/Intermediates.noindex/ArchiveIntermediates/Grubber/IntermediateBuildFilesPath/Grubber.build/Release-iphoneos/Grubber.build/Script-EBD8442A6D35B47C0D374CB4.shmkdir -p /Users/omarjandali/Library/Developer/Xcode/DerivedData/Grubber-ayrnljwcgsxfhigtvjiavybjeacs/Build/Intermediates.noindex/ArchiveIntermediates/Grubber/BuildProductsPath/Release-iphoneos/Grubber.app/Frameworks/Users/omarjandali/GrubberInc/Grubber/ios/Pods/Target Support Files/Pods-Grubber/Pods-Grubber-frameworks.sh: line 42: source: unbound variableCommand PhaseScriptExecution failed with a nonzero exit code

MapViewDirections Error: Error on GMAPS route request: NOT_FOUND

$
0
0

I am building mobile application in React Native, in one of my screens I am trying to create a map with calculated route. I want to calculate this route using GooglePlacesAutocomplete. Origin point will calculated with geolocation but it's not important in m question. Destination is my problem. I am using expo app on iOS. That's my code:

import React, { useState, useEffect } from "react";import {  StyleSheet,  Text,  View,  ImageBackground,  Pressable,  TextInput,  KeyboardAvoidingView,  Linking,} from "react-native";import { useNavigation } from "@react-navigation/native";import { GooglePlacesAutocomplete } from "react-native-google-places-autocomplete";import MapView, { Marker } from "react-native-maps";import MapViewDirections from "react-native-maps-directions";export default function RideScreen() {  const [destination, setDestination] = useState({    latitude: 48.9,    longitude: 19.6333,  });  const [origin, setOrigin] = useState({    latitude: 49.9,    longitude: 18.6333,  });  const navigation = useNavigation();  useEffect(() => {    console.log("Destination updated:", destination);  }, [destination]);return(...//some code<GooglePlacesAutocomplete          GooglePlacesDetailsQuery={{ fields: "geometry" }}          placeholder="Enter Location"          onPress={(data, details = null) => {            console.log(data, details);            console.log(JSON.stringify(details?.geometry?.location));            console.log(details.geometry.location);            setDestination(details.geometry.location);          }}          query={{ key: "AIzaSyDrWNn9cbscPSSRHNdKQFiCTTLqk74-4mA" }}          fetchDetails={true}          onFail={(error) => console.log(error)}          onNotFound={() => console.log("no results")}          listEmptyComponent={() => (<View style={{ flex: 1 }}><Text>No results were found</Text></View>          )}          styles={{            container: {              position: "absolute",              zIndex: 9999,              width: "100%",            },            textInputContainer: {              flexDirection: "row",              width: 350,              borderRadius: 5,              borderWidth: 0.1,              borderColor: "#eee",              marginHorizontal: 20,            },            textInput: {              backgroundColor: "#FFFFFF",              height: 44,              borderRadius: 5,              paddingVertical: 5,              paddingHorizontal: 10,              fontSize: 15,              flex: 1,              marginTop: 10,            },            poweredContainer: {              justifyContent: "flex-end",              alignItems: "center",              borderBottomRightRadius: 5,              borderBottomLeftRadius: 5,              borderColor: "#c8c7cc",              borderTopWidth: 0.5,              position: "absolute",              zIndex: 9999,            },            powered: {},            listView: {},            row: {              backgroundColor: "#FFFFFF",              padding: 13,              height: 44,              flexDirection: "row",              width: 350,              marginHorizontal: 20,            },            separator: {              height: 0.5,              backgroundColor: "#c8c7cc",            },            description: {},            loader: {              flexDirection: "row",              justifyContent: "flex-end",              height: 20,            },          }}        /><View style={styles.container}><MapView            style={styles.map}            initialRegion={{              latitude: 49.9,              longitude: 18.6333,              latitudeDelta: 0.05,              longitudeDelta: 0.05,            }}><MapViewDirections              origin={origin}              destination={destination}              apikey={google_key}              strokeWidth={4}              strokeColor="red"              mode="DRIVING"              onError={(error) =>                console.log("MapViewDirections Error:", error)              }              onReady={(result) =>                console.log("MapViewDirections Result:", result)              }            /><Marker coordinate={origin} title="Starting Point" /><Marker coordinate={destination} title="Destination Point" /></MapView>... //rest of the code

So, origin is set with no problem and maps can easily find it. But not with destination. If destination i set with default, my app can set the route but if i choose destination from my autocomplete input then i got the error. My logs:

Destination updated: Object {"lat": 49.8223768,"lng": 19.0583845,}Object {"description": "Cieszyn, Poland","matched_substrings": Array [    Object {"length": 5,"offset": 0,    },  ],"place_id": "ChIJtd7hQfIDFEcR8gl_Serl1c4","reference": "ChIJtd7hQfIDFEcR8gl_Serl1c4","structured_formatting": Object {"main_text": "Cieszyn","main_text_matched_substrings": Array [      Object {"length": 5,"offset": 0,      },    ],"secondary_text": "Poland",  },"terms": Array [    Object {"offset": 0,"value": "Cieszyn",    },    Object {"offset": 9,"value": "Poland",    },  ],"types": Array ["locality","political","geocode",  ],} Object {"geometry": Object {"location": Object {"lat": 49.7497638,"lng": 18.6354709,    },"viewport": Object {"northeast": Object {"lat": 49.79296407539032,"lng": 18.70581445993146,      },"southwest": Object {"lat": 49.71860345901323,"lng": 18.59706863867689,      },    },  },}{"lat":49.7497638,"lng":18.6354709}Object {"lat": 49.7497638,"lng": 18.6354709,}Destination updated: Object {"lat": 49.7497638,"lng": 18.6354709,}MapViewDirections Error: Error on GMAPS route request: NOT_FOUNDMapViewDirections Error: Error on GMAPS route request: NOT_FOUNDat node_modules/react-native-maps-directions/src/MapViewDirections.js:217:6 in setState$argument_1- ... 8 more stack frames from framework internals

It looks like destination is okay so why Google Maps can't find the point?

iOS Simulator deployment target 'IPHONEOS_DEPLOYMENT_TARGET' is set to 11.0, but the range of supported deployment target versions is 12.0 to 17.4.99

$
0
0

I have been getting this error in my react native project since I upgraded xcode from 14 to 15.

ı tried to the this in Podfile:

platform :ios, '13.0'

and i tried to the this in Podfile:

post_install do |installer|    installer.generated_projects.each do |project|        project.targets.each do |target|            target.build_configurations.each do |config|                config.build_settings['IPHONEOS_DEPLOYMENT_TARGET'] = '13.0'            end        end    endend

React-native IOS build PhaseScriptExecution error

$
0
0

PhaseScriptExecution [CP-User]\ Generate\ Specs /var/root/Library/Developer/Xcode/DerivedData/AwesomeProject-ctijgwfuqsfcgvbuoytyyjefesnx/Build/Intermediates.noindex/Pods.build/Debug-iphonesimulator/React-Codegen.build/Script-46EB2E00013660.sh (in target 'React-Codegen' from project 'Pods')(1 failure)

Build react-native project with yarn ios and expect this issue.I search from some blogs and forums but i can't see resolve.

Memory concerns in react-native-reanimated-carousel on iOS platform

$
0
0

I have implemented a screen which has multiple carousels (almost 10, 3 slides each), but these carousels on Ios are increasing memory usage of around 70~80 Mb in one minute. this only happens in autoplay on mode.worst part is this incremented memory does not get release on unmount.this happens only in ios, android garbage collects automatically

Any sugesttions are welcomed , what can I try

Thanks in advance.

what I have tried:

using the basic renderItem with no image, and basic implementation in an standalone project. No Improvementused useRef, useMemo , useCallback, memo ,for optimisations, No Improvement

MyExpectationsthere should be no continuous memory increment


React Native: Compatibility between react-native-svg and react-native-svg-charts versions for v0.72.6

$
0
0

I'm developing an application in React Native (v0.72.6) and I've implemented the react-native-svg library along with react-native-svg-charts (v13.10.0 and v5.4.0 respectively) to create some necessary charts in my application. However, when generating the APK, these two libraries are conflicting due to their versions.

Does anyone know which versions of react-native-svg and react-native-svg-charts are currently compatible with React Native v0.72.6?

Any help or suggestions are greatly appreciated!

I tried changing to versions lower than 7 of "react-native-svg" but it does not work.

enter image description here

Why does codegen cause errors when building an ios app?

$
0
0

https://github.com/reactwg/react-native-new-architecture/blob/main/docs/turbo-modules.md

I refer to the page above and I am working on the "react native turbo module" project.
I created the rtn-calculator in the example as a github repository and installed it in my project.

- The guide document I referred to
https://github.com/reactwg/react-native-new-architecture/blob/main/docs/turbo-modules.md

- How to reproduce for errors

  1. Run the git clonegit clone https://github.com/wisdomstar94/react_native_sample_app.git
  2. Move Terminal to Cloned Projectcd react_native_sample_app
  3. npm installnpm i
  4. Move to the terminal foldercd ./ios
  5. Run the pod install command as shown below to activate the new architecture of "react native"bundle install && RCT_NEW_ARCH_ENABLED=1 bundle exec pod install(Source of the above command : https://github.com/reactwg/react-native-new-architecture/blob/main/docs/enable-apps.md#enable-new-architecture-for-ios)
  6. When the ios emulator is ready, run the ios app using the command below.npm run ios
  7. This results in the following error.
......** BUILD FAILED **The following build commands failed:    CompileC /Users/jaehyeonshin/Library/Developer/Xcode/DerivedData/react_native_sample_app-gomarbdmonztkscgyahbghqfrpvu/Build/Intermediates.noindex/Pods.build/Debug-iphonesimulator/rtn-calculator.build/Objects-normal/arm64/RTNCalculator.o /Users/jaehyeonshin/Documents/projects_react_native/react_native_sample_app/node_modules/rtn-calculator/ios/RTNCalculator.mm normal arm64 objective-c++ com.apple.compilers.llvm.clang.1_0.compiler (in target 'rtn-calculator' from project 'Pods')(1 failure)

Why does "rtn-calculator" fail when building?
My "rtn-calculator" turbo module code can be found at "https://github.com/wisdomstar94/rtn-calculator".
Tested on Android with the npm run android command, it works fine. Error only with ios.

React Native - Style property not working in Bottom Sheet

$
0
0

I am setting up bottom sheets in my application. The issue is that I am not able to set the styles in bottom sheets.

Here is my code

<BottomSheet        ref={bottomSheetRef}        snapPoints={['25%']}        index={-1}        style={{backgroundColor:"#000228"}}        enablePanDownToClose>        {renderSheetContent()}</BottomSheet>

I followed everything from the documentation(https://ui.gorhom.dev/components/bottom-sheet/) but still facing this issue.

I want a solution to get rid of this problem.

How do I get a React Native TextInput by its testID in an ios UITest

$
0
0

I'm trying to edit the text of a TextInput React Native component in an ios UITest. I've added the testID prop to the component.

Two questions:

  1. Where does the testID prop appear in the native ios code?
  2. How can I select the TextInput by this testID and add text to it?

App.js

import React from "react";import { StyleSheet, TextInput, View } from "react-native";export default function App() {  return (<View><TextInput testID="username" placeholder="Enter your username" /></View>  );}

TestappUITests.swift

import XCTestclass TestappUITests: XCTestCase {    ...    func testExample() {        // UI tests must launch the application that they test.        let app = XCUIApplication()        app.launch()        // Write test code here    }}

unable to read property list from file

$
0
0

Not sure what the exact issue is but when I run npx expo run:ios

it gives me the following error.

error: unable to read property list from file: /Users/jayengineer/Workspace/react_projects/Breached/ios/Breached/Info.plist: The operation couldn’t be completed. (XCBUtil.PropertyListConversionError error 2.) (in target 'Breached' from project 'Breached')

<?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>CADisableMinimumFrameDurationOnPhone</key><true/><key>CFBundleDevelopmentRegion</key><string>$(DEVELOPMENT_LANGUAGE)</string><key>CFBundleDisplayName</key><string>Breached</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>$(PRODUCT_BUNDLE_PACKAGE_TYPE)</string><key>CFBundleShortVersionString</key><string>1.0.4/string><key>CFBundleSignature</key><string>????</string><key>CFBundleURLTypes</key><array><dict><key>CFBundleURLSchemes</key><array><string>com.jay754.Breached</string></array></dict></array><key>CFBundleVersion</key><string>1</string><key>LSApplicationCategoryType</key><string></string><key>LSRequiresIPhoneOS</key><true/><key>NSAppTransportSecurity</key><dict><key>NSAllowsArbitraryLoads</key><false/><key>NSAllowsLocalNetworking</key><true/></dict><key>UILaunchStoryboardName</key><string>SplashScreen</string><key>UIRequiredDeviceCapabilities</key><array><string>armv7</string></array><key>UIRequiresFullScreen</key><false/><key>UIStatusBarStyle</key><string>UIStatusBarStyleDefault</string><key>UISupportedInterfaceOrientations</key><array><string>UIInterfaceOrientationPortrait</string><string>UIInterfaceOrientationPortraitUpsideDown</string></array><key>UISupportedInterfaceOrientations~ipad</key><array><string>UIInterfaceOrientationPortrait</string><string>UIInterfaceOrientationPortraitUpsideDown</string><string>UIInterfaceOrientationLandscapeLeft</string><string>UIInterfaceOrientationLandscapeRight</string></array><key>UIUserInterfaceStyle</key><string>Light</string><key>UIViewControllerBasedStatusBarAppearance</key><false/></dict></plist>
Viewing all 17129 articles
Browse latest View live


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