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

React Native iOS XCode build error: "[CP-User] [Hermes] Replace Hermes for the right configuration"

$
0
0

I face this issue and I do not have any clue about what is cause the problem.

It's about a React Native App, I didn't install anything from days or change code. It's happen from the moment I update my macOS Ventura to Sonoma.

    [VisionCamera] node modules found at /Users/[USER]/[PROJECT]/node_modules/react-native/..    [VisionCamera] react-native-worklets-core not found, Frame Processors disabled!    Auto-linking React Native modules for target `ReactNativeMobile`: BVLinearGradient, RNCAsyncStorage, RNCClipboard, RNLocalize, RNReanimated, RNSVG, RNScreens, RNSha256, VisionCamera, react-native-config, react-native-get-random-values, react-native-passkey, react-native-quick-crypto, react-native-safe-area-context, react-native-splash-screen, and react-native-webview    Framework build type is static library    [Codegen] Generating ./build/generated/ios/React-Codegen.podspec.json    [Codegen] generating an empty RCTThirdPartyFabricComponentsProvider    Analyzing dependencies    Fetching podspec for `DoubleConversion` from `../node_modules/react-native/third-party-podspecs/DoubleConversion.podspec`    [Codegen] Found FBReactNativeSpec    Fetching podspec for `RCT-Folly` from `../node_modules/react-native/third-party-podspecs/RCT-Folly.podspec`    [Codegen] Found rncore    [VisionCamera] node modules found at /Users/[USER]/[PROJECT]/node_modules/react-native/..    [VisionCamera] react-native-worklets-core not found, Frame Processors disabled!    Fetching podspec for `boost` from `../node_modules/react-native/third-party-podspecs/boost.podspec`    Fetching podspec for `glog` from `../node_modules/react-native/third-party-podspecs/glog.podspec`    Fetching podspec for `hermes-engine` from `../node_modules/react-native/sdks/hermes-engine/hermes-engine.podspec`    [Hermes] Using release tarball from URL: https://repo1.maven.org/maven2/com/facebook/react/react-native-artifacts/0.73.1/react-native-artifacts-0.73.1-hermes-ios-debug.tar.gz    Downloading dependencies    Installing BVLinearGradient (2.8.3)    Installing CocoaAsyncSocket (7.6.5)    Installing DoubleConversion (1.1.6)    Installing FBLazyVector (0.73.1)    Installing FBReactNativeSpec (0.73.1)    Installing Flipper (0.201.0)    Installing Flipper-Boost-iOSX (1.76.0.1.11)    Installing Flipper-DoubleConversion (3.2.0.1)    Installing Flipper-Fmt (7.1.7)    Installing Flipper-Folly (2.6.10)    Installing Flipper-Glog (0.5.0.5)    Installing Flipper-PeerTalk (0.0.4)    Installing FlipperKit (0.201.0)    Installing OpenSSL-Universal (1.1.1100)    Installing RCT-Folly (2022.05.16.00)    Installing RCTRequired (0.73.1)    Installing RCTTypeSafety (0.73.1)    Installing RNCAsyncStorage (1.21.0)    Installing RNCClipboard (1.13.2)    // HERE WAS MORE    Installing React-runtimeexecutor (0.73.1)    Installing React-runtimescheduler (0.73.1)    Installing React-utils (0.73.1)    Installing ReactCommon (0.73.1)    Installing SocketRocket (0.6.1)    Installing VisionCamera (3.8.2)    Installing Yoga (1.14.0)    Installing boost (1.83.0)    Installing fmt (6.2.1)    Installing glog (0.3.5)    Installing hermes-engine (0.73.1)    [!] Error installing hermes-engine――― MARKDOWN TEMPLATE ―――――――――――――――――――――――――――――――――――――――――――――――――――――――――――    ### Command    ```    /usr/local/bin/pod install    ```    ### Report    * What did you do?    * What did you expect to happen?    * What happened instead?    ### Stack    ```      CocoaPods : 1.15.0            Ruby : ruby 2.6.10p210 (2022-04-12 revision 67958) [universal.arm64e-darwin23]        RubyGems : 3.0.3.1            Host : macOS 14.3 (******)          Xcode : 15.2 (******)            Git : git version 2.39.3 (Apple Git-145)    Ruby lib dir : /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib    Repositories : trunk - CDN - https://cdn.cocoapods.org/    ```    ### Plugins    ```    cocoapods-deintegrate : 1.0.5    cocoapods-plugins     : 1.0.0    cocoapods-search      : 1.0.1    cocoapods-trunk       : 1.6.0    cocoapods-try         : 1.2.0    ```    ### Podfile    ```ruby    # Resolve react_native_pods.rb with node to allow for hoisting    require Pod::Executable.execute_command('node', ['-p','require.resolve("react-native/scripts/react_native_pods.rb",        {paths: [process.argv[1]]},      )', __dir__]).strip    platform :ios, min_ios_version_supported    prepare_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.enabled : FlipperConfiguration.enabled    linkage = ENV['USE_FRAMEWORKS']    if linkage != nil      Pod::UI.puts "Configuring Pod with #{linkage}ally linked Frameworks".green      use_frameworks! :linkage => linkage.to_sym    end    target 'ReactNativeMobile' 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 'ReactNativeMobileTests' 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        )      end    end    ```    ### Error    ```    Errno::EEXIST - File exists @ syserr_fail2_in - /Users/[USER]/Library/Caches/CocoaPods/Pods/External/hermes-engine/0e37d787f1d5a7b711e72349208731c3-34df9/destroot/Library/Frameworks/universal/hermes.xcframework/ios-arm64_x86_64-maccatalyst/hermes.framework/Resources    /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/fileutils.rb:1365:in `symlink'    /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/fileutils.rb:1365:in `copy'    /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/fileutils.rb:478:in `block in copy_entry'    /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/fileutils.rb:1485:in `wrap_traverse'    /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/fileutils.rb:1488:in `block in wrap_traverse'    /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/fileutils.rb:1487:in `each'    /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/fileutils.rb:1487:in `wrap_traverse'    /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/fileutils.rb:475:in `copy_entry'    /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/fileutils.rb:453:in `block in cp_r'    /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/fileutils.rb:1558:in `block in fu_each_src_dest'    /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/fileutils.rb:1567:in `block in fu_each_src_dest0'    /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/fileutils.rb:1565:in `each'    /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/fileutils.rb:1565:in `fu_each_src_dest0'    /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/fileutils.rb:1556:in `fu_each_src_dest'    /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/fileutils.rb:452:in `cp_r'    /Library/Ruby/Gems/2.6.0/gems/cocoapods-1.15.0/lib/cocoapods/downloader/cache.rb:343:in `block (2 levels) in copy_files'    /Library/Ruby/Gems/2.6.0/gems/cocoapods-1.15.0/lib/cocoapods/downloader/cache.rb:341:in `each'    /Library/Ruby/Gems/2.6.0/gems/cocoapods-1.15.0/lib/cocoapods/downloader/cache.rb:341:in `block in copy_files'    /Library/Ruby/Gems/2.6.0/gems/cocoapods-1.15.0/lib/cocoapods/downloader/cache.rb:128:in `lock'    /Library/Ruby/Gems/2.6.0/gems/cocoapods-1.15.0/lib/cocoapods/downloader/cache.rb:99:in `write_lock'    /Library/Ruby/Gems/2.6.0/gems/cocoapods-1.15.0/lib/cocoapods/downloader/cache.rb:332:in `copy_files'    /Library/Ruby/Gems/2.6.0/gems/cocoapods-1.15.0/lib/cocoapods/downloader/cache.rb:269:in `block (2 levels) in uncached_pod'    /Library/Ruby/Gems/2.6.0/gems/cocoapods-1.15.0/lib/cocoapods/downloader/cache.rb:265:in `each'    /Library/Ruby/Gems/2.6.0/gems/cocoapods-1.15.0/lib/cocoapods/downloader/cache.rb:265:in `block in uncached_pod'    /Library/Ruby/Gems/2.6.0/gems/cocoapods-1.15.0/lib/cocoapods/downloader/cache.rb:291:in `in_tmpdir'    /Library/Ruby/Gems/2.6.0/gems/cocoapods-1.15.0/lib/cocoapods/downloader/cache.rb:238:in `uncached_pod'    /Library/Ruby/Gems/2.6.0/gems/cocoapods-1.15.0/lib/cocoapods/downloader/cache.rb:33:in `download_pod'    /Library/Ruby/Gems/2.6.0/gems/cocoapods-1.15.0/lib/cocoapods/downloader.rb:42:in `download'    /Library/Ruby/Gems/2.6.0/gems/cocoapods-1.15.0/lib/cocoapods/installer/pod_source_downloader.rb:69:in `download!'    /Library/Ruby/Gems/2.6.0/gems/cocoapods-1.15.0/lib/cocoapods/installer/pod_source_installer.rb:117:in `download_source'    /Library/Ruby/Gems/2.6.0/gems/cocoapods-1.15.0/lib/cocoapods/installer/pod_source_installer.rb:67:in `install!'    /Library/Ruby/Gems/2.6.0/gems/cocoapods-1.15.0/lib/cocoapods/installer.rb:621:in `install_source_of_pod'    /Library/Ruby/Gems/2.6.0/gems/cocoapods-1.15.0/lib/cocoapods/installer.rb:539:in `block (2 levels) in install_pod_sources'    /Library/Ruby/Gems/2.6.0/gems/cocoapods-1.15.0/lib/cocoapods/user_interface.rb:86:in `titled_section'    /Library/Ruby/Gems/2.6.0/gems/cocoapods-1.15.0/lib/cocoapods/installer.rb:538:in `block in install_pod_sources'    /Library/Ruby/Gems/2.6.0/gems/cocoapods-1.15.0/lib/cocoapods/installer.rb:535:in `each'    /Library/Ruby/Gems/2.6.0/gems/cocoapods-1.15.0/lib/cocoapods/installer.rb:535:in `install_pod_sources'    /Library/Ruby/Gems/2.6.0/gems/cocoapods-1.15.0/lib/cocoapods/installer.rb:258:in `block in download_dependencies'    /Library/Ruby/Gems/2.6.0/gems/cocoapods-1.15.0/lib/cocoapods/user_interface.rb:64:in `section'    /Library/Ruby/Gems/2.6.0/gems/cocoapods-1.15.0/lib/cocoapods/installer.rb:257:in `download_dependencies'    /Library/Ruby/Gems/2.6.0/gems/cocoapods-1.15.0/lib/cocoapods/installer.rb:163:in `install!'    /Library/Ruby/Gems/2.6.0/gems/cocoapods-1.15.0/lib/cocoapods/command/install.rb:52:in `run'    /Library/Ruby/Gems/2.6.0/gems/claide-1.1.0/lib/claide/command.rb:334:in `run'    /Library/Ruby/Gems/2.6.0/gems/cocoapods-1.15.0/lib/cocoapods/command.rb:52:in `run'    /Library/Ruby/Gems/2.6.0/gems/cocoapods-1.15.0/bin/pod:55:in `<top (required)>'    /usr/local/bin/pod:23:in `load'    /usr/local/bin/pod:23:in `<main>'    ```――― TEMPLATE END ――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――    [!] Oh no, an error occurred.    Search for existing GitHub issues similar to yours:    https://github.com/CocoaPods/CocoaPods/search?q=File+exists+%40+syserr_fail2_in+-+%2FUsers%2F[USER]%2FLibrary%2FCaches%2FCocoaPods%2FPods%2FExternal%2Fhermes-engine%2F0e37d787f1d5a7b711e72349208731c3-34df9%2Fdestroot%2FLibrary%2FFrameworks%2Funiversal%2Fhermes.xcframework%2Fios-arm64_x86_64-maccatalyst%2Fhermes.framework%2FResources&type=Issues    If none exists, create a ticket, with the template displayed above, on:    https://github.com/CocoaPods/CocoaPods/issues/new    Be sure to first read the contributing guide for details on how to properly submit a ticket:    https://github.com/CocoaPods/CocoaPods/blob/master/CONTRIBUTING.md    Don't forget to anonymize any private data!    Looking for related issues on cocoapods/cocoapods...    Found no similar issues. To create a new issue, please visit:    https://github.com/cocoapods/cocoapods/issues/new

I tried clean the cache of Node, delete the node_module and package-lock then reinstall everything.I tried the same with Cocoapods.I looked on Google.Nothing help me to found a way.

And now StackOverflow continu to ask me to add some details because I have to much code on my text... Thanks to make me life bad. So I delete some package from the list, sorry.

Thanks for your help.


Metro Not Launching App on Physical iOS 17.4.1 Device

$
0
0

My metro was working fine yesterday but after my phone automatically updated overnight when I try to build an app it will install on the device but won't open automatically. I also can't connect to Metro manually by opening the app. It works fine on Android. I'm using zulu-17 through sdkman and node v21.7.3. It isn't working for any react-native app.

I've spent the past 10 hours trying this:I tried to clean my metro cache.I tried to delete node_modules and yarn.lock then yarn install and pod install.I tried to connect to my iPhone's hotspot to ensure a similar connection.I tried clearing my trusted devicesI tried to clean my pod cache.I tried to reclone the repo and start from the beginning.I tried switching my xCode from release -> debug.I tried altering various xCode build settings.I tried reinstalling node.I tried updating my iPhone.I tried configuring the bundler to my Mac's ip and port.I reset my entire Macbook and reinstalled everything.

Again, I suspect it had something to do with my iPhone updating overnight because It was working fine yesterday and I didn't touch anything, But I'm unsure of any other options besides wiping my phone.

Update: I tried it using a friend's iPhone using iOS 16 and it launched successfully. I reset my iPhone to a previous firmware and it still does not work. I tested another iPhone with the same firmware as mine and it did not run.

how to link from notification settings to expo app

$
0
0

I am building an expo react native app, with sdk 50. it's a music streaming app and i'm making use of the module (react-native-track-player).

The issue is, when i'm playing a track, and that track shows up in the notification panel, if i click that notification, it takes me to an error screen that says unmatched route.

enter image description hereenter image description hereI have attached two pictures to this query, the notification panel before press, and the error screen after press

I've spoken to rntp, but they said it's my app config issue. and i have no idea how to go about this

I suspect it has to do with deep linking, but I can't really figure out if that's the major problem.

Any help would be greatly appreciated.

Thanks in advance :)

You cannot run CocoaPods as root. react-native ios build

$
0
0

So I'm using AWS Amplify with react-native and I got an error saying I couldnt use Expo go with Amplify so Im trying to build it on my local ios device but I keep getting stuck on the same error. The command im using is sudo npx expo start:ios. This is the error I keep getting.

 CocoaPods CLI not found in your PATH, installing it now.› Attempting to install CocoaPods CLI with GemSuccessfully installed cocoapods-1.15.21 gem installed› Successfully installed CocoaPods CLI with Gem✔ Installed CocoaPods CLI.⚠️  Something went wrong running `pod install` in the `ios` directory.Command `pod install` failed.└─ Cause: pod exited with non-zero code: 1/opt/homebrew/lib/ruby/gems/3.3.0/gems/claide-1.1.0/lib/claide/command.rb:439:in `help!': [!] You cannot run CocoaPods as root. (CLAide::Help)

I went over so many stackoverflow posts with similar problems but always keep getting the same error.

Also already added these 3 to my .zshrc file

export PATH=/opt/homebrew/opt/ruby/bin:/opt/homebrew/lib/ruby/gems/3.0.0/bin:$PATHexport GEM_HOME="$(ruby -e 'puts Gem.user_dir')"export PATH="$PATH:$GEM_HOME/bin"

I look forward to hearing your guys solution

Import of module 'glog.glog.log_severity' appears within namespace 'google'

$
0
0

I know this is duplicated, since the answered solution doesn't work for me, I'm asking again in case someone has come up with any new solution...

Already tried:

Unlinked all auto-linked modules and manually specified them in pod file.

Also tried

use_modular_headers!pod 'glog', :podspec => '../node_modules/react-native/third-party-podspecs/glog.podspec', :modular_headers => falsepod 'Folly', :podspec => '../node_modules/react-native/third-party-podspecs/Folly.podspec', :modular_headers => false

Any suggestion is much appreciated.

React Native 0.63 iOS 14 error on podfile

$
0
0

Recently I have updated a app for react-native 0.63 and this action have been caused some errors:In the "pod install" an error appear:

Installing glog (0.3.5)[!] /bin/bash -c set -ePLATFORM_NAME="${PLATFORM_NAME:-iphoneos}"CURRENT_ARCH="${CURRENT_ARCH}"if [ -z "$CURRENT_ARCH" ] || [ "$CURRENT_ARCH" == "undefined_arch" ]; then    # Xcode 10 beta sets CURRENT_ARCH to "undefined_arch", this leads to incorrect linker arg.    # it's better to rely on platform name as fallback because architecture differs between simulator and device    if [[ "$PLATFORM_NAME" == *"simulator"* ]]; then        CURRENT_ARCH="x86_64"    else        CURRENT_ARCH="armv7"    fifiexport CC="$(xcrun -find -sdk $PLATFORM_NAME cc) -arch $CURRENT_ARCH -isysroot $(xcrun -sdk $PLATFORM_NAME --show-sdk-path)"export CXX="$CC"# Remove automake symlink if it existsif [ -h "test-driver" ]; then    rm test-driverfi./configure --host arm-apple-darwin# Fix build for tvOScat << EOF >> src/config.h/* Add in so we have Apple Target Conditionals */#ifdef __APPLE__#include <TargetConditionals.h>#include <Availability.h>#endif/* Special configuration for AppleTVOS */#if TARGET_OS_TV#undef HAVE_SYSCALL_H#undef HAVE_SYS_SYSCALL_H#undef OS_MACOSX#endif/* Special configuration for ucontext */#undef HAVE_UCONTEXT_H#undef PC_FROM_UCONTEXT#if defined(__x86_64__)#define PC_FROM_UCONTEXT uc_mcontext->__ss.__rip#elif defined(__i386__)#define PC_FROM_UCONTEXT uc_mcontext->__ss.__eip#endifEOF# Prepare exported header includeEXPORTED_INCLUDE_DIR="exported/glog"mkdir -p exported/glogcp -f src/glog/log_severity.h "$EXPORTED_INCLUDE_DIR/"cp -f src/glog/logging.h "$EXPORTED_INCLUDE_DIR/"cp -f src/glog/raw_logging.h "$EXPORTED_INCLUDE_DIR/"cp -f src/glog/stl_logging.h "$EXPORTED_INCLUDE_DIR/"cp -f src/glog/vlog_is_on.h "$EXPORTED_INCLUDE_DIR/"checking for a BSD-compatible install... /usr/bin/install -cchecking whether build environment is sane... yeschecking for arm-apple-darwin-strip... nochecking for strip... stripchecking for a thread-safe mkdir -p... ./install-sh -c -dchecking for gawk... nochecking for mawk... nochecking for nawk... nochecking for awk... awkchecking whether make sets $(MAKE)... yeschecking whether make supports nested variables... yeschecking for arm-apple-darwin-gcc... /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/cc -arch armv7 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS14.2.sdkchecking whether the C compiler works... no/Users/anderzilla/Library/Caches/CocoaPods/Pods/External/glog/2263bd123499e5b93b5efe24871be317-40a13/missing: Unknown `--is-lightweight' optionTry `/Users/anderzilla/Library/Caches/CocoaPods/Pods/External/glog/2263bd123499e5b93b5efe24871be317-40a13/missing --help' for more informationconfigure: WARNING: 'missing' script is too old or missingconfigure: error: in `/Users/anderzilla/Library/Caches/CocoaPods/Pods/External/glog/2263bd123499e5b93b5efe24871be317-40a13':configure: error: C compiler cannot create executablesSee `config.log' for more details

I tried "pod deintegrate", remove podfile.lock and others solutions to update libraries but nothing have worked yet.

I'm using last vession of xcode 12.2, big sur and node 12.

henp and thanks.

Can't build ios from react native app in fastlane and github actions

$
0
0

I want to automate the build of the IOS version from react native app using fastlane and github actions. I've followed this link for installing .p12 certifcate file and the provisioning profile file with extension .mobileprovision. However, when I run the fastlane on github actions it logs in to apple connect correctly and every thing is ok until the build_app step where it throws the following error:Error: No profiles for 'com.bimsaudi.atarcloud' were found: Xcode couldn't find any iOS App Development provisioning profiles matching 'com.bimsaudi.atarcloud'. Automatic signing is disabled and unable to generate a profile. To enable automatic signing, pass -allowProvisioningUpdates to xcodebuild. (in target 'Atar' from project 'Atar')

Here's my Fastfile:

default_platform(:ios)platform :ios dodesc "Push a new beta build to TestFlight"lane :beta do  setup_ci  auth_key_path = File.expand_path(File.join(File.dirname(__FILE__), '**.p8'))  app_store_connect_api_key({    key_id: "<key_id>",    issuer_id: "<issuer_id>",    key_filepath: auth_key_path,  })  increment_build_number(xcodeproj: "Atar.xcodeproj")  build_app(workspace: "Atar.xcworkspace", scheme: "Atar")  upload_to_testflightendlane :check_provisioning_profiles do  setup_ci  auth_key_path = File.expand_path(File.join(File.dirname(__FILE__), '**.p8'))  app_store_connect_api_key({    key_id: "<key_id>",    issuer_id: "<issuer_id>",    key_filepath: auth_key_path,  })  sigh(username: "<apple-username>")endend

And here's my .github/workflows/automation.yml file:

name: Test CDon:  push:  workflow_dispatch:jobs:  build-ios:    name: Build IOS    runs-on: macOS-14    steps:      - name: Checkout repository        uses: actions/checkout@v1      - name: Install the Apple certificate and provisioning profile        env:          BUILD_CERTIFICATE_BASE64: ${{ secrets.BUILD_CERTIFICATE_BASE64 }}          P12_PASSWORD: ${{ secrets.P12_PASSWORD }}          BUILD_PROVISION_PROFILE_BASE64: ${{ secrets.BUILD_PROVISION_PROFILE_BASE64 }}          KEYCHAIN_PASSWORD: ${{ secrets.KEYCHAIN_PASSWORD }}        run: |          # create variables          CERTIFICATE_PATH=$RUNNER_TEMP/build_certificate.p12          PP_PATH=$RUNNER_TEMP/build_pp.mobileprovision          KEYCHAIN_PATH=$RUNNER_TEMP/app-signing.keychain-db          # import certificate and provisioning profile from secrets          echo -n "$BUILD_CERTIFICATE_BASE64" | base64 --decode -o $CERTIFICATE_PATH          echo -n "$BUILD_PROVISION_PROFILE_BASE64" | base64 --decode -o $PP_PATH          # create temporary keychain          security create-keychain -p "$KEYCHAIN_PASSWORD" $KEYCHAIN_PATH          security set-keychain-settings -lut 21600 $KEYCHAIN_PATH          security unlock-keychain -p "$KEYCHAIN_PASSWORD" $KEYCHAIN_PATH          # import certificate to keychain          security import $CERTIFICATE_PATH -P "$P12_PASSWORD" -A -t cert -f pkcs12 -k $KEYCHAIN_PATH          security set-key-partition-list -S apple-tool:,apple: -k "$KEYCHAIN_PASSWORD" $KEYCHAIN_PATH          security list-keychain -d user -s $KEYCHAIN_PATH          # apply provisioning profile          mkdir -p ~/Library/MobileDevice/Provisioning\ Profiles          cp $PP_PATH ~/Library/MobileDevice/Provisioning\ Profiles      - name: Setup Node        uses: actions/setup-node@v2        with:          node-version: '16.20.2'          cache: 'yarn'      - name: Install deps        run: yarn --frozen-lockfile && yarn env      - name: Install pods        shell: bash        run: cd ios/ && pod install && cd ..      - name: Build IOS        run: cd ios/ && fastlane ios check_provisioning_profiles && fastlane ios beta        env:          FASTLANE_USER: ${{ secrets.FASTLANE_USER }}          FASTLANE_PASSWORD: ${{ secrets.FASTLANE_PASSWORD }}          FASTLANE_SESSION: ${{ secrets.FASTLANE_SESSION }}          # FASTLANE_APPLE_APPLICATION_SPECIFIC_PASSWORD: ${{ secrets.FASTLANE_APPLE_APPLICATION_SPECIFIC_PASSWORD }}          MATCH_PASSWORD: ${{ secrets.MATCH_PASSWORD }}

Install app certificate and provisioning profile is ok

The sigh works

The provisioning profile installed

All the steps before build_app are ok

The beginning of build_app step

And, the error

And another pic for fastlane error

Failure to Generate iOS React Native 0.72.12 Project in Custom Directory

$
0
0

If the project structure follows the one below, running pod install is successful:

└── guideProgram ├── package.json ├── node_modules └── ios └── Podfile

However, when the structure is customized as follows:

└── myProgram ├── rn├├── node_modules ├└── package.json └─ ios└── Podfile

It results in an error message:"[!] Invalid Podfile file: undefined method `prepare_react_native_project!' for #Pod::Podfile:0x00007f8733259588."

It has been bothering me for several days now!Any help will be appreaciated


when I build the react native ios app this err occured

$
0
0

Flipperenter image description here

build failed my pod file is please help me to resolve this err why this err createbuild failed my pod file is please help me to resolve this err why this err createbuild failed my pod file is please help me to resolve this err why this err createbuild failed my pod file is please help me to resolve this err why this err create

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 'tpc' 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 'tpcTests' 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

Background stops on IOS - React native expo

$
0
0

I'm building an app for get location of the phone (latitude and longitude) when the app is in foreground/background/killed.On android all works fine take the location in all the phase. Meanwhile with IOS when I open the app with Xcode it works fine, get the location meanwhile the app is killed. When I open the app and the user put the permission of the geolocation on "Always" and after that the user kill the app it doesn't get the location, but if I put the the authorization on "ask always", enter the app and give the authorization on "Always" and killed, it works. If I enter again in the app and kill it the get location on killed doesn't work again.

I used only expo library (Location - taskManager).

I used the library location for get latitude and longitude and the taskManager for the backgroundTask. I added all the permission on the Xml file.

Background Task stops on IOS when killed - React native expo

$
0
0

I'm building an app for get location of the phone (latitude and longitude) when the app is in foreground/background/killed.On android all works fine take the location in all the phase. Meanwhile with IOS when I open the app with Xcode it works fine, get the location meanwhile the app is killed. When I open the app and the user put the permission of the geolocation on "Always" and after that the user kill the app it doesn't get the location, but if I put the the authorization on "ask always", enter the app and give the authorization on "Always" and killed, it works. If I enter again in the app and kill it the get location on killed doesn't work again.

I used only expo library (Location - taskManager).

I used the library location for get latitude and longitude and the taskManager for the backgroundTask. I added all the permission on the Xml file.

How to properly link a .framework for an IOS native module

$
0
0

So, I am creating an npm package that will be used for a React Native app. The issue that i meet is as below

ld: Undefined symbols:  _OBJC_CLASS_$_WiseAiApp, referenced from:       in librn-ekyc.a[3](RnEkyc.o)clang: error: linker command failed with exit code 1 (use -v to see invocation)

The framework is already added through podspec and in XCode, all the class definitions is already loaded

podspec

.... s.vendored_frameworks = "Example.framework"....

The framework has below structure:

v Example.framework

› _CodeSignature

GoogleMVFaceDetectorResource...

› Headers

› Modules

= Ekyc.nib

= FaceLiveness.nib

= GoogleService-Info.plist

= Info.plist

= LivenessCapture.nib

= MyCardOCR.nib

= PassportOCR.nib

= Example

I am expecting the build to be successful but met with the error defined above.

(2024) React Native - User inactivity timer

$
0
0

I'm building an app that will be used on a tablet mounted on a wall - if you're familiar with them, think a Q-SYS or Crestron unit - touch screen to turn things like TV's on and off.

I want the app to basically revert to a default state after a certain period of inactivity. The app has multiple pages (react-navigation) with multiple tabs on each screen, so after say 5 minutes, I want it to revert to the first page/tab, and display a splash screen (e.g. "Tap to start").

I have 90% of this already built, but I'm struggling with the "timeout" function. My naive approach at this point is that I have a fullscreen view, that sets a "displaySplash" state variable to false when touched, and starts a timeout function to reset that to true after say 5mins. That obviously however doesn't clear/restart the timer if the user taps on the screen again, so after 5mins no matter what, it shows the splash screen again.

I've seen a few approaches that I've either not been able to get to work or have not been suitable. The closest I got to getting something working was using https://reactnative.dev/docs/panresponder, but I wasn't able to get the touch events to pass down to child elements, so I couldn't interact with the app properly, change pages, etc.

A number of the solutions I've seen are quite a few years old now, so I was wondering if anyone has been able to solve this since those were posted.

If it helps, I'm using react 18.2.0, react-native 0.73.6, functional components with typescript.

AppwriteException: Invalid query: Cannot query on virtual relation attribute

$
0
0

I'm developing a React Native app and utilizing Appwrite for storage and API calls.

For saving the user ID of users who like a post, I'm employing the following API call:

export async function likeVideoPost(postId, userId) {  try {    const updatedPost = await databases.updateDocument(      appwriteConfig.databaseId,      appwriteConfig.videoCollectionId,      postId,      {        likebyusers: [...[userId]],      }    );    return updatedPost;  } catch (error) {    throw new Error(error);  }}

here the respnse i recieved:

{"response": {"$collectionId": "xxx","$createdAt": "2024-04-22T16:03:18.362+00:00","$databaseId": "xxx","$id": "xxx","$permissions": ["read(\"user:66268a238e3c960b0139\")", "update(\"user:66268a238e3c960b0139\")", "delete(\"user:66268a238e3c960b0139\")"],"$updatedAt": "2024-04-22T16:12:22.455+00:00","creator": {"$collectionId": "xxx","$createdAt": "2024-04-22T16:02:44.297+00:00","$databaseId": "xxx","$id": "66268a2447ea7ce4f6b3","$permissions": [],"$updatedAt": "2024-04-22T16:02:44.297+00:00","accountId": "66268a238e3c960b0139","avatar": "https://cloud.appwrite.io/v1/avatars/initials?name=Test&project=xxx","email": "xxx","password": "xxx","username": "xxx","videos": [[Object]]    },"likebyusers": [{"$collectionId": "xxx","$createdAt": "2024-04-22T16:02:44.297+00:00","$databaseId": "xxx","$id": "xxx","$permissions": [Array],"$updatedAt": "2024-04-22T16:02:44.297+00:00","accountId": "xxx","avatar": "https://cloud.appwrite.io/v1/avatars/initials?name=Test&project=xxx","email": "xxx","password": "xxx","username": "xxx"    }],"prompt": "Abcprompt","thumbnail": "https://cloud.appwrite.io/v1/storage/buckets/xxx/files/xxx/preview?width=2000&height=2000&gravity=top&quality=100&project=xxx","title": "Abc","video": "https://cloud.appwrite.io/v1/storage/buckets/xxx/files/xxx/view?project=xxx"  }}

To retrieve posts liked by a user, I'm using the following query:

// Get video posts Liked by userexport async function getUserLikedPosts(userId) {  try {    const posts = await databases.listDocuments(      appwriteConfig.databaseId,      appwriteConfig.videoCollectionId,      [Query.equal("likebyusers", [userId])]    );    return posts.documents;  } catch (error) {    console.log(error);    throw new Error(error);  }}

However, I encountered the following error in the console: AppwriteException: Invalid query: Cannot query on virtual relation attribute.

Could someone help me understand and resolve this issue? Any insights would be greatly appreciated.


Collection Structure: My Project's Data Model

I've meticulously designed a collection structure for my project and would greatly appreciate feedback to ensure it aligns with best practices and efficiency standards. Below, I present the structure I've crafted:

Users Collection:

KEYTYPEDEFAULT VALUE
usernameString-
emailEmail-
passwordString-
avatarUrl-
accountIdString-
videosRelationship with videos-

Explanation:

  • Username: Represents the unique username of each user.
  • Email: Stores the email address associated with each user.
  • Password: Stores the encrypted password for user authentication.
  • Avatar: Stores the URL of the user's profile picture.
  • AccountId: Unique identifier for each user's account.
  • Videos: Establishes a relationship with the videos uploaded by each user.

Videos Collection:

KEYTYPEDEFAULT VALUE
titleString-
promptString-
videoUrl-
thumbnailUrl-
creatorRelationship with creator-
likebyusersRelationship with likebyusers-

Explanation:

  • Title: Represents the title of each video.
  • Prompt: Provides additional information or context for the video.
  • Video: Stores the URL of the video content.
  • Thumbnail: Stores the URL of the video's thumbnail image.
  • Creator: Establishes a relationship with the user who created the video.
  • Likebyusers: Establishes a relationship with users who have liked the video.

Software Versions in Use

I'm currently employing the following versions in my project:

react-native-appwrite: ^0.2.2devDependencies:@babel/core: ^7.24.3tailwindcss: 3.3.2expo: ~50.0.14

I'm eagerly looking forward to any insights, suggestions, or critiques regarding this structure. Thank you in advance for your valuable input!


FB SDK Error: Login Failed (react-native)

$
0
0

I'm currently setting up Facebook Authentication for my Reach Native application. After the usual problems with the react-native-fbsdk setup, now the Facebook App Events work and the LoginManager loads up.

My problem: After Authorisation the LoginManager redirects me back to the app, then shows me the Error:

Login Failed

I'm using the very standard LoginManager implementation:

const FBSDK = require('react-native-fbsdk');const {  LoginManager,  AccessToken,} = FBSDK;export default class FacebookAuth extends Component {  facebook(){    LoginManager.logInWithReadPermissions(['public_profile', 'email']).then(  function(result) {    if (result.isCancelled) {      alert('Login cancelled');    } else {      alert('Login success with permissions: '+result.grantedPermissions.toString());    }  },  function(error) {    alert('Login fail with error: '+ error);  });

Do you have any pointers for me?

I already checked:

  • FB app info in Info.Plist
  • iOS Bundle ID in Facebook App
  • Client OAuth Settings
  • FBSDK LoginButton (same error)

I'm running: iOS 10 & react-native 0.38.0.

Thanks!


react-native-modal-datetime-picker issue with daylight saving time zone

$
0
0

I have been using react-native-modal-datetime-picker package for my react native mobile application and came across an issue.

In the date picker I need to have a default selected date as '1985-08-17' and when the time zone is America/Mexico_City (-05:00) the default selected date becomes the previous day which is '1985-08-16'.

Is there any thing that I have done wrong in the below code sample?

<DateTimePicker    isVisible={true}    date={new Date('1985-01-17')}    onConfirm={()=>()}    onCancel={()=>()}    mode={'date'}/>

In the same CDT time zone when I change the device timezone to America/Chicago this issue is not reproducible.

TextInput is not working in React Native iOS

$
0
0

I am using react native's core component TextInput. Everything was working fine but suddenly TextInputs are not showing in the app and stopped working in iOS only. If i am adding borderWidth it is also not working on the textinputs.I also tried to upgrade react native with latest version but still same issue is there.My project is on 0.72.6 version of React Native

I upgraded the latest version of React Native. I checked on 0.73.6 and 0.74I have also added height to the textinputs

import {View,TextInput,} from "react-native";

<TextInput            style={styles.input}            placeholder="What are you looking for?"            value={searchQuery}            onChangeText={(query) => {              handleSearchInputChange(query);              setInputFocused(true);            }}            onBlur={handleInputBlur}          />`

input: {flex: 1,height:50,},

Fastlane, Github actions. Scheme is not currently configured for the build action

$
0
0

When I upload React Native app to testflight with Github actions and Fastlane I get build error

xcodebuild: error: Scheme qa is not currently configured for the build action.Exit status: 66

All my schemes are shared in Xcode. When I started command locally, all works fine, upload succeeded.

My .yml file:

name: Releaseon:  push:    branches:      - qajobs:  release-ios:    name: Build and release iOS app    runs-on: macos-latest    steps:      - uses: actions/checkout@v2      - uses: actions/setup-node@v1        with:          node-version: "18.x"      - uses: ruby/setup-ruby@v1        with:          ruby-version: '3.2.0'      - name: Remove Derived Data        run: rm -rf ~/Library/Developer/Xcode/DerivedData      - name: Yarn Install        run: yarn      - name: Install Fastlane        run: cd ios && bundle install && cd ..      - name: Install pods        run: cd ios && pod install && cd ..      - name: Execute Fastlane command        run: cd ios && fastlane qa

my FastFile:

default_platform(:ios)DEVELOPER_APP_ID = ENV["DEVELOPER_APP_ID"]DEVELOPER_APP_QA_IDENTIFIER = ENV["DEVELOPER_APP_QA_IDENTIFIER"]DEVELOPER_APP_STAGE_IDENTIFIER = ENV["DEVELOPER_APP_STAGE_IDENTIFIER"]PROVISIONING_PROFILE_SPECIFIER = ENV["PROVISIONING_PROFILE_SPECIFIER"]TEMP_KEYCHAIN_USER = ENV["TEMP_KEYCHAIN_USER"]TEMP_KEYCHAIN_PASSWORD = ENV["TEMP_KEYCHAIN_PASSWORD"]APPLE_ISSUER_ID = ENV["APPLE_ISSUER_ID"]APPLE_KEY_ID = ENV["APPLE_KEY_ID"]APPLE_KEY_CONTENT = ENV["APPLE_KEY_CONTENT"]GIT_AUTHORIZATION = ENV["GIT_AUTHORIZATION"]def delete_temp_keychain(name)  delete_keychain(    name: name  ) if File.exist? File.expand_path("~/Library/Keychains/#{name}-db")enddef create_temp_keychain(name, password)  create_keychain(    name: name,    password: password,     default_keychain: true,     unlock: true,  )enddef ensure_temp_keychain(name, password)  delete_temp_keychain(name)  create_temp_keychain(name, password)enddesc 'GitHub actions release'lane :version do |options|  updateVersion(options)  increment_build_number(xcodeproj: 'My.xcodeproj')end# QAlane :qa do |_options|  app_identifier = DEVELOPER_APP_QA_IDENTIFIER  keychain_name = TEMP_KEYCHAIN_USER  keychain_password = TEMP_KEYCHAIN_PASSWORD  ensure_temp_keychain(keychain_name, keychain_password)  create_keychain(      name: TEMP_KEYCHAIN_USER,      password: TEMP_KEYCHAIN_PASSWORD,      timeout: 1800,      default_keychain: true,      unlock: true,      lock_when_sleeps: false    )  import_certificate(    certificate_path: 'MyCertificate.cer',    keychain_name: keychain_name,    keychain_password: keychain_password  )  install_provisioning_profile(path: './profile.mobileprovision')  update_project_provisioning(    xcodeproj: 'My.xcodeproj',    target_filter: 'github',    profile: './profile.mobileprovision',    build_configuration: 'Debug'  )  api_key = app_store_connect_api_key(           key_id: APPLE_KEY_ID,           issuer_id: APPLE_ISSUER_ID,           key_filepath: "AuthKey.p8",           in_house: false # optional but may be required if using match/sigh    )    recreate_schemes(project: "My.xcodeproj")  build_app(    project: "My.xcodeproj",    scheme: 'qa',    clean: true,    export_method: "app-store",    export_options: {        provisioningProfiles: {"myBundleId" => "myProfile"        },    })  upload_to_app_store(    force: true,    reject_if_possible: true,    skip_metadata: true,    skip_screenshots: true,    languages: ['en-US'],    release_notes: {'default' => "Shiny and new",    },    submit_for_review: true,    precheck_include_in_app_purchases: false,    automatic_release: true,    submission_information: {      add_id_info_uses_idfa: true,      add_id_info_serves_ads: true,      add_id_info_tracks_install: true,      add_id_info_tracks_action: false,      add_id_info_limits_tracking: true,      export_compliance_encryption_updated: false    },    api_key: api_key  )end

Any suggestions?

I expected successfull build and uploading to testflight, but got error.

how to make my react-native app build with expo compatible with old version of ios

$
0
0

I'm building a app with expo and i want the app can be compatible with older version iphone and android ( for exemple i want my to be compatible with ios 12 till ios 17. some have idea? thanks

try documentation but no fund solution

Decrypt text in React Native and show on iOS Native

$
0
0

I have used Notification Service Extension to modify text before showing to user screen and I want to show a decrypted message but the decrypt function runs in React Native. How can I pass the value between iOS and React Native?

I have tried to use Noti Service Extension and show modified text successfully but cannot show decrypted message that I process in React Native

Viewing all 17353 articles
Browse latest View live


Latest Images

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