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

No permission handler detected in react-native IOS

$
0
0

[enter image description here][1]It’s been giving me this error for 3-4 days now, I want to fix it but nothing works, I’ve done everything but nothing works at all, here are my configurations:

Podfile:

require File.join(File.dirname(`node --print "require.resolve('expo/package.json')"`), "scripts/autolinking")require File.join(File.dirname(`node --print "require.resolve('react-native/package.json')"`), "scripts/react_native_pods")require 'json'podfile_properties = JSON.parse(File.read(File.join(__dir__, 'Podfile.properties.json'))) rescue {}ENV\['RCT_NEW_ARCH_ENABLED'\] = podfile_properties\['newArchEnabled'\] == 'true' ? '1' : '0'ENV\['EX_DEV_CLIENT_NETWORK_INSPECTOR'\] = podfile_properties\['EX_DEV_CLIENT_NETWORK_INSPECTOR'\]platform :ios, podfile_properties\['ios.deploymentTarget'\] || '13.0'install! 'cocoapods',:deterministic_uuids =\> falseprepare_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,...), which will be excluded. To fix this,# you can also exclude `react-native-flipper` in `react-native.config.js`# # \`\`\`js# module.exports = {# dependencies: {# ...(process.env.NO_FLIPPER ? { 'react-native-flipper': { platforms: { ios: null } } } : {}),# }# }# \`\`\`flipper_config = FlipperConfiguration.disabledif ENV\['NO_FLIPPER'\] == '1' then# Explicitly disabled through environment variablesflipper_config = FlipperConfiguration.disabledelsif podfile_properties.key?('ios.flipper') then# Configure Flipper in Podfile.properties.jsonif podfile_properties\['ios.flipper'\] == 'true' thenflipper_config = FlipperConfiguration.enabled(\["Debug", "Release"\])elsif podfile_properties\['ios.flipper'\] != 'false' thenflipper_config = FlipperConfiguration.enabled(\["Debug", "Release"\], { 'Flipper' =\> podfile_properties\['ios.flipper'\] })endendtarget 'TrevaShop' dopod 'Firebase', :modular_headers =\> truepod 'FirebaseCoreInternal', :modular_headers =\> truepod 'FirebaseCore', :modular_headers =\> truepod 'FirebaseMessaging', :modular_headers =\> truepod 'GoogleUtilities', :modular_headers =\> trueuse_expo_modules!config = use_native_modules!use_frameworks! :linkage =\> podfile_properties\['ios.useFrameworks'\].to_sym if podfile_properties\['ios.useFrameworks'\]use_frameworks! :linkage =\> ENV\['USE_FRAMEWORKS'\].to_sym if ENV\['USE_FRAMEWORKS'\]# Flags change depending on the env values.flags = get_default_flags()use_react_native!(:path =\> config\[:reactNativePath\],:hermes_enabled =\> podfile_properties\['expo.jsEngine'\] == nil || podfile_properties\['expo.jsEngine'\] == 'hermes',:fabric_enabled =\> flags\[:fabric_enabled\],\# An absolute path to your application root.:app_path =\> "#{Pod::Config.instance.installation_root}/..",\# Note that if you have use_frameworks! enabled, Flipper will not work if enabled:flipper_configuration =\> flipper_config)pod 'RNPermissions', :path =\> '../node_modules/react-native-permissions'post_install do |installer|react_native_post_install(installer,config\[:reactNativePath\],:mac_catalyst_enabled =\> false)\__apply_Xcode_12_5_M1_post_install_workaround(installer)    # This is necessary for Xcode 14, because it signs resource bundles by default    # when building for devices.    installer.target_installation_results.pod_target_installation_results      .each do |pod_name, target_installation_result|      target_installation_result.resource_bundle_targets.each do |resource_bundle_target|        resource_bundle_target.build_configurations.each do |config|          config.build_settings['CODE_SIGNING_ALLOWED'] = 'NO'        end      end    end    permissions_path = '../node_modules/react-native-permissions/ios'    installer.pods_project.targets.each do |target|      if target.name == 'RNPermissions'        target.build_configurations.each do |config|          config.build_settings['GCC_PREPROCESSOR_DEFINITIONS'] ||= ['$(inherited)']          config.build_settings['GCC_PREPROCESSOR_DEFINITIONS'] << 'PERMISSIONS_SERVICE=1'          config.build_settings['HEADER_SEARCH_PATHS'] ||= ['$(inherited)']          config.build_settings['HEADER_SEARCH_PATHS'] << permissions_path        end      end    endendpost_integrate do |installer|beginexpo_patch_react_imports!(installer)rescue =\> ePod::UI.warn eendendend

info.plist:

<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">    NSLocationWhenInUseUsageDescription    We use your location to provide personalized shopping experiences, show nearby stores, and offer location-based promotions. Your location data is kept secure and never shared with third parties.    NSLocationAlwaysUsageDescription    We use your location to provide personalized shopping experiences, show nearby stores, and offer location-based promotions. Your location data is kept secure and never shared with third parties.    NSLocationAlwaysAndWhenInUseUsageDescription    We use your location to provide personalized shopping experiences, show nearby stores, and offer location-based promotions. Your location data is kept secure and never shared with third parties.    GOOGLE_MAPS_API_KEY    AIzaSyBI8bYXK0GzGBDEc_SCdHQ6RLPLIGDzB1Q    CFBundleDevelopmentRegion    $(DEVELOPMENT_LANGUAGE)    CFBundleExecutable    $(EXECUTABLE_NAME)    CFBundleIdentifier    $(PRODUCT_BUNDLE_IDENTIFIER)    CFBundleInfoDictionaryVersion    6.0    CFBundleName    $(PRODUCT_NAME)    CFBundlePackageType    $(PRODUCT_BUNDLE_PACKAGE_TYPE)    CFBundleSignature    ????    CFBundleShortVersionString    1.0    CFBundleVersion    1    LSRequiresIPhoneOS    NSAppTransportSecurity        NSAllowsArbitraryLoads        NSExceptionDomains            localhost                NSExceptionAllowsInsecureHTTPLoads    UILaunchStoryboardName    SplashScreen    UIRequiredDeviceCapabilities        armv7    UISupportedInterfaceOrientations        UIInterfaceOrientationPortrait        UIInterfaceOrientationLandscapeLeft        UIInterfaceOrientationLandscapeRight    UIViewControllerBasedStatusBarAppearance    UIStatusBarStyle    UIStatusBarStyleDefault    CADisableMinimumFrameDurationOnPhone    UIAppFonts        Manrope-VariableFont_wght.ttf        Manrope-Bold.ttf        Manrope-ExtraBold.ttf        Manrope-ExtraLight.ttf        Manrope-Light.ttf        Manrope-Medium.ttf        Manrope-Regular.ttf        Manrope-SemiBold.ttf    ```

package.json:{"name": "trevashop","version": "1.0.0","main": "index.js","scripts": {"start": "expo start --dev-client","android": "expo run:android","ios": "expo run:ios","web": "expo start --web","and": "npx react-native run-android"},"dependencies": {"@gorhom/bottom-sheet": "^4.6.0","@react-native-community/async-storage": "^1.12.1","@react-native-community/geolocation": "^3.1.0","@react-native-firebase/app": "^19.0.0","@react-native-firebase/messaging": "^19.0.0","@react-navigation/native": "^6.1.10","@react-navigation/stack": "^6.3.21","axios": "^1.6.5","base-64": "^1.0.0","expo": "~49.0.18","expo-splash-screen": "~0.20.5","expo-status-bar": "~1.6.0","react": "18.2.0","react-native": "0.72.6","react-native-awesome-alerts": "^2.0.0","react-native-countdown-component": "^2.7.1","react-native-date-picker": "^4.3.5","react-native-default-preference": "^1.4.4","react-native-gesture-handler": "^2.14.1","react-native-google-places-autocomplete": "^2.5.6","react-native-i18n": "^2.0.15","react-native-linear-gradient": "^2.8.3","react-native-maps": "^1.10.0","react-native-onboarding-swiper": "^1.2.0","react-native-open-notification": "^0.1.4","react-native-permissions": "^4.1.4","react-native-progress": "^5.0.1","react-native-reanimated": "^3.6.1","react-native-safe-area-context": "^4.9.0","react-native-safe-area-view": "^1.1.1","react-native-screens": "^3.29.0","react-native-shadow": "^1.2.2","react-native-skeleton-placeholder": "^5.2.4","react-native-svg": "^13.14.0","react-native-swipe-gestures": "^1.0.5","react-navigation-stack": "^2.10.4"},"devDependencies": {"@babel/core": "^7.20.0"},"private": true}

In general, I tried everything, I looked at the fact that there is such a problem everywhere and looked at all the solutions, but they didn’t help at all. I tried everything, but nothing changed.Help me please)  [1]: https://i.stack.imgur.com/YiYR3.jpg

react native gifted chart pie chart focusOnPress not working

$
0
0

I'm trying to use a pie chart from react-native-gifted-charts. I'd like to show an image related to the selected pie chart value. When I deploy a code like below, it works find to toggle the image yet focusOnPress doesn't work anymore but blinks as if I clicked the chart twice. However, when I replace the onPress function with something simple as console.log(item), focusOnPress works perfectly fine as expected. Did anyone encounter a similar issue?

<PieChart                        radius={100}                        focusOnPress                        data={pieChartData}                        extraRadiusForFocused={5}                        onPress={(item) => setIsPieChartSelected(!isPieChartSelected)}                    />                    {isPieChartSelected && <MyImage />}

FBReactNativeSpec.h error after upgrading from 0.68.x to 0.69.0

$
0
0

I just upgraded from RN 0.68.x to 0.69.0 using the react-native upgrade command.Its shows an error about
FBReactNativeSpec'value' is unavailable : introduced in ios 12.0 react nativeand same error shown when i create a new project with latest version.

xcode:12.4macVersion:10.15.7

enter image description here

enter image description here

Using TapLinx sdk with IOS

$
0
0

I'm trying to integrate Mifare taplinx sdk with my react native app. Currently, android is done ok, but ios giving me this error when run:

Thread 1: EXC_BAD_ACCESS (code=1, address=0x0)

the project can be built with no errors, but does give me this error. any help is much appreciated

Invariant Violation and TypeError When Integrating React Native with Existing iOS Swift App

$
0
0

I am currently migrating an iOS app written in Swift to a new React Native project. I successfully integrated a React Native component into my iOS app by first generating a main.jsbundle with the following command:

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

In Swift, I integrated the React Native component using this code:

private func showRNComponent() {    let rootView = RCTRootView(        bundleURL: Bundle.main.url(forResource: "main", withExtension: "jsbundle")!,        moduleName: "DemoPage",        initialProperties: nil,        launchOptions: nil    )    let vc = UIViewController()    vc.view = rootView    self.present(vc, animated: true, completion: nil)}

This method works fine with the main.jsbundle. However, I attempted to use Metro as a development server for better debugging capabilities and updated the method to fetch the bundle from the development server:

private func showRNComponent() {    guard let jsCodeLocation = URL(string: "http://localhost:8081/index.bundle?platform=ios") else {        NSLog("Invalid URL")        return    }    let rootView = RCTRootView(        bundleURL: jsCodeLocation,        moduleName: "DemoPage",        initialProperties: nil,        launchOptions: nil    )    let vc = UIViewController()    vc.view = rootView    self.present(vc, animated: true, completion: nil)}

After starting Metro and running the development server, when trying to trigger the function, I received the following errors in the XCode console:

Invariant Violation: TurboModuleRegistry.getEnforcing(...): 'DevSettings' could not be found. Verify that a module by this name is registered in the native binary. Bridgeless mode: false. TurboModule interop: false. Modules loaded: {"NativeModules":["PlatformConstants","Timing","AppState","SourceCode","BlobModule","WebSocketModule","SettingsManager"],"TurboModules":[],"NotFound":["NativePerformanceCxx","NativePerformanceObserverCxx","LogBox","DevSettings"]}, js engine: hermesTypeError: Cannot read property 'render' of undefined, js engine: hermes

I suspect this issue might relate to the XCode build target settings, which should be set to Debug mode to load development settings. Even though I have ensured my build settings and preprocessor macros (preprocessor macros: debug=1) are applied across all build configurations, the problem persists.

Here are excerpts from my Podfile and package.json, detailing the libraries and settings I'm using:

//Poddilesource 'https://github.com/CocoaPods/Specs.git'require Pod::Executable.execute_command('node', ['-p','require.resolve("react-native/scripts/react_native_pods.rb",    {paths: [process.argv[1]]},  )', __dir__]).stripplatform :ios, '14.0'# min_supported_versions = { :ios => "13.0"}prepare_react_native_project!target 'MyApp' do  # Comment the next line if you don't want to use dynamic frameworks  use_frameworks!  config = use_native_modules!  use_react_native!(    :path => config[:reactNativePath],    :flipper_configuration => FlipperConfiguration.disabled,    :app_path => "#{Pod::Config.instance.installation_root}/.."  )  # Pods for MyApp  pod 'RxSwift'  pod 'RxCocoa'  pod 'SDWebImage'  pod 'Alamofire'  pod 'MBProgressHUD'  pod 'SwiftyJSON'  pod 'SwiftyUserDefaults'  pod 'ObjectMapper'  pod 'Firebase/Crashlytics', '9.2.0'  pod 'Firebase/Analytics', '9.2.0'  pod 'Firebase/Messaging', '9.2.0'  pod 'SwipeCellKit'  pod 'Kingfisher'  pod 'WeScan'  pod 'RxDataSources', '~> 4.0'  pod 'ChameleonFramework'#  pod 'FlexLayout'  pod 'SwiftSoup'  pod 'IQKeyboardManagerSwift'  pod 'GoogleMLKit/BarcodeScanning', '2.6.0'  pod 'MJRefresh'  pod 'DGCharts'  target 'MyAppTests' do    inherit! :search_paths    # Pods for testing  end  target 'MyAppUITests' do    inherit! :search_paths    # Pods for testing  end# post installpost_install do |installer|  react_native_post_install(      installer,      config[:reactNativePath],      :mac_catalyst_enabled => false    )  installer.pods_project.targets.each do |target|      target.build_configurations.each do |config|        config.build_settings['IPHONEOS_DEPLOYMENT_TARGET'] = '13.0'      end    end  # fix xcode 15 DT_TOOLCHAIN_DIR - remove after fix oficially - https://github.com/CocoaPods/CocoaPods/issues/12065  installer.aggregate_targets.each do |target|    target.xcconfigs.each do |variant, xcconfig|      xcconfig_path = target.client_root + target.xcconfig_relative_path(variant)      IO.write(xcconfig_path, IO.read(xcconfig_path).gsub("DT_TOOLCHAIN_DIR", "TOOLCHAIN_DIR"))    end  end  installer.pods_project.targets.each do |target|    target.build_configurations.each do |config|      if config.base_configuration_reference.is_a? Xcodeproj::Project::Object::PBXFileReference        xcconfig_path = config.base_configuration_reference.real_path        IO.write(xcconfig_path, IO.read(xcconfig_path).gsub("DT_TOOLCHAIN_DIR", "TOOLCHAIN_DIR"))      end    end  endendend
{"name": "MyApp","version": "0.0.1","private": true,"scripts": {"doctor": "react-native doctor","upgrade": "react-native upgrade","config": "react-native config","android": "react-native run-android","ios": "react-native run-ios --mode \"ETE-t1-Debug\" --scheme=\"MyApp-ETE(t1)\"","lint": "eslint . --ext .js,.jsx,.ts,.tsx","start": "react-native start","bundle:ios": "react-native bundle --dev false --entry-file index.js --bundle-output ios/MyApp/main.jsbundle --platform ios --assets-dest ios","bundle:android": "react-native bundle --platform android --dev false --entry-file index.js --bundle-output android/app/src/main/assets/index.android.bundle --assets-dest android/app/src/main/res","clean": "npx react-native-clean-project"    },"dependencies": {"@react-native-async-storage/async-storage": "1.23.1","axios": "^1.6.8","react": "18.2.0","react-native": "0.73.6","react-native-progress": "^5.0.1"    },"devDependencies": {"@babel/core": "^7.20.0","@babel/preset-env": "^7.20.0","@babel/runtime": "^7.20.0","@react-native/babel-preset": "0.73.21","@react-native/eslint-config": "0.73.2","@react-native/metro-config": "0.73.5","@react-native/typescript-config": "0.73.1","@types/react": "^18.2.6","@types/react-test-renderer": "^18.0.0","babel-jest": "^29.6.3","eslint": "^8.19.0","prettier": "2.8.8","react-test-renderer": "18.2.0","typescript": "5.0.4"    },"engines": {"node": ">=18"    }}

Any suggestions on how to resolve these errors or further steps to debug this issue would be highly appreciated!

Issue with webview and display modal in ios vs android

$
0
0

Using react-native-webview library I am encountering different behaviour on android and ios in regards to how a modal that contains input field that opened will be displayed.

The issue occurs when focusing on input field, as expected the keyboard opens but on ios the modal get squashed whereas on android the content is displaying fine.

See screenshot below:
android ios

I wonder if there is a particular trick to adjust ios behaviour in this case?

We have such requirement to display some pages written in React.js (that we control) in the app via web-view and so I have access to source code for this modal on the web which looks something like:

.modal { border-radius: 8px; left: 50%; max-height: 100%; position: fixed; top: 50%; transform: translate(-50%,-50%); width: calc(100% - 40px); z-index: 995; }

Environment:OS: ios, any version"react-native-webview": "13.2.2","react-native": "0.72.6",

I am a bit clueless where to look honestly. Looked up similar issues on stackoverflow and the library github repo but no luck.

I could inspect the same page on ios simulator on safari web inspector and play with properties but issue is not presentsafari

'No apps connected. Sending "reload" to all React Native apps failed. Make sure your app is running in the simulator or on a phone connected via USB.'

$
0
0

My React Native application running on a physical device has some problems.

The Metro bundler console gives a warning :

warn No apps connected. Sending "reload" to all React Native apps failed.Make sure your app is running in the simulator or on a phone connected via USB.

This causes a connection problem on the iOS device.

When I try to reload my React Native application from the React Native Debugger, it gives the above warning and I cannot debug my code in Chrome.
This happens on a physical device. When I work with an iOS simulator, there is no problem.

Note: my phone and MacBook are on the same Wi-Fi network.
So, the problem is not related to using different networks.

Versions
  • react-native: 0.62.2,
  • iOS: 13.6

Xcode 15: Unable to boot the Simulator

$
0
0

I was able to run iOS simulator fine with Xcode 14 and my Mac recently updated the latest version of Xcode which is 15 then I'm no longer able to boot a device from its new simulator.

I did try many different ways collected from many sources but no avail. Here are the few things that I already tried and none of them worked for me:

BTW here is the full log that I collected as run it via cli:

xcrun simctl boot 39C3D624-968A-49F7-A155-AC9AC1A81B52
Unable to boot the Simulator.Domain: NSPOSIXErrorDomainCode: 60Failure Reason: launchd failed to respond.User Info: {    DVTErrorCreationDateKey = "2023-09-26 04:06:49 +0000";    IDERunOperationFailingWorker = "_IDEInstalliPhoneSimulatorWorker";    Session = "com.apple.CoreSimulator.SimDevice.AC5CB945-2257-4E8C-AA61-ABC5AC147D84";}--Failed to start launchd_sim: could not bind to session, launchd_sim may have crashed or quit respondingDomain: com.apple.SimLaunchHostService.RequestErrorCode: 4--Event Metadata: com.apple.dt.IDERunOperationWorkerFinished : {"device_model" = "iPhone16,1";"device_osBuild" = "17.0 (21A328)";"device_platform" = "com.apple.platform.iphonesimulator";"dvt_coredevice_version" = "348.1";"dvt_mobiledevice_version" = "1643.2.4";"launchSession_schemeCommand" = Run;"launchSession_state" = 1;"launchSession_targetArch" = arm64;"operation_duration_ms" = 23640;"operation_errorCode" = 60;"operation_errorDomain" = NSPOSIXErrorDomain;"operation_errorWorker" = "_IDEInstalliPhoneSimulatorWorker";"operation_name" = IDERunOperationWorkerGroup;"param_debugger_attachToExtensions" = 0;"param_debugger_attachToXPC" = 1;"param_debugger_type" = 3;"param_destination_isProxy" = 0;"param_destination_platform" = "com.apple.platform.iphonesimulator";"param_diag_MainThreadChecker_stopOnIssue" = 0;"param_diag_MallocStackLogging_enableDuringAttach" = 0;"param_diag_MallocStackLogging_enableForXPC" = 1;"param_diag_allowLocationSimulation" = 1;"param_diag_checker_tpc_enable" = 1;"param_diag_gpu_frameCapture_enable" = 0;"param_diag_gpu_shaderValidation_enable" = 0;"param_diag_gpu_validation_enable" = 0;"param_diag_memoryGraphOnResourceException" = 0;"param_diag_queueDebugging_enable" = 1;"param_diag_runtimeProfile_generate" = 0;"param_diag_sanitizer_asan_enable" = 0;"param_diag_sanitizer_tsan_enable" = 0;"param_diag_sanitizer_tsan_stopOnIssue" = 0;"param_diag_sanitizer_ubsan_stopOnIssue" = 0;"param_diag_showNonLocalizedStrings" = 0;"param_diag_viewDebugging_enabled" = 1;"param_diag_viewDebugging_insertDylibOnLaunch" = 1;"param_install_style" = 0;"param_launcher_UID" = 2;"param_launcher_allowDeviceSensorReplayData" = 0;"param_launcher_kind" = 0;"param_launcher_style" = 0;"param_launcher_substyle" = 0;"param_runnable_appExtensionHostRunMode" = 0;"param_runnable_productType" = "com.apple.product-type.application";"param_structuredConsoleMode" = 1;"param_testing_launchedForTesting" = 0;"param_testing_suppressSimulatorApp" = 0;"param_testing_usingCLI" = 0;"sdk_canonicalName" = "iphonesimulator17.0";"sdk_osVersion" = "17.0";"sdk_variant" = iphonesimulator;}--System InformationmacOS Version 13.6 (Build 22G120)Xcode 15.0 (22265) (Build 15A240d)Timestamp: 2023-09-26T11:06:49+07:00

I will appreciate any help!

Update on 28th Sep 2023

I just upgraded macOS to the latest version v14 with name (Sonoma)and tried to remove all caches again but still no avail :(

Update on 29th Sep 2023

I also tried to download 3 last iOS versions and interestingly the iOS 15 works for me while none of the 2 others still work.

Update on 16th Nov 2023 (important)

I just re-open the simulator and somehow it suddenly works automatically without doing anything, not sure what has been updated from Apple makes it working. Anyway, this is a good news and I guess Apple might have been aware of the bug and released a fix silently


iOS fails to run on version 0.73.1, 'react/debug/react_native_assert.h' file not found on RunLoopObserver

$
0
0

enter image description here

I get the error: 'react/debug/react_native_assert.h' file not found, React-utils/RunLoopObserver. any help is appreciated.

Here is my pod file

require 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!pod 'react-native-video', :path => '../node_modules/react-native-video/react-native-video.podspec'pod 'RNPermissions', :path => '../node_modules/react-native-permissions'pod 'ffmpeg-kit-react-native', :subspecs => ['min-gpl-lts'], :podspec => '../node_modules/ffmpeg-kit-react-native/ffmpeg-kit-react-native.podspec'permissions_path = '../node_modules/react-native-permissions/ios'pod 'Permission-Notifications', :path => "#{permissions_path}/Notifications"pod 'Permission-Camera', :path => "#{permissions_path}/Camera"pod 'Permission-Microphone', :path => "#{permissions_path}/Microphone"pod 'Permission-PhotoLibrary', :path => "#{permissions_path}/PhotoLibrary"flipper_config = FlipperConfiguration.disabledlinkage = ENV['USE_FRAMEWORKS']abstract_target 'CommonPods' do  config = use_native_modules!  use_frameworks! :linkage => :static  $RNFirebaseAsStaticFramework = true  pod 'RNCPushNotificationIOS', :path => '../node_modules/@react-native-community/push-notification-ios'  use_react_native!(    :path => config[:reactNativePath],    :app_path => "#{Pod::Config.instance.installation_root}/.."  )  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    )     installer.pods_project.targets.each do |target|       target.build_configurations.each do |config|         config.build_settings['ONLY_ACTIVE_ARCH'] = 'NO'         config.build_settings['CODE_SIGNING_ALLOWED'] = 'NO'         if ["React-cxxreact", "React-NativeModulesApple", "RNGestureHandler", "RNScreens", "React-utils", "React-debug", "React-runtimescheduler"].any? { |t| t == target.name }           append_header_search_path(target, "${PODS_ROOT}/../../node_modules/react-native/ReactCommon")         end       end     end   end    def append_header_search_path(target, path)        target.build_configurations.each do |config|            config.build_settings["HEADER_SEARCH_PATHS"] ||= "$(inherited) "            config.build_settings["HEADER_SEARCH_PATHS"] << path        end    end    pod 'Firebase'    pod 'FirebaseCore'    pod 'FirebaseCoreInternal'    pod 'FirebaseCoreExtension'    pod 'FirebaseInstallations'    pod 'FirebaseABTesting'    pod 'FirebaseFirestoreInternal'    pod 'GoogleUtilities'    pod 'GoogleDataTransport'    pod 'nanopb'    target 'Dev' do    end    target 'QA' do    endend

HERE IS THE RN-INFO

System:OS: macOS 14.1CPU: (10) arm64 Apple M1 ProMemory: 78.05 MB / 16.00 GBShell:version: "5.9"path: /bin/zshBinaries:Node:version: 20.5.1path: /opt/homebrew/bin/nodeYarn:version: 1.22.18path: /opt/homebrew/bin/yarnnpm:version: 9.8.0path: /opt/homebrew/bin/npmWatchman:version: 2023.08.14.00path: /opt/homebrew/bin/watchmanManagers:CocoaPods:version: 1.14.3path: /opt/homebrew/opt/ruby/bin/podSDKs:iOS SDK:Platforms:- DriverKit 23.0- iOS 17.0- macOS 14.0- tvOS 17.0- watchOS 10.0Android SDK:API Levels:- "28"- "29"- "30"- "31"- "32"- "33"Build Tools:- 29.0.2- 30.0.2- 30.0.3- 31.0.0- 32.0.0- 32.1.0- 33.0.0- 33.0.2System Images:- android-32 | Google APIs ARM 64 v8a- android-32 | Google APIs Intel x86 Atom_64- android-33 | Google APIs ARM 64 v8aAndroid NDK: 22.1.7171670IDEs:Android Studio: 2022.3 AI-223.8836.35.2231.10811636Xcode:version: 15.0/15A240dpath: /usr/bin/xcodebuildLanguages:Java:version: 1.8.0_292path: /usr/bin/javacRuby:version: 3.2.2path: /opt/homebrew/opt/ruby/bin/rubynpmPackages:"@react-native-community/cli": Not Foundreact: Not Foundreact-native: Not Foundreact-native-macos: Not FoundnpmGlobalPackages:"react-native": Not FoundAndroid:hermesEnabled: truenewArchEnabled: falseiOS:hermesEnabled: truenewArchEnabled: false

Why app display name get truncated on iOS

$
0
0

First question:

I have problem with iOS app display name. I tried many solutions and I read many discussions and I finally managed to add space in CFBundleDisplayName, but I still can't understand why the display name is truncated. I know the app name is 14 chars (includingone space using the following code: &#x2002;), BUT for example Google Translate is 16 chars and I can see the full name displayed. The only information I found is that there is a restriction of 12/13 chars and the width of every character also matters, but I can see only 9 chars of the app name. So any suggestions how can I fix that ?

Second question:

I want to check the app name displayed in the stores both App Store and Google Play. Where can I find and change the app name to become the same as bundle display name ?

  • XCode version: 15.3
  • iOS version: 17.4.1

React Native - What is reactTag parameter in AccessibilityInfo.setAccessibilityFocus()?

$
0
0

What is reactTag parameter in AccessibilityInfo.setAccessibilityFocus(reactTag) method? React native documentation don't provide any information about this parameter:

Set accessibility focus to a React component. On Android, this is equivalent to UIManager.sendAccessibilityEvent(reactTag, UIManager.AccessibilityEventTypes.typeViewFocused);.

I don't have any background of Objective-C and Java. A little example will be more appreciated. Thank !!!

Invalid `Podfile` file: uninitialized constant Pod::Podfile::FlipperConfiguration

$
0
0

I have implemented a iOS where need to unlinked react-native-linear-gradient and then install the react-native-video and added all of the information but there is an issues when I install PodFile using pod install.

Below the required version which I have used,

Node Version: v16.16.0 ;npm Version: 8.11.0 ;React-Native Version: 0.69.0 ;Pod Version: 1.11.3

Here is the code sample of PodFile,

require_relative '../node_modules/react-native/scripts/react_native_pods'require_relative '../node_modules/@react-native-community/cli-platform-ios/native_modules'platform :ios, '12.4'use_frameworks! :linkage => :staticinstall! 'cocoapods', :deterministic_uuids => falseproduction = ENV["PRODUCTION"] == "1"target 'iosUserApp_HelloSuperStars' do  config = use_native_modules!  # Flags change depending on the env values.  flags = get_default_flags()  use_react_native!(    :path => config[:reactNativePath],    # to enable hermes on iOS, change `false` to `true` and then install pods    :production => production,    :hermes_enabled => flags[:hermes_enabled],    :fabric_enabled => flags[:fabric_enabled],    :flipper_configuration => FlipperConfiguration.enabled,    #I have faced error here    # An absolute path to your application root.    :app_path => "#{Pod::Config.instance.installation_root}/.."  )  target 'iosUserApp_HelloSuperStarsTests' do    inherit! :complete    # Pods for testing    pod ‘react-native-webrtc’, :path => ‘../node_modules/@videosdk.live/react-native-webrtc’  end  use_flipper!()  post_install do |installer|    react_native_post_install(installer)    __apply_Xcode_12_5_M1_post_install_workaround(installer)  endend

please concern on the attached file to check error,FlipperConfiguration Error

Identify Return Key action in React Native

$
0
0

I have a TextInput which I have enabled multiline as true. Thing is the Keyboard won't hide after Return is pressed. It goes to a new line. So I was hoping to use react-native-dismiss-keyboard. To exploit this I need to identify the Return key action. How to do this?

<TextInput    style={styles.additionalTextInput}    multiline={true}    autoCapitalize="sentences"    autoCorrect={true}    onChangeText={(text) => this.setState({text})}    keyboardType="default"    returnKeyType="done"    onKeyPress={(keyPress) => console.log(keyPress)}    placeholder="Enter text here..."/>

React Native RCTFabric - No type or protocol named 'RCTDebuggingOverlayViewProtocol'

$
0
0

After upgrading to the latest version of react-native I suddenly with RCTFabric.

"react-native": "0.74.0",
1. No type or protocol named 'RCTDebuggingOverlayViewProtocol'2. Use of undeclared identifier 'DebuggingOverlayShadowNode'3. Use of undeclared identifier 'DebuggingOverlayShadowNode'4. Use of undeclared identifier 'RCTDebuggingOverlayHandleCommand'

Did anyone face something like this?

RCTFabric issue

Expo,React Native Error: Invariant Violation: "main" has not been registered, ReferenceError: Property 'user' doesn't exist, js engine: hermes

$
0
0

I'm using on React Native and Expo go.This error suddenly occurred while working as usual with React Native.I don't remember exactly what step it was, but it seems to have started to occur after I created a hook called useProductFetch for useState variables or functions declared inside a functional component.To solve this problem, I created a new project folder, moved the files, and reinstalled the dependencies. But I've been getting this error repeatedly, and I've been looking for a way to fix this for about two days. And to solve the error "Invariant Violation: "main" has not been registered", i checked my "name" in app.json and package.json. there were not any problems.Here is my codes.

{"name": "frontend","version": "1.0.0","main": "node_modules/expo/AppEntry.js","scripts": {"start": "expo start","android": "expo start --android","ios": "expo start --ios","web": "expo start --web"  },"dependencies": {"@expo/vector-icons": "^14.0.0","@react-native-async-storage/async-storage": "1.21.0","@react-navigation/bottom-tabs": "^6.5.20","@react-navigation/native": "^6.1.17","@react-navigation/native-stack": "^6.9.26","@reduxjs/toolkit": "^2.2.3","axios": "^1.6.8","expo": "~50.0.14","expo-checkbox": "~2.7.0","expo-image-picker": "~14.7.1","expo-linear-gradient": "~12.7.2","expo-location": "~16.5.5","expo-media-library": "~15.9.2","expo-radio-button": "^1.0.8","expo-status-bar": "~1.11.1","react": "18.2.0","react-native": "0.73.6","react-native-gesture-handler": "~2.14.0","react-native-modal": "^13.0.1","react-native-reanimated": "~3.6.2","react-redux": "^9.1.1"  },"devDependencies": {"@babel/core": "^7.20.0"  },"private": true}

This is the part where a custom hook was used in the aforementioned component.

import { useProductFetch } from './useProductFetch';import { primary_gray } from '../../styles/common/colors';import { TouchMenu } from './touch_menu';import { CreateReview } from './CreateReview';import { AntDesign } from '@expo/vector-icons';export const ProductDetail = () => {  const {    currentPage,    currentProduct,    handleHeart,    handleHorizontalScroll,    heart,    isUsers,    token,    user,    borderWidths,    handlePress,    activeMenu,    navigation,  } = useProductFetch();//......//}

And the custom hook code:

export const useProductFetch = () => {    const [heart, setHeart] = useState({});    const { selectedProductId, currentProduct } = useSelector((state) => state.products);    const [isUsers, setIsUsers] = useState(false);    const dispatch = useDispatch();    const navigation = useNavigation();    const { user, token } = useSelector((state) => state.userAuth);    const [currentPage, setCurrentPage] = useState(0);    const [activeMenu, setActiveMenu] = useState(0);    const borderWidths = [...Array(3)].map(() => useSharedValue(0));    const { width } = Dimensions.get('window');    const handleHorizontalScroll = (event) => {    const contentOffsetX = event.nativeEvent.contentOffset.x;    const currentPageIndex = Math.round(contentOffsetX / width);    setCurrentPage(currentPageIndex);  };    const fetchDetail = useCallback(() => {       if (selectedProductId) {       try {         dispatch(findProduct({ product_id: selectedProductId }));         if (token) {           ProductApi.isUsersProduct(token, selectedProductId).then((response) => {             setIsUsers(response.data);           });         }       } catch (error) {         if (error.response) {           switch (error.response.status) {             case 400:             case 500:               navigation.navigate('Home');           }         }       }     }   }, [selectedProductId]);   useEffect(() => {     borderWidths[activeMenu].value = withTiming(3, { duration: 500 });   }, []);   const handlePress = (index) => {     setActiveMenu(index);     borderWidths[index].value = withTiming(3, { duration: 500 });   };   useEffect(() => {     fetchDetail();   },  [fetchDetail]);  useEffect(() => {    if (currentProduct) {      if (token && user) {        if (currentProduct.likedBy.length > 0) {          const isLiked = currentProduct.likedBy.some((val) => val.userId === user.id);          setHeart((prevHeart) => ({            ...prevHeart,            [currentProduct.id]: isLiked,          }));        } else          setHeart((prevHeart) => ({            ...prevHeart,            [currentProduct.id]: false,          }));      }    }  }, [currentProduct]);  const handleHeart = () => {    if (token && user && currentProduct) {      setHeart((prevState) => ({ ...prevState, [currentProduct.id]: !heart[currentProduct.id] }));      const data = { [currentProduct.id]: !heart[currentProduct.id] };      try {        dispatch(updateProductLike({ token, likes: data }));      } catch (error) {        if (error.response) {          switch (error.response.status) {            case 400:            case 401:            case 500:              navigation.navigate('Home');          }        }      }    } else {      alert('로그인이필요합니다');      navigation.navigate('Login');      return;    }  };  return {    currentProduct,    currentPage,    handleHeart,    handleHorizontalScroll,    heart,    isUsers,    handlePress,    borderWidths,    activeMenu,    navigation,    user,    token,  };};

If there are no problems with the above code, I would guess that there may be a compatibility issue with the installed dependencies. I haven't posted many questions on StackOverflow, so please understand my awkwardness.I want to solve the problem quickly and focus on coding.


TypeError: cli.init is not a function for react native

$
0
0

While running npx react-native init appName in MacBook air M1 chip

TypeError: cli.init is not a functionat run (/opt/homebrew/lib/node_modules/react-native-cli/index.js:302:7)at createProject (/opt/homebrew/lib/node_modules/react-native-cli/index.js:249:3)at init (/opt/homebrew/lib/node_modules/react-native-cli/index.js:200:5)at Object.<anonymous> (/opt/homebrew/lib/node_modules/react-native-cli/index.js:153:7)at Module._compile (node:internal/modules/cjs/loader:1112:14)at Module._extensions..js (node:internal/modules/cjs/loader:1166:10)at Module.load (node:internal/modules/cjs/loader:988:32)at Module._load (node:internal/modules/cjs/loader:834:12)at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:77:12)at node:internal/main/run_main_module:17:47

how add action button to payload onesignal json apns file

$
0
0

I try to add action button in notification onesignal react-native ios.So i used apns file for test in simulator, the notification coming with dragging file but action button does not appear even i made a long press can anyone give me the correct aps format json and thinks for helpthis my payload apns file for test:

{"Simulator Target Bundle": "******","aps": {"alert": {"title": "Push Notification","subtitle": "Test Push Notifications","body": "Testing Push Notifications on iOS Simulator","actionButtons":[                       {"id":"test","text":"test"                        }                           ]        }    },"custom": {"i": "notificationId as UUID","a": {"deeplinkKey": "{\"deeplinkDetailKey\":\"deeplinkDetailValue\"}", "launchURL": "example://collection/myCollectionId/type/1"}    }}

Is there a way to change Navigation bar color on IOS in React native?

$
0
0

I've found a way for android, but google search didn't show even one result for iOS. I wonder, is it possible at all to change Navigation bar (the swipeable one below some library like expo-router's bar with tabs) background color?

Suggestions for creating a pixel art editing component for my app using using React Native

$
0
0

I'm a beginner in React Native and I have created a pixel art editor component for my application, but it is not as fast as I would like.

The problem is that when the user drags their finger across the screen in a fast motion, the pixels are not being colored in time. Sometimes this also produces "Maximum update depth exceeded" error.

Are there any improvements that can be made in my code or should I use other libraries?

This is the code for my current component:

import { Dimensions } from 'react-native';import React, { useRef, useCallback } from 'react';import { Canvas, useTouchHandler } from '@shopify/react-native-skia';import { RoundedItem } from './RoundedItem';import { useAppSelector } from '../state/store';const DrawingPadGrid = ({ rows, columns, pixelColors, setPixelColors }) => {    const {width: portraitWidth, height: portraitHeight} = Dimensions.get('window');    const SCREEN_WIDTH = Math.max(portraitWidth, portraitHeight);    const N_PIXEL_HORIZONTAL = columns;    const N_PIXEL_VERTICAL = rows;    const SAFE_AREA_PADDING_VERT = 120;    const CONTAINER_SIZE = (SCREEN_WIDTH-SAFE_AREA_PADDING_VERT) / N_PIXEL_HORIZONTAL;    const PADDING = 3;    const SQUARE_SIZE = CONTAINER_SIZE - PADDING;    const CANVAS_WIDTH = SCREEN_WIDTH - SAFE_AREA_PADDING_VERT;    const CANVAS_HEIGHT = N_PIXEL_VERTICAL * CONTAINER_SIZE;    const brushColor = useAppSelector(state => state.matrix.color);    const brushColorRef = useRef(brushColor);    brushColorRef.current = brushColor;    let lastPixel = null;    const drawPixel = useCallback((event) => {        const i = Math.floor(event.x / CONTAINER_SIZE);        const j = Math.floor(event.y / CONTAINER_SIZE);        const pixelKey = `${i + j * N_PIXEL_HORIZONTAL}`;        if(i >= 0 && i < N_PIXEL_HORIZONTAL && j >= 0 && j < N_PIXEL_VERTICAL && lastPixel != pixelKey) {            setPixelColors(prevPixelColors => {                return {                     ...prevPixelColors,                    [pixelKey]: brushColorRef.current                };            });            lastPixel = pixelKey;        }    }, []);    const touchHandler = useTouchHandler({        onStart: drawPixel,        onActive: drawPixel,        onEnd: () => {            lastPixel = null;        },    });    return ( <Canvas            style={{                width: CANVAS_WIDTH,                height: CANVAS_HEIGHT,            }}            onTouch={ touchHandler }>            {new Array(N_PIXEL_HORIZONTAL).fill(0).map((_, i) => {                return new Array(N_PIXEL_VERTICAL).fill(0).map((_, j) => {                    return (<RoundedItem                            key={`i${i}-j${j}`}                            x={i * CONTAINER_SIZE + PADDING / 2}                            y={j * CONTAINER_SIZE + PADDING / 2}                            width={SQUARE_SIZE}                            height={SQUARE_SIZE}                            color={pixelColors[`${i + j * N_PIXEL_HORIZONTAL}`]}                        />                    );                });            })}</Canvas>    );};export default DrawingPadGrid;

The RoundedItem is just a memoized RoundedRect with some props.

Auto-linking React Native modules for target BiTop

$
0
0

enter image description here

I have this problem when trying to do a pod install, has it happened to anyone? It is a react native project

I thank you in advance for any questions or solutions or contributions.

I'm on the lookout for anything, I hope you can help me, greetings

Viewing all 17139 articles
Browse latest View live