Quantcast
Channel: Active questions tagged react-native+ios - Stack Overflow

Bridging Swift Delegate for React Native

$
0
0

I am trying to create support for React Native for my Swift SDK implementation.

My SDK's .initialise() method has a delegate parameter for success and failure.Even though I made sure to convert all my public classes and models to @objc for compatibility, React native doesn't have a delegate logic so I am struggling with alternatives.

1st Option: Changing logic to callbacks and for the cases that need to run async, rely on NSNotifications? Not sure about this approach.

@objc(MySDKBridge)class MySDKBridge: NSObject {    @objc func initialise() {    let myDelegate = InitialiseDelegate()    MySDK.shared.initialise(delegate: myDelegate)  }}extension MySDKBridge: InitialiseDelegate {func sendEventToReactNative(name: String, body: [String: Any]) {    if let bridge = self.bridge {        bridge.eventDispatcher().sendAppEvent(withName: name, body: body)    }}func initialiseCompleted() {    sendEventToReactNative(name: "InitialisationCompleted", body: ["status": "success"])}func initialiseFailed(message: String) {    sendEventToReactNative(name: "InitialisationFailed", body: ["status": "failure", "message": message])}}

2nd Option: Change logic to callbacks instead (which I think React will support) and maybe rely on NSNotifications and sent similar events like above for these async cases?


Uploading to TestFlight using Fastlane

$
0
0

I have been trying to upload my app to TestFlight from GitHub Actions for sometime now with no luck.

Workflow yml file:

name: iOS Build and Upload to TestFlighton:  workflow_dispatch:jobs:  build-ios:    runs-on: macos-latest    steps:      - name: Checkout code        uses: actions/checkout@v4      - name: Set up Ruby        uses: ruby/setup-ruby@v1        with:          ruby-version: '3.3'      # Install Bundler and CocoaPods      - name: Install Bundler and CocoaPods        run: |          gem install bundler          sudo gem install cocoapods      - name: Install Node.js dependencies        run: npm install      - name: Navigate to iOS directory, clean Pods, and remove Podfile.lock        run: |          cd ios          pod deintegrate          rm -rf Podfile.lock          pod install --repo-update      - name: Install Fastlane dependencies        run: |          cd ios          bundle install      - name: Update OpenSSL        run: |           brew install openssl@3           brew link --force openssl@3      - name: Check OpenSSL Version and Path        run: |           which openssl           openssl version      - name: Decode and set up iOS certificate        run: |          echo "${{ secrets.IOS_DISTRIBUTION_CREDENTIALS }}" | base64 --decode > ios_distribution.p12          echo "${{ secrets.PROVISIONING_PROFILE }}" | base64 --decode > provisioning.mobileprovision        shell: bash      - name: Import certificate to keychain        run: |          security create-keychain -p "" build.keychain          security import ios_distribution.p12 -k build.keychain -P "${{ secrets.P12_PASSWORD }}" -T /usr/bin/codesign          security set-keychain-settings build.keychain          security unlock-keychain -p "" build.keychain          security set-key-partition-list -S apple-tool:,apple: -s -k "" build.keychain          security list-keychains -d user -s build.keychain $(security list-keychains -d user | tr -d '"')          security list-keychains -s build.keychain        shell: bash      - name: Set provisioning profile        run: |          mkdir -p ~/Library/MobileDevice/Provisioning\ Profiles          cp provisioning.mobileprovision ~/Library/MobileDevice/Provisioning\ Profiles/        shell: bash      - name: Print Current Directory        run: pwd      - name: Set Permissions for API JSON File        run: chmod 600 ios/fastlane/api.json      - name: Build and upload to TestFlight        run: |          cd ios          bundle exec fastlane beta        env:     #    APP_STORE_CONNECT_API_KEY_PATH: ios/AuthKey.json          FASTLANE_USER: ${{ secrets.FASTLANE_USER }}          FASTLANE_PASSWORD: ${{ secrets.FASTLANE_PASSWORD }}

Fastfile:

default_platform(:ios)platform :ios do  desc "Push a new beta build to TestFlight"  lane :beta do    # Increment build number automatically    increment_build_number(      xcodeproj: "somename.xcodeproj"    )    Dir.chdir("../") do      sh "bundle exec pod install"      sh "npm install"    end        # Build the app using your specific workspace and scheme    build_app(      workspace: "somename.xcworkspace",      scheme: "somenameQA",      export_method: "app-store",      export_options: {        provisioningProfiles: {"com.amega.app.qa" => "com.somename.app.qa"        }      }    )      app_store_connect_api_key(      path: "fastlane/api.json"    )    # Upload the build to TestFlight    pilot  endend

I keep getting the following error:

[13:52:25]: Called from Fastfile at line 29[13:52:25]: [13:52:25]:     27: [13:52:25]:     28:     # Upload the build to TestFlight[13:52:25]:  => 29:     pilot( api_key_path: "fastlane/api.json" )[13:52:25]:     30:   end[13:52:25]:     31: end[13:52:25]:[13:52:25]: unexpected token at '{"key_id": "39BDY8TU5D%9","issuer_id": "2323AAsa-2f53-4853-97fe-fb7d0777b2aa","key": "-----BEGIN PRIVATE KEY-----\nMIGHAgSASFDFDdsdgfdgfSM49AwEHBG0wawIBAQQgN3TOiJNOCNVV8nlQ3oqIvYjZgZcKqNul75mZoasdgasdgasdgADSFNeLgKR+3NMEcoZyzC/TCGER6vHEaThF1uFHAmZny4dri+SDJSOdUBkN7jSz0L1gYDKujDIlpQAYNjz+7Srg\n-----END PRIVATE KEY-----","duration": 1200, # optional (maximum 1200)"in_house": false # optional but may be required if using match/sigh  }'+----------------------------------------------+|               fastlane summary               |+------+-------------------------+-------------+| Step | Action                  | Time (in s) |+------+-------------------------+-------------+| 1    | default_platform        | 0           || 2    | increment_build_number  | 0           || 3    | bundle exec pod install | 16          || 4    | npm install             | 7           || 5    | build_app               | 441         || 💥   | pilot                   | 0           |+------+-------------------------+-------------+[13:52:25]: fastlane finished with errorsLooking for related GitHub issues on fastlane/fastlane...bundler: failed to load command: fastlane (/Users/runner/hostedtoolcache/Ruby/3.3.6/arm64/bin/fastlane)/Users/runner/hostedtoolcache/Ruby/3.3.6/arm64/lib/ruby/gems/3.3.0/gems/json-2.7.2/lib/json/common.rb:220:in parse': [!] unexpected token at '{ (JSON::ParserError)"key_id": "1234123SDADSF","issuer_id": "12341234-2f1234124353-1243-3223-12421342134","key": "-----BEGIN PRIVATE KEY-----\nsomeprivatekey\n-----END PRIVATE KEY-----","duration": 1200, # optional (maximum 1200)"in_house": false # optional but may be required if using match/sigh  }'    from /Users/runner/hostedtoolcache/Ruby/3.3.6/arm64/lib/ruby/gems/3.3.0/gems/json-2.7.2/lib/json/common.rb:220:in parse'    from /Users/runner/hostedtoolcache/Ruby/3.3.6/arm64/lib/ruby/gems/3.3.0/gems/fastlane-2.225.0/spaceship/lib/spaceship/connect_api/token.rb:39:in from_json_file'    from /Users/runner/hostedtoolcache/Ruby/3.3.6/arm64/lib/ruby/gems/3.3.0/gems/fastlane-2.225.0/spaceship/lib/spaceship/connect_api/token.rb:34:in from'    from /Users/runner/hostedtoolcache/Ruby/3.3.6/arm64/lib/ruby/gems/3.3.0/gems/fastlane-2.225.0/pilot/lib/pilot/manager.rb:23:in login'    from /Users/runner/hostedtoolcache/Ruby/3.3.6/arm64/lib/ruby/gems/3.3.0/gems/fastlane-2.225.0/pilot/lib/pilot/manager.rb:19:in start'    from /Users/runner/hostedtoolcache/Ruby/3.3.6/arm64/lib/ruby/gems/3.3.0/gems/fastlane-2.225.0/pilot/lib/pilot/build_manager.rb:17:in upload'    from /Users/runner/hostedtoolcache/Ruby/3.3.6/arm64/lib/ruby/gems/3.3.0/gems/fastlane-2.225.0/fastlane/lib/fastlane/actions/upload_to_testflight.rb:34:in run'    from /Users/runner/hostedtoolcache/Ruby/3.3.6/arm64/lib/ruby/gems/3.3.0/gems/fastlane-2.225.0/fastlane/lib/fastlane/runner.rb:263:in block (2 levels) in execute_action'    from /Users/runner/hostedtoolcache/Ruby/3.3.6/arm64/lib/ruby/gems/3.3.0/gems/fastlane-2.225.0/fastlane/lib/fastlane/actions/actions_helper.rb:69:in execute_action'    from /Users/runner/hostedtoolcache/Ruby/3.3.6/arm64/lib/ruby/gems/3.3.0/gems/fastlane-2.225.0/fastlane/lib/fastlane/runner.rb:255:in block in execute_action'    from /Users/runner/hostedtoolcache/Ruby/3.3.6/arm64/lib/ruby/gems/3.3.0/gems/fastlane-2.225.0/fastlane/lib/fastlane/runner.rb:229:in chdir'    from /Users/runner/hostedtoolcache/Ruby/3.3.6/arm64/lib/ruby/gems/3.3.0/gems/fastlane-2.225.0/fastlane/lib/fastlane/runner.rb:229:in execute_action'    from /Users/runner/hostedtoolcache/Ruby/3.3.6/arm64/lib/ruby/gems/3.3.0/gems/fastlane-2.225.0/fastlane/lib/fastlane/runner.rb:157:in trigger_action_by_name'    from /Users/runner/hostedtoolcache/Ruby/3.3.6/arm64/lib/ruby/gems/3.3.0/gems/fastlane-2.225.0/fastlane/lib/fastlane/fast_file.rb:159:in method_missing'    from Fastfile:29:in block (2 levels) in parsing_binding'    from /Users/runner/hostedtoolcache/Ruby/3.3.6/arm64/lib/ruby/gems/3.3.0/gems/fastlane-2.225.0/fastlane/lib/fastlane/lane.rb:41:in call'    from /Users/runner/hostedtoolcache/Ruby/3.3.6/arm64/lib/ruby/gems/3.3.0/gems/fastlane-2.225.0/fastlane/lib/fastlane/runner.rb:49:in block in execute'    from /Users/runner/hostedtoolcache/Ruby/3.3.6/arm64/lib/ruby/gems/3.3.0/gems/fastlane-2.225.0/fastlane/lib/fastlane/runner.rb:45:in chdir'    from /Users/runner/hostedtoolcache/Ruby/3.3.6/arm64/lib/ruby/gems/3.3.0/gems/fastlane-2.225.0/fastlane/lib/fastlane/runner.rb:45:in execute'    from /Users/runner/hostedtoolcache/Ruby/3.3.6/arm64/lib/ruby/gems/3.3.0/gems/fastlane-2.225.0/fastlane/lib/fastlane/lane_manager.rb:46:in cruise_lane'    from /Users/runner/hostedtoolcache/Ruby/3.3.6/arm64/lib/ruby/gems/3.3.0/gems/fastlane-2.225.0/fastlane/lib/fastlane/command_line_handler.rb:34:in handle'    from /Users/runner/hostedtoolcache/Ruby/3.3.6/arm64/lib/ruby/gems/3.3.0/gems/fastlane-2.225.0/fastlane/lib/fastlane/commands_generator.rb:110:in block (2 levels) in run'    from /Users/runner/hostedtoolcache/Ruby/3.3.6/arm64/lib/ruby/gems/3.3.0/gems/commander-4.6.0/lib/commander/command.rb:187:in call'    from /Users/runner/hostedtoolcache/Ruby/3.3.6/arm64/lib/ruby/gems/3.3.0/gems/commander-4.6.0/lib/commander/command.rb:157:in run'    from /Users/runner/hostedtoolcache/Ruby/3.3.6/arm64/lib/ruby/gems/3.3.0/gems/commander-4.6.0/lib/commander/runner.rb:444:in run_active_command'    from /Users/runner/hostedtoolcache/Ruby/3.3.6/arm64/lib/ruby/gems/3.3.0/gems/fastlane-2.225.0/fastlane_core/lib/fastlane_core/ui/fastlane_runner.rb:124:in run!'    from /Users/runner/hostedtoolcache/Ruby/3.3.6/arm64/lib/ruby/gems/3.3.0/gems/commander-4.6.0/lib/commander/delegates.rb:18:in run!'    from /Users/runner/hostedtoolcache/Ruby/3.3.6/arm64/lib/ruby/gems/3.3.0/gems/fastlane-2.225.0/fastlane/lib/fastlane/commands_generator.rb:363:in run'    from /Users/runner/hostedtoolcache/Ruby/3.3.6/arm64/lib/ruby/gems/3.3.0/gems/fastlane-2.225.0/fastlane/lib/fastlane/commands_generator.rb:43:in start'    from /Users/runner/hostedtoolcache/Ruby/3.3.6/arm64/lib/ruby/gems/3.3.0/gems/fastlane-2.225.0/fastlane/lib/fastlane/cli_tools_distributor.rb:123:in take_off'    from /Users/runner/hostedtoolcache/Ruby/3.3.6/arm64/lib/ruby/gems/3.3.0/gems/fastlane-2.225.0/bin/fastlane:23:in <top (required)>'    from /Users/runner/hostedtoolcache/Ruby/3.3.6/arm64/bin/fastlane:25:in load'    from /Users/runner/hostedtoolcache/Ruby/3.3.6/arm64/bin/fastlane:25:in <top (required)>'    from /Users/runner/hostedtoolcache/Ruby/3.3.6/arm64/lib/ruby/gems/3.3.0/gems/bundler-2.5.18/lib/bundler/cli/exec.rb:58:in load'    from /Users/runner/hostedtoolcache/Ruby/3.3.6/arm64/lib/ruby/gems/3.3.0/gems/bundler-2.5.18/lib/bundler/cli/exec.rb:58:in kernel_load'    from /Users/runner/hostedtoolcache/Ruby/3.3.6/arm64/lib/ruby/gems/3.3.0/gems/bundler-2.5.18/lib/bundler/cli/exec.rb:23:in run'    from /Users/runner/hostedtoolcache/Ruby/3.3.6/arm64/lib/ruby/gems/3.3.0/gems/bundler-2.5.18/lib/bundler/cli.rb:455:in exec'    from /Users/runner/hostedtoolcache/Ruby/3.3.6/arm64/lib/ruby/gems/3.3.0/gems/bundler-2.5.18/lib/bundler/vendor/thor/lib/thor/command.rb:28:in run'    from /Users/runner/hostedtoolcache/Ruby/3.3.6/arm64/lib/ruby/gems/3.3.0/gems/bundler-2.5.18/lib/bundler/vendor/thor/lib/thor/invocation.rb:127:in invoke_command'    from /Users/runner/hostedtoolcache/Ruby/3.3.6/arm64/lib/ruby/gems/3.3.0/gems/bundler-2.5.18/lib/bundler/vendor/thor/lib/thor.rb:527:in dispatch'    from /Users/runner/hostedtoolcache/Ruby/3.3.6/arm64/lib/ruby/gems/3.3.0/gems/bundler-2.5.18/lib/bundler/cli.rb:35:in dispatch'    from /Users/runner/hostedtoolcache/Ruby/3.3.6/arm64/lib/ruby/gems/3.3.0/gems/bundler-2.5.18/lib/bundler/vendor/thor/lib/thor/base.rb:584:in start'    from /Users/runner/hostedtoolcache/Ruby/3.3.6/arm64/lib/ruby/gems/3.3.0/gems/bundler-2.5.18/lib/bundler/cli.rb:29:in start'    from /Users/runner/hostedtoolcache/Ruby/3.3.6/arm64/lib/ruby/gems/3.3.0/gems/bundler-2.5.18/exe/bundle:28:in block in <top (required)>'    from /Users/runner/hostedtoolcache/Ruby/3.3.6/arm64/lib/ruby/gems/3.3.0/gems/bundler-2.5.18/lib/bundler/friendly_errors.rb:117:in with_friendly_errors'    from /Users/runner/hostedtoolcache/Ruby/3.3.6/arm64/lib/ruby/gems/3.3.0/gems/bundler-2.5.18/exe/bundle:20:in <top (required)>'    from /Users/runner/hostedtoolcache/Ruby/3.3.6/arm64/bin/bundle:25:in load'    from /Users/runner/hostedtoolcache/Ruby/3.3.6/arm64/bin/bundle:25:in <main>'Error: Process completed with exit code 1.

I tried hardcoding the key, I tried encoding it to base64, i am stuck.As per the documentation of Fastlane this should work.Any help is appreciated!

Error: Native module RNFBAppModule not found. Re-check module install, linking, configuration, build and install steps., js engine: hermes

$
0
0

Package.json

"dependencies": {"@react-native-async-storage/async-storage": "^2.0.0","@react-native-firebase/app": "^21.4.0","@react-native-firebase/auth": "^21.4.0","@react-native-firebase/firestore": "^21.4.0","@react-navigation/bottom-tabs": "^6.5.0","@react-navigation/native": "^6.1.0","@react-navigation/native-stack": "^6.9.0","axios": "^1.7.7","firebase": "^11.0.1","react": "18.3.1","react-native": "0.75.4","react-native-calendars": "^1.1307.0","react-native-get-random-values": "^1.11.0","react-native-paper": "^5.12.5","react-native-safe-area-context": "^4.11.1","react-native-screens": "^4.0.0","react-native-svg": "^15.8.0","react-native-vector-icons": "^10.2.0","react-native-video": "^6.7.0","react-native-webview": "^13.12.3","uuid": "^11.0.2"  },

Podfile

# 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, '14.0'prepare_react_native_project!linkage = ENV['USE_FRAMEWORKS']if linkage != nil  Pod::UI.puts "Configuring Pod with #{linkage}ally linked Frameworks".green  use_frameworks! :linkage => linkage.to_symendtarget 'app' do  use_frameworks! :linkage => :static  $RNFirebaseAsStaticFramework = true  config = use_native_modules!  use_modular_headers!  pod 'RNFBApp', path: '../node_modules/@react-native-firebase/app'  pod 'FirebaseCore', :modular_headers => true  pod 'FirebaseCoreExtension', :modular_headers => true  pod 'FirebaseInstallations', :modular_headers => true  pod 'GoogleDataTransport', :modular_headers => true  pod 'GoogleUtilities', :modular_headers => true  pod 'nanopb', :modular_headers => true  use_react_native!(    :path => config[:reactNativePath],    :hermes_enabled => true,    :fabric_enabled => true,    :app_path => "#{Pod::Config.instance.installation_root}/.."  )  target 'apptest' 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

I made some additions to my Podfile as recommended on the React Native Firebase website. I noticed that some Firebase files were missing, so I added them. However, despite providing the path for the RNFBApp module, it still appears to be missing. I have tried running pod install --repo-update and deleting the Podfile.lock and Pods directory before reinstalling, but this issue persists.

Expo app won't build for ios after updating to Xcode 16.1

$
0
0

Everything was working fine until I updated my Xcode to 16.1.

Build fails with:

⚠️  ld: ignoring duplicate libraries: '-lc++'⚠️  ld: Could not find or use auto-linked framework 'CoreAudioTypes': framework 'CoreAudioTypes' not found⚠️  ld: Could not parse or use implicit file '/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator.sdk/System/Library/Frameworks/SwiftUICore.framework/SwiftUICore.tbd': cannot link directly with 'SwiftUICore' because product being built is not an allowed client of it❌  Undefined symbols for architecture arm64┌─ Symbol: absl::lts_20240116::CHexEscape(absl::lts_20240116::string_view)└─ Referenced from: grpc_core::StatusToString(absl::lts_20240116::Status const&)::$_0::operator()(absl::lts_20240116::string_view, absl::lts_20240116::Cord const&) const in grpc[737](status_helper.o)❌  ld: symbol(s) not found for architecture arm64

and

2 error(s), and 32 warning(s)CommandError: Failed to build iOS project. "xcodebuild" exited with error code 65.error Command failed with exit code 1.info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.

I've tried clearing pods and reinstalling, deleting xcode derived data, reinstalling node modules, now I don't know what to do to get this app working.

React Native - Disable Password AutoFill Option on iOS Keyboard

$
0
0

In React Native, how do you disable or prevent the keyboard from displaying the Password Autofill accessory view option? There doesn't seem to be an property for TextInput that handles disabling this option. React Native TextInput Documentation. I am also using Expo on top of React Native.

Password AutoFill was introduced in iOS 11

Image of Password AutoFill Accessory view option

Here is a post that has a solution for disabling the password autofill accessory, but how can we achieve this using React Native?

iOS 11 disable password autofill accessory view option?

Launching the application on Xcode

$
0
0

I have error in Xcode

Build input file cannot be found: '/Users/taruk/Library/Developer/Xcode/DerivedData/App-hhvpmgvwklorzwalivveulunuowb/Build/Products/Debug-iphoneos/App.app/App.debug.dylib'. Did you forget to declare this file as an output of a script phase or custom build rule which produces it?

I tried to do what the Internet and chatgpt advises, but it didn't help

Definition of 'MPGDPRConsent' must be imported from module 'mParticle_Apple_SDK.Swift' before it is required

$
0
0

Getting below error after project being upgraded to react-native 0.73

iOS minimum Development : iOS 13

Showing All Errors Only

/node_modules/react-native-mparticle/ios/RNMParticle/RNMParticle.m:648:34: Definition of 'MPGDPRConsent' must be imported from module 'mParticle_Apple_SDK.Swift' before it is required

package.json

"react": "18.2.0","react-native": "^0.73.0","react-native-mparticle": "^2.7.12",

pod file

platform :ios, '14.0'install! 'cocoapods', :deterministic_uuids => falsetarget 'myApp' do  config = use_native_modules!  use_modular_headers!   pod 'mParticle-Apple-SDK', '~> 8.17'     pre_install do |installer|    installer.pod_targets.each do |pod|      if pod.name == 'mParticle-Apple-SDK'        def pod.build_type;          Pod::BuildType.new(:linkage => :dynamic, :packaging => :framework)        end      end    end  end   post_install do |installer|    react_native_post_install(installer)    # Exclude arm64 architecture for simulators (for Apple Silicon)    installer.pods_project.build_configurations.each do |config|      config.build_settings["EXCLUDED_ARCHS[sdk=iphonesimulator*]"] = "arm64"    end  endend

Uploading to TestFlight using Fastlane issue

$
0
0

In continuation to this question
I keep getting the below error when trying to upload to TestFlight: (please bare in mind that the key is indeed correct)

[08:17:35]: Called from Fastfile at line 30[08:17:35]: ```[08:17:35]:     28: [08:17:35]:     29:     # Upload the build to TestFlight[08:17:35]:  => 30:     pilot( api_key_path: "fastlane/api.json" )[08:17:35]:     31:   end[08:17:35]:     32: end[08:17:35]: ```[08:17:35]: Authentication credentials are missing or invalid. - Provide a properly configured and signed bearer token, and make sure that it has not expired. Learn more about Generating Tokens for API Requests 

my json format is like so (bare in mind the multiple \n used for each line in the private key):

{"key_id": "my_key_id","issuer_id": "my_issuer_id","key": "-----BEGIN PRIVATE KEY-----\nMIGTAgEAMBMGByqGSM49AgEGCCqGSM49AwEHBHknlhdlYdLu\nAgEGCCqGSM49AwEHBHknlhdlYdLu\nAgEGCCqGSM49AwEHBHknlhdlYdLu\n-----END PRIVATE KEY-----","duration": 1200,"in_house": false}

and I provide the above api.json like so in fastfile:

pilot( api_key_path: "fastlane/api.json" )

Workflow yml file:

name: iOS Build and Upload to TestFlighton:  workflow_dispatch:jobs:  build-ios:    runs-on: macos-latest    steps:      - name: Checkout code        uses: actions/checkout@v4      - name: Set up Ruby        uses: ruby/setup-ruby@v1        with:          ruby-version: '3.3'      # Install Bundler and CocoaPods      - name: Install Bundler and CocoaPods        run: |          gem install bundler          sudo gem install cocoapods      - name: Install Node.js dependencies        run: npm install      - name: Navigate to iOS directory, clean Pods, and remove Podfile.lock        run: |          cd ios          pod deintegrate          rm -rf Podfile.lock          npx pod-install      - name: Install Fastlane dependencies        run: |          cd ios          bundle install      - name: Decode and set up iOS certificate        run: |          echo "${{ secrets.IOS_DISTRIBUTION_CREDENTIALS }}" | base64 --decode > ios_distribution.p12          echo "${{ secrets.PROVISIONING_PROFILE }}" | base64 --decode > provisioning.mobileprovision        shell: bash      - name: Import certificate to keychain        run: |          security create-keychain -p "" build.keychain          security import ios_distribution.p12 -k build.keychain -P "${{ secrets.P12_PASSWORD }}" -T /usr/bin/codesign          security set-keychain-settings build.keychain          security unlock-keychain -p "" build.keychain          security set-key-partition-list -S apple-tool:,apple: -s -k "" build.keychain          security list-keychains -d user -s build.keychain $(security list-keychains -d user | tr -d '"')          security list-keychains -s build.keychain        shell: bash      - name: Set provisioning profile        run: |          mkdir -p ~/Library/MobileDevice/Provisioning\ Profiles          cp provisioning.mobileprovision ~/Library/MobileDevice/Provisioning\ Profiles/        shell: bash      - name: Build and upload to TestFlight        run: |          cd ios          bundle exec fastlane beta

Fastfile:

default_platform(:ios)platform :ios do  desc "Push a new beta build to TestFlight"  lane :beta do    # Increment build number automatically    increment_build_number(      xcodeproj: "someapp.xcodeproj"    )    # Build the app using your specific workspace and scheme    build_app(      workspace: "someapp.xcworkspace",      scheme: "someappQA",      export_method: "app-store",      export_options: {        provisioningProfiles: {"com.someapp.app.qa" => "com.someapp.app.qa"        }      }    )      # Upload the build to TestFlight    upload_to_testflight( api_key_path: "fastlane/api.json" )  endend

React Native Fetch API In IOS Only Semicolon In Url Not Encoded

$
0
0

So I'm using React Native for an IOS App, and using Fetch API for networking. My URL is like this:

https://example.testing.com/filterString=product.code><CODE01;CODE02

and it's usually automatically encoded after I call the fetch method. It's supposed to be like below for my App to get the response correctly from the server:

https://example.testing.com/filterString=product.code%3E%3CCODE01%3BCODE02

But instead it become like this:

https://example.testing.com/filterString=product.code%3E%3CEKWED014T;EKWED014

So it won't encode ONLY the semicolon part of the url.

Here's my code:

const response = await fetch(url, { method, headers });

And here's how I found that my url isn't encoded correctly after being sent to the server:

const responseURL = await response.urlconsole.log('displayUrl: '+responseURL);

UPDATE:

I need to add that there is no option to encode the url before calling the "fetch" method, because it will still get encoded again, so it will get encoded twice.

For example, I encode just the semicolon:

"CODE01;CODE02" to "CODE01%3BCODE02"

The method would just pick the "%" and then it become:

"CODE01%253BCODE02"

Very weird random UI bugs in React Native (with Nativewind installed) on iOS

$
0
0

I am encountering some very random UI bugs in our RN app, that range all over the place (on iOS). In RN 0.75, they only show up in release mode (not in dev client) and in 76, they also show up in devClient.ScreenshotFor example in some cases this very simple component gets distorted in a weird way:

import { View } from "react-native";interface PaginationDotProps {    isActive: boolean;}export const PaginationDot: React.FC<PaginationDotProps> = ({ isActive }) => (<View        style={{            width: 8,            height: 8,            backgroundColor: isActive ? "black" : "rgba(0,0,0,0.2)",            borderRadius: 4,        }}    />);

Screenshot

Screenshot

How can we debug this, or what could be the reason? it seems like it is a bug inside react native framework, or maybe related to an installed package.

This is our package.json (all packages latest up to date as of today):

{..."scripts": {"start:dev": "APP_VARIANT=dev pnpm expo start --dev-client --scheme hivemind-dev","android:dev": "APP_VARIANT=dev expo run:android","ios:dev": "APP_VARIANT=dev expo run:ios","android:staging": "APP_VARIANT=staging expo run:android","ios:staging": "APP_VARIANT=staging expo run:ios","android:prod": "APP_VARIANT=prod expo run:android","ios:prod": "APP_VARIANT=prod expo run:ios",...    },"dependencies": {"@dev-plugins/react-query": "^0.0.7","@expo-google-fonts/fira-code": "^0.2.3","@expo-google-fonts/noto-sans": "^0.2.3","@expo-google-fonts/outfit": "^0.2.3","@expo/vector-icons": "^14.0.4","@invertase/react-native-apple-authentication": "^2.4.0","@likashefqet/react-native-image-zoom": "^4.2.0","@react-native-async-storage/async-storage": "2.0.0","@react-native-firebase/app": "^21.4.0","@react-native-firebase/app-check": "^21.4.0","@react-native-firebase/auth": "^21.4.0","@react-native-google-signin/google-signin": "^13.1.0","@react-navigation/bottom-tabs": "7.0.1","@react-navigation/material-top-tabs": "7.0.1","@react-navigation/native": "7.0.0","@sentry/react-native": "^6.1.0","@tanstack/react-query": "^5.59.20","@uidotdev/usehooks": "^2.4.1","clsx": "^2.1.1","expo": "~52.0.3","expo-application": "~6.0.1","expo-av": "~15.0.1","expo-blur": "~14.0.1","expo-build-properties": "~0.13.1","expo-dev-client": "~5.0.1","expo-document-picker": "~13.0.1","expo-font": "~13.0.0","expo-haptics": "~14.0.0","expo-image": "~2.0.0","expo-localization": "~16.0.0","expo-router": "~4.0.2","expo-sharing": "~13.0.0","expo-splash-screen": "~0.28.4","expo-store-review": "~8.0.0","expo-system-ui": "~4.0.1","expo-updates": "~0.26.4","expo-web-browser": "~14.0.0","marked": "15.0.0","nativewind": "^4.1.23","openapi-fetch": "^0.13.0","openapi-react-query": "^0.2.4","posthog-react-native": "^3.3.10","posthog-react-native-session-replay": "^0.1.6","prism-react-renderer": "^2.4.0","react": "18.3.1","react-content-loader": "^7.0.2","react-native": "0.76.1","react-native-gesture-handler": "~2.20.2","react-native-marked": "^6.0.5","react-native-pager-view": "6.5.0","react-native-purchases": "^8.2.6","react-native-reanimated": "~3.16.1","react-native-safe-area-context": "4.14.0","react-native-screens": "4.0.0","react-native-svg": "15.8.0","socket.io-client": "^4.8.1","tailwind-merge": "^2.5.4","tailwindcss": "^3.4.14","text-encoding-polyfill": "^0.6.7"    },"devDependencies": {"@babel/core": "^7.26.0","@biomejs/biome": "1.9.4","@types/marked": "~6.0.0","@types/react": "~18.3.12","openapi-typescript": "^7.4.3","react-test-renderer": "18.3.1","typescript": "~5.6.3"    },"private": true,"packageManager": "pnpm@9.12.3"}

React Native - secureTextEntry Disable IOS 13+ Strong Password behavior

$
0
0

I have an create account form in my app and now on iOS devices running 13+ I'm having an issue where if the the user presses the "done" key while entering a password the normal secure password dots are replaced with the following (see below). How to disable this behavior so it continues to work as it did on older devices?

enter image description here

Notifee build error in React Native Expo app

$
0
0

I'd love to install Notifee for my Expo project since I would need local and remote push notifications to interact with users in my app (iOS/Android).

I follow the instruction on the website and I can see Notifee as installed in my package.json file

{"name": "etmhomecrossexpo","version": "1.0.0","scripts": {"start": "expo start --dev-client","android": "expo run:android","ios": "expo run:ios","web": "expo start --web"},"dependencies": {"@notifee/react-native": "^7.8.2","@react-native-async-storage/async-storage": "^1.23.1","@react-navigation/native": "^6.1.14","@react-navigation/native-stack": "^6.9.22","@types/react": "~18.2.45","expo": "~50.0.11","expo-application": "~5.8.3","expo-build-properties": "~0.11.1","expo-dev-client": "~3.3.9","expo-device": "~5.9.4","expo-screen-orientation": "~6.4.1","expo-status-bar": "~1.11.1","highcharts": "^11.4.0","i18next": "^23.10.1","moment-timezone": "^0.5.45","react": "18.2.0","react-i18next": "^14.1.0","react-native": "0.73.6","react-native-base64": "^0.2.1","react-native-change-icon": "^5.0.0","react-native-device-info": "^10.13.1","react-native-localize": "^3.0.6","react-native-modal": "^13.0.1","react-native-pager-view": "^6.2.3","react-native-safe-area-context": "4.8.2","react-native-screens": "~3.29.0","react-native-sqlite-storage": "^6.0.1","react-native-webview": "^13.8.4","react-native-xml2js": "^1.0.3","semver": "^7.6.3","typescript": "^5.3.0","xml-formatter": "^3.6.2","xml-js": "^1.6.11","xml2js": "^0.6.2"},"devDependencies": {"@babel/core": "^7.20.0","@react-native-community/datetimepicker": "^7.6.3","@react-native-picker/picker": "^2.7.2","react-native-wheel-pick": "^1.2.2"},"private": true}

after that I add just the import line in one of my app file

import notifee from '@notifee/react-native';

Now I want to try it on my devices (both Android and iPhone). On Android I got no problem after an npx expo run:android and it runs, instead my iOS app doesn't not build: I tried to build using eas build --platform ios --local and I got this

Fastlane is not available, make sure it's installed and in your PATH spawn fastlane ENOENT npx exited with non-zero code: 1

Also trying to use and old development build and trying to run using my own dev server with npx expo start --dev-client I got errors:

ERROR Error: Notifee native module not found.ERROR Invariant Violation: "main" has not been registered. This can happen if:Metro (the local dev server) is run from the wrong folder. Check if Metro is running, stop it and restart it in the current project.A module failed to load due to an error and AppRegistry.registerComponent wasn't called.› Stopped server

After a bit of searching on the web I have not found a solution, do you have any suggestions for me?

Thank you in advance

React navigation content size too narrow

$
0
0

Hi I am implementing react navigation in a react native app, and I am following the docs on react navigation. And I when I run the code this is the result:Result

My question is how do I make the center content's width same as the screen.Also, his is my first time using react native expo after switching from reactJS

Code:navigator code:

import Login from "./Login";import Signup from "./Signup";import {  createAppContainer,  NavigationContainer,  NavigationNavigator,} from "react-navigation";import { createStackNavigator } from "react-navigation-stack";import Chat from "./Chat";import Error from "./Error";/** * This is the screen stack of the navigation stack. */const screens: any = {  default: { screen: Login },  signup: { screen: Signup },  chat: { screen: Chat },  Error: { screen: Error },};const stack: NavigationNavigator<any, any> = createStackNavigator(screens);const container: NavigationContainer = createAppContainer(stack);export default container;

App.tsx:

import { StatusBar } from "expo-status-bar";import React from "react";import { Alert, StyleSheet, Text, View } from "react-native";import * as expoAppLoading from "expo-app-loading";import loadFonts from "./assets/fonts/loader";import Navigator from "./screens/navigator";/** * This is the main app component of the Chill&chat application. */const App: React.FC = () => {  const [loading, setLoading] = React.useState(true);  const style: any = StyleSheet.create({    container: {      flex: 1,      backgroundColor: "#fff",      alignItems: "center",      justifyContent: "center",    },    text: {      fontFamily: "poppinsBold",    },  });  if (loading) {    return (<expoAppLoading.default        startAsync={async (): Promise<void> => {          await loadFonts();        }}        onFinish={(): void => {          setLoading(false);        }}        onError={(): void => {          Alert.alert("Error", "Error loading fonts");        }}      />    );  } else {    return (<View style={style.container}><Navigator /><StatusBar style="auto" /></View>    );  }};export default App;

asset validation failed invalid executable. the executable 'myapp.app/frameworks/cardio.framework/cardio' contains bitcode

$
0
0

I encountered this problem after updating to macOS 15 Sequoia and the latest version of Xcode 16. I'm getting this error when trying to publish the build from Xcode.

Does anyone know the solution?

What is the meaning of 'No bundle URL present' in react-native?

$
0
0

When I run a react-native project, I get a error no bundle URL present, but I don't know what mistakes I do, I was very confused.

no bundle url present error


React Native Error: EMFILE: too many open files, watch

$
0
0

Getting the following error and not 100% sure why. Currently getting this issue when I run my app in ios simulator

I've tried to do npm install watchman, But I just saw the latest update on the npm packages and it seems like it's been depreciated.

events.js:292      throw er; // Unhandled 'error' event      ^Error: EMFILE: too many open files, watch    at FSEvent.FSWatcher._handle.onchange (internal/fs/watchers.js:127:28)Emitted 'error' event on NodeWatcher instance at:    at NodeWatcher.checkedEmitError     at FSWatcher.emit (events.js:315:20)    at FSEvent.FSWatcher._handle.onchange (internal/fs/watchers.js:133:12) {  errno: -24,  syscall: 'watch',  code: 'EMFILE',  filename: null}

Issue with @react-native-voice/voice on iOS: Stops Working After First Run

$
0
0

I am using the React Native library @react-native-voice/voice.

This package doesn't seem to be working correctly with the latest versions of React Native and iOS. It works properly on the first run, but once it has been stopped, it cannot be started again. No exceptions are thrown either.

Has anyone experienced the same issue or knows what the problem might be (on my end or with the package), and how to resolve it?

Note: It is working as expected on Android.

AzureCommunicationCalling iOS sdk does not have support for Apple Swift version 6.0.2 effective-5.10 (swiftlang-6.0.2.1.2 clang-1600.0.26.4)

$
0
0

I am trying to integrate AzureCommunicationCalling iOS sdk in my react native project. but when i try to import AzureCommunicationCalling in a swift file, build error occurs.

Failed to build module 'AzureCommunicationCalling'; this SDK is not supported by the compiler (the SDK is built with 'Apple Swift version 5.4 (swiftlang-1205.0.26.9 clang-1205.0.19.55)', while this compiler is 'Apple Swift version 6.0.2 effective-5.10 (swiftlang-6.0.2.1.2 clang-1600.0.26.4)'). Please select a toolchain which matches the SDK.

Is there any workaround for this? I tried to do the following:

  1. Downgrade my Xcode version to 15.1 (I get a different error Failed to build module 'AzureCommunicationCalling' for importation due to the errors above; the textual interface may be broken by project issues or a compiler bug)
  2. Set Build Libraries For Distribution to YES in Build Settings (In this case the error goes away but i get a different error saying Using bridging headers with module interfaces is unsupported)
  3. Created a new react native project and tried to integrate the sdk. (Same error)

This is my Podfile

def node_require(script)  # Resolve script with node to allow for hoisting  require Pod::Executable.execute_command('node', ['-p',"require.resolve('#{script}',      {paths: [process.argv[1]]},    )", __dir__]).stripendnode_require('react-native/scripts/react_native_pods.rb')node_require('react-native-permissions/scripts/setup.rb')platform :ios, 13.4prepare_react_native_project!setup_permissions(['LocationAccuracy','LocationAlways','LocationWhenInUse','Notifications',])use_frameworks! :linkage => :staticabstract_target 'myProjectCommonPods' do  pod 'react-native-google-maps', :path => '../node_modules/react-native-maps'  config = use_native_modules!  use_react_native!(    :path => config[:reactNativePath],    :app_path => "#{Pod::Config.instance.installation_root}/..",    :hermes_enabled => false  )  pod 'AzureCommunicationCalling', '~> 2.13.1'  target 'myProject Dev' do    $RNFirebaseAsStaticFramework = true  end  target 'myProject Live' do    $RNFirebaseAsStaticFramework = true  end  pod 'glog', :podspec => '../node_modules/react-native/third-party-podspecs/glog.podspec', :modular_headers => false  pod 'react-native-webview', :path => '../node_modules/react-native-webview'  pod 'RNReanimated', :path => '../node_modules/react-native-reanimated'  pod 'RNGestureHandler', :path => '../node_modules/react-native-gesture-handler'  pod 'react-native-slider', :path => '../node_modules/@react-native-community/slider'  pod 'RNSVG', :path => '../node_modules/react-native-svg'  pod 'react-native-geolocation', :path => '../node_modules/@react-native-community/geolocation'  target 'myProjectTests' do    inherit! :complete    # Pods for testing  end  pre_install do |installer|    Pod::Installer::Xcode::TargetValidator.send(:define_method, :verify_no_static_framework_transitive_dependencies) {}    installer.pod_targets.each do |pod|      if pod.name.eql?('RNPermissions') || pod.name.start_with?('Permission-')        def pod.build_type;        Pod::BuildType.static_library      end    end    if pod.name.start_with?('AzureCommunicationCommon') || pod.name.start_with?('AzureCommunicationCalling')      def pod.build_type;      Pod::BuildType.new(:linkage => :dynamic, :packaging => :framework)    end  end  endend  post_install do |installer|    react_native_post_install(      installer,      config[:reactNativePath],      :mac_catalyst_enabled => false    )    installer.pods_project.build_configurations.each do |config|      config.build_settings["EXCLUDED_ARCHS[sdk=iphonesimulator*]"] = "$(inherited) arm64"      if config.name == 'Debug'        config.build_settings['CODE_SIGNING_ALLOWED'] = 'NO'      end    end  endendtarget 'OneSignalNotificationServiceExtension' do  pod 'OneSignalXCFramework', '>= 5.0.0', '< 6.0'endtarget 'OneSignalNotificationServiceExtensionLive' do  pod 'OneSignalXCFramework', '>= 5.0.0', '< 6.0'end

I am using

  1. Xcode version 16.1
  2. AzureCommunicationCalling iOS sdk version 2.13.1
  3. React native version 0.74.4

I was trying to build react native app on a react iPhone device (iOS version 17.6.1).

NativeViewGestureHandler must be used as a descendant of GestureHandlerRootView. Otherwise the gestures will not be recognized

$
0
0

I'm new to React Native and currently working on a simple Todo app. However, I'm encountering an issue related to gestures. Specifically, I'm getting the following error

NativeViewGestureHandler must be used as a descendant of GestureHandlerRootView. Otherwise, the gestures will not be recognized.

Here's the relevant code for my app.

import { useState } from "react";import { StyleSheet, Text, View, FlatList } from "react-native";export default function Index() {  const [todos, setTodos] = useState([    { text: 'buy coffee', key: '1' },    { text: 'create an app', key: '2' },    { text: 'play cricket', key: '3' },  ]);  return (<View style={styles.container}><View style={styles.content}><View style={styles.list}><FlatList            data={todos}            renderItem={({ item }) => (<Text>{item.text}</Text>            )}          /></View></View></View>  );}const styles = StyleSheet.create({  container: {    flex: 1,    backgroundColor: '#fff'  },  content: {    padding: 40  },  list: {    marginTop: 20  }});

What I've tried:I’ve wrapped my root component in GestureHandlerRootView but the error persists.I’ve made sure to install and link react-native-gesture-handler correctly.

What am I missing? How can I fix this error and integrate gesture handlers properly in my app?

React Native Track Player ios Troubleshooting building 100%

$
0
0

I'm developing a React Native app using react-native-track-player for audio playback. The app works perfectly fine on Android, but I'm facing issues on iOS. Specifically, when building and running the app, it freezes at "Building 100%" and eventually crashes with the following error:

com.facebook.react.runtime.JavaScript (9): EXC_BAD_ACCESS (code=1, address=0x0)

Screenshotenter image description here

The error occurs when i add

await TrackPlayer.setupPlayer(); 

to the code.

This is my code :

import React, { useEffect } from 'react';import { View, Button } from 'react-native';import TrackPlayer,{ Capability } from 'react-native-track-player';const AudioPlayer: React.FC = () => {  useEffect(() => {    const setupPlayer = async () => {      await TrackPlayer.setupPlayer();      // Ajout de la piste      const audioPath = require('../../assets/audio/teddy.mp3');      await TrackPlayer.add({        id: 'trackId',        url: audioPath,        title: 'Teddy Audio',        artist: 'Inconnu',        artwork: 'https://www.example.com/artwork.jpg',      });      // Configure les contrôles de notification      TrackPlayer.updateOptions({        capabilities: [          Capability.Play,          Capability.Pause,          Capability.Stop,        ],        compactCapabilities: [          Capability.Play,          Capability.Pause,        ],        notificationCapabilities: [          Capability.Play,          Capability.Pause,          Capability.Stop,        ],      });    };    setupPlayer();    return () => {      TrackPlayer.stop();    };  }, []);  const playAudio = async () => {    await TrackPlayer.play();  };  const pauseAudio = async () => {    await TrackPlayer.pause();  };  return (<View><Button title="Lire l'audio" onPress={playAudio} /><Button title="Pause" onPress={pauseAudio} /></View>  );};export default AudioPlayer;

Has anyone else experienced a similar issue or found a solution?

Here is what I have tried so far:

  1. Wrapped the setup in a try-catch block to capture any potential errors.
  2. Verified compatibility with my React Native and react-native-track-player versions.
  3. Ensured necessary permissions and configurations are set for Android and iOS.
  4. add dummy.swift file

React Native Expo Audio not playing on iOS

$
0
0

I'm trying to build a simple audio player that loads a file from our server and plays it. Currently this code works on Android but iOS doesn't work, throwing the error

AVPlayerItem instance has failed with the error code -11850 and domain "AVFoundationErrorDomain"

From what I've gathered, this is an issue with iOS expecting a file extension when it tries to load the audio file. We are using the exact same server route on our React web app with no problems, it's able to load the file within a simple audio html element. Android is also functioning with the React Native code below:

const loadNewPlaybackInstance = async playing => {  const source = { uri: url } // defined as `${api}/api/v1/voicemail?s3_email_id=${s3_email_id}`  // This returns a voicemail.wav file   const initialStatus = {    shouldPlay: playing,    rate: 1.0,    volume: volume,    isMuted: false,  }  try {    const { sound } = await Audio.Sound.createAsync(      source,      initialStatus,      onPlaybackStatusUpdate,    )    setPlaybackInstance(sound)    updateScreenForLoading(false)  } catch (error) {    console.error(error.message)  }}

I've found another SO question, but there isn't a real answer.

There is also an open issue on Github which seems to be forgotten that I've also tried to revive.

Does anyone have any insight into how to resolve this issue? Let me know if there is more detail/context needed to help.

Expo Build Problem - Unsupported MIME type: image/webp

$
0
0

I'm getting the following errors when building my Expo project for iOS and Android. I'm not using any .webp files anywhere in my project. However, I haven't been able to solve the problem. What do you think could be the issue?

"expo": "^50.0.0","react": "18.2.0","react-native": "0.73.6",

IOS

- Creating native directory (./ios)✔ Created native directory- Updating package.json✔ Updated package.json- Running prebuild✖ Prebuild failedError: [ios.dangerous]: withIosDangerousBaseMod: Unsupported MIME type: image/webpError: [ios.dangerous]: withIosDangerousBaseMod: Unsupported MIME type: image/webp    at Jimp.throwError (/Users/expo/workingdir/build/node_modules/jimp-compact/dist/jimp.js:1:833)    at Jimp.parseBitmap (/Users/expo/workingdir/build/node_modules/jimp-compact/dist/jimp.js:1:125733)    at Jimp.parseBitmap (/Users/expo/workingdir/build/node_modules/jimp-compact/dist/jimp.js:1:8514)    at /Users/expo/workingdir/build/node_modules/jimp-compact/dist/jimp.js:1:7613    at FSReqCallback.readFileAfterClose [as oncomplete] (node:internal/fs/read_file_context:68:3)npx expo prebuild --no-install --platform ios exited with non-zero code: 1

ANDROID

- Creating native directory (./android)✔ Created native directory- Updating package.json✔ Updated package.json- Running prebuild✖ Prebuild failedError: [android.dangerous]: withAndroidDangerousBaseMod: Unsupported MIME type: image/webpError: [android.dangerous]: withAndroidDangerousBaseMod: Unsupported MIME type: image/webp    at Jimp.throwError (/home/expo/workingdir/build/node_modules/jimp-compact/dist/jimp.js:1:833)    at Jimp.parseBitmap (/home/expo/workingdir/build/node_modules/jimp-compact/dist/jimp.js:1:125733)    at Jimp.parseBitmap (/home/expo/workingdir/build/node_modules/jimp-compact/dist/jimp.js:1:8514)    at /home/expo/workingdir/build/node_modules/jimp-compact/dist/jimp.js:1:7613    at FSReqCallback.readFileAfterClose [as oncomplete] (node:internal/fs/read_file_context:68:3)npx expo prebuild --no-install --platform android exited with non-zero code: 1

React Native 0.76 renders bold text different from earlier versions on iOS

$
0
0

Previously I've been able to adjust the font weight without specifying the "-Bold" font family, but by just setting an appropriate font weight.

After upgrading, it's not choosing the font based on the width, even though that's the intended behavior according to the docs: https://reactnative.dev/docs/text-style-props#fontweight

On Android it works as expected.

Here's my testing code:

<Text            style={[              { fontFamily: 'Chivo-Bold', fontSize: 31 },              { fontSize: 32, lineHeight: 35, fontWeight: '700', letterSpacing: -0.5 },            ]}>            Aasd sadasdƒ Sg</Text><Text            style={[              { fontFamily: 'Chivo-Regular', fontSize: 31 },              { fontSize: 32, lineHeight: 35, fontWeight: '700', letterSpacing: -0.5 },            ]}>            Aasd sadasdƒ Sg</Text>

Here's how it looks in RN 0.75 and 0.71 without New Architecture

RN 0.71

Here's how it looks in RN 0.76 with New Architecture

RN 0.76 with new architecture

Can't archive with Xcode (error - PhaseScriptExecution failed with a non zero exit code), but the build is successful

$
0
0

Error in detail, the black area is the name of the project and its sub-directoryError from Xcode I am sorry for the black marks in the image.

I have seen multiple posts suggesting an answer to this problem, Lock unlocks keychain (tried it), pod Update (tried it), clear build(tried it), signing, skip install in build settings(tried it) - None of them actually worked.

I built my iOS app in react native with Expo, after which I did expo eject to create the iOS folder for Xcode build and archiving, the build is successful every time and it even runs on the simulator and in my device(iPhone 7) but it always failed to archive by throwing this error - Uncategorised - Command PhaseScriptExecution failed with a non zero exit code..

Any help to point me in which direction should I go or what can be the possible mistake that I am doing will be of great help. Do let me know if, I should provide any more detail about this. Thank you!

Xcode Version - 11.0Mac Version - 10.15 CatalinaiPhone OS - 13.1.3

Few links I tried from -

  1. "${PODS_ROOT}/SwiftLint/swiftlint" causes "Command PhaseScriptExecution failed with a nonzero exit code" with Xcode 10
  2. https://github.com/apollographql/apollo-ios/issues/395
  3. https://www.reddit.com/r/iOSProgramming/comments/al9box/getting_an_error_command_phasescriptexecution/

React Native - Use cookies to authenticate in WebView

$
0
0

So I've been provided a couple of API's for a React Native application.One endpoint is for authentication and it returns a cookie which allows access to other API's.

The cookie has the following structure:

{"auth":"ok","instance":"private","cookies":{"SSOsess":"300|c6dc6d70vfvbf0891004364665f24b77","RTBk":"300|451706342c67a37dfe5dede0b5d22469","ph03RPNCiscoASA":"application.api.urlweb.com","ph04RPNCiscoASA":"application.client.urlweb.com"}}

After a bit of formatting the cookie is ready to be sent and looks like this:

SSOsess=300%7Cc6dc6d70vfvbf0891004364665f24b77; RTBk=300%7C451706342c67a37dfe5dede0b5d22469;ph03RPNCiscoASA=application.api.urlweb.com;ph04RPNCiscoASA=application.client.urlweb.com;

The are some WebView's inside the React Native application that access some restricted parts of a website that uses some of the API's initially provided.

How can I send the cookie to the WebView? I know React Native has some attributes that could be used to inject cookies into the WebView such as injectedJavaScript or injectedJavaScriptBeforeContentLoaded but what exactly should those attributes contain?

I've tried sending it the following way but it does not work:

<WebView source={{ uri: 'http://urlweb.com' }}               style={{width: 600, height: 400}}               injectedJavaScriptBeforeContentLoaded={jsInjectedCode}/>

where

jsInjectedCode = 'document.cookie = '+'SSOsess=300%7Cc6dc6d70vfvbf0891004364665f24b77; RTBk=300%7C451706342c67a37dfe5dede0b5d22469;    ph03RPNCiscoASA=application.api.urlweb.com;    ph04RPNCiscoASA=application.client.urlweb.com;'

Xcode 12.4 React native build failed in IOS Showing All Messages Command PhaseScriptExecution failed with a nonzero exit code

$
0
0

i am new in react native i want to run react native app in IOS after react-native init, app not run in IOS show some errorShowing All Messagesbash: Native/social_login/socialLogin/node_modules/react-native/scripts/../Libraries: No such file or directoryCommand PhaseScriptExecution failed with a nonzero exit codeand build failed please help meversions
"react": "17.0.1","react-native": "0.64.0"command line tools : Xcode 12.4 (12D4e)

Expo Stuck on Splash Screen, after building locally and installing on android and ios device

$
0
0

I recently updated my expo to latest version and my app will now no longer work. I've even tried reverting my app's codebase to a previous commit before I made the changes to my packages. I don't get any errors, instead the app "boots" up and is stuck on the default expo splash screen.

See the expo-doctor logs:expo-doctor-logs

I tried to update my App.js, removing anything that has to do with expo-splash-screen. See App.js:App.js code

See also, my index.js:index.js code

See my dependencies:{"name": "app-name","version": "1.0.0","main": "index.js","scripts": {"start": "expo start","android": "expo start --android","ios": "expo start --ios","web": "expo start --web"},"dependencies": {"@react-navigation/native": "^7.0.1","@react-navigation/stack": "^7.0.1","@reduxjs/toolkit": "^2.3.0","expo": "52.0.7","expo-dev-client": "~5.0.1","expo-status-bar": "~2.0.0","react": "18.3.1","react-native": "0.76.2","react-redux": "^9.1.2","expo-splash-screen": "0.29.10","@expo/vector-icons": "^14.0.2"},"devDependencies": {"@babel/core": "^7.20.0"},"private": true}

Fastlane Build Fails on Production in Expo 51 SDK, Fine in Development

$
0
0

I upgraded from SDK 49 to SDK 51 and I have been struggling to build on iOS production.I use a dev client, and that builds fine on iOS and Android. Android builds fine in production, but just iOS doesn't.

Been trying to find solutions everywhere.I've reset all my credentials. Removed examples of duplicate object keys etc... But, nothing is working.

I keep on getting this error:

Run script build phase '[CP-User] Generate updates resources for expo-updates' will be run during every build because it does not specify any outputs. To address this issue, either add output dependencies to the script phase, or configure it to run in every build by unchecking "Based on dependency analysis" in the script phase. (in target 'EXUpdates' from project 'Pods')    Run script build phase '[CP-User] Generate app.config for prebuilt Constants.manifest' will be run during every build because it does not specify any outputs. To address this issue, either add output dependencies to the script phase, or configure it to run in every build by unchecking "Based on dependency analysis" in the script phase. (in target 'EXConstants' from project 'Pods')    Run script build phase 'Create Symlinks to Header Folders' will be run during every build because it does not specify any outputs. To address this issue, either add output dependencies to the script phase, or configure it to run in every build by unchecking "Based on dependency analysis" in the script phase. (in target 'BoringSSL-GRPC' from project 'Pods')▸ ** ARCHIVE FAILED **▸ The following build commands failed:▸   Ld /Users/expo/Library/Developer/Xcode/DerivedData/Appname-Number/Build/Intermediates.noindex/ArchiveIntermediates/Appname/InstallationBuildProductsLocation/Applications/Appname.app/Appname normal (in target 'Appname' from project 'Appname')▸   Archiving workspace Appname with scheme Appname▸ (2 failures)** ARCHIVE FAILED **The following build commands failed:    Ld /Users/expo/Library/Developer/Xcode/DerivedData/Appname-Number/Build/Intermediates.noindex/ArchiveIntermediates/Appname/InstallationBuildProductsLocation/Applications/Appname.app/Appname normal (in target 'Appname' from project 'Appname')    Archiving workspace Appname with scheme Appname(2 failures)Exit status: 65​+---------------------------------------+|           Build environment           |+-------------+-------------------------+| xcode_path  | /Applications/Xcode.app || gym_version | 2.225.0                 || sdk         | iPhoneOS18.1.sdk        |+-------------+-------------------------+Looks like fastlane ran into a build/archive error with your project.It's hard to tell what's causing the error, so we wrote some guides on how to troubleshoot build and signing issues: https://docs.fastlane.tools/codesigning/getting-started/Before submitting an issue on GitHub, please follow the guide above and make sure your project is set up correctly.fastlane uses `xcodebuild` commands to generate your binary, you can see the the full commands printed out in yellow in the above log.Make sure to inspect the output above, as usually you'll find more error information there[!] Error building the application - see the log aboveError: The "Run fastlane" step failed with an unknown error. Refer to "Xcode Logs" below for additional, more detailed logs.​

Please can anyone give any suggestions?

Managed or bare?

Managed

Environment

expo-env-info 1.0.5 environment info:    System:      OS: macOS 14.5      Shell: 5.9 - /bin/zsh    Binaries:      Node: 18.16.1 - /usr/local/bin/node      Yarn: 1.22.19 - /usr/local/bin/yarn      npm: 9.5.1 - /usr/local/bin/npm    SDKs:      iOS SDK:        Platforms: DriverKit 24.1, iOS 18.1, macOS 15.1, tvOS 18.1, visionOS 2.1, watchOS 11.1    IDEs:      Android Studio: 2024.2 AI-242.23339.11.2421.12550806      Xcode: 16.1/16B40 - /usr/bin/xcodebuild    npmPackages:      @expo/metro-config: ^0.18.11 => 0.18.11       expo: ~51.0.39 => 51.0.39       react: 18.2.0 => 18.2.0       react-dom: 18.2.0 => 18.2.0       react-native: 0.74.5 => 0.74.5     npmGlobalPackages:      eas-cli: 13.2.3      expo-cli: 6.3.10    Expo Workflow: bare

✔ Check package.json for common issues✔ Validate global prerequisites versions✔ Validate Expo Config✔ Check compatible dependency versions for the installed Expo SDK✔ Check for conflicting global packages in project✔ Check for incompatible packages✔ Verify prebuild support package versions are compatible

Didn't find any issues with the project!

Reproducible demo or steps to reproduce from a blank project

run eas build --platform iosFrom my expo project with expo ~51.0.39

{"name": "appname","version": "1.0.0","main": "node_modules/expo/AppEntry.js","scripts": {"lint": "eslint .","start": "expo start","android": "expo start --android","ios": "expo start --ios","web": "expo start --web","eject": "expo eject","postinstall": "patch-package"  },"dependencies": {"@expo/config-plugins": "~8.0.0","@expo/metro-config": "^0.18.11","@gorhom/bottom-sheet": "^5.0.5","@likashefqet/react-native-image-zoom": "^2.2.0","@react-native-async-storage/async-storage": "1.23.1","@react-native-community/datetimepicker": "8.0.1","@react-native-firebase/analytics": "^21.4.0","@react-native-firebase/app": "^21.4.0","@react-native-firebase/auth": "^21.4.0","@react-native-firebase/firestore": "^21.4.0","@react-native-firebase/functions": "^21.4.0","@react-native-firebase/storage": "^21.4.0","@react-navigation/material-bottom-tabs": "^6.2.29","@react-navigation/native": "^6.1.18","@react-navigation/native-stack": "^6.11.0","@rneui/base": "^4.0.0-rc.7","@rneui/themed": "^4.0.0-rc.7","@sentry/react-native": "~5.24.3","@turf/turf": "^6.5.0","eslint-config-expo": "~7.1.2","expo": "~51.0.39","expo-application": "~5.9.1","expo-av": "~14.0.7","expo-build-properties": "~0.12.5","expo-camera": "~15.0.16","expo-checkbox": "~3.0.0","expo-constants": "~16.0.2","expo-crypto": "^13.0.2","expo-dev-client": "~4.0.29","expo-device": "~6.0.2","expo-file-system": "~17.0.1","expo-haptics": "~13.0.1","expo-image": "^1.13.0","expo-image-manipulator": "~12.0.5","expo-image-picker": "~15.0.7","expo-linking": "~6.3.1","expo-location": "~17.0.1","expo-mail-composer": "~13.0.1","expo-media-library": "~16.0.5","expo-network": "~6.0.1","expo-notifications": "~0.28.19","expo-splash-screen": "~0.27.7","expo-store-review": "~7.0.2","expo-task-manager": "~11.8.2","expo-tracking-transparency": "~4.0.2","expo-updates": "^0.25.27","moment": "^2.29.4","patch-package": "^6.5.0","react": "18.2.0","react-dom": "18.2.0","react-medium-image-zoom": "^5.1.8","react-native": "0.74.5","react-native-confetti-cannon": "^1.5.2","react-native-device-info": "^10.8.0","react-native-dropdown-picker": "^5.4.6","react-native-gesture-handler": "~2.16.1","react-native-google-mobile-ads": "^14.3.0","react-native-iap": "^12.11.0","react-native-image-modal": "^3.0.12","react-native-image-viewing": "^0.2.2","react-native-keyboard-aware-scroll-view": "^0.9.5","react-native-maps": "1.14.0","react-native-onboarding-swiper": "^1.3.0","react-native-paper": "^5.12.5","react-native-reanimated": "^3.10.1","react-native-reanimated-carousel": "^3.5.1","react-native-safe-area-context": "4.10.5","react-native-screens": "3.31.1","react-native-stars": "^1.2.2","react-native-vector-icons": "^10.2.0","react-native-webview": "13.8.6","react-native-zoomable-view": "^0.3.1","react-query": "^3.39.3","shorthash": "^0.0.2","styled-components": "^6.0.4","zustand": "^4.3.9"  },"devDependencies": {"@babel/core": "^7.24.0","@eslint/js": "^9.14.0","eslint": "^8.57.1","eslint-plugin-react": "^7.37.2","globals": "^15.12.0"  },"resolutions": {"@expo/config-plugins": "~8.0.0","@expo/prebuild-config": "~7.0.0","expo-modules-autolinking": "~1.11.0"  },"private": true,"dev": "APP_VARIANT=development expo start"}

Apple App Development - Code Signing Complexities

$
0
0

We are new to Apple iOS development. Our team comprise of few internal developers and few external contractors. We develop using React Native and using a basic Fastlane app for building the apps and pushing them to App Store Connect. At the moment some contractors have access to Appstore connect with 'development' role and all internal developers have access to it. All developers use 'Automatically manage signing' tick box in their Xcode.

When looking at best practices in running a team for app development, we found multiple articles using fastlane match to reduce the complexities in managing certificates and we are wondering whether they are still valid.

For example

recommends to use match to store development/distribution certificates/profiles in a git repo and share with the team. The main advantage that has been pointed out is the easy administration (and may be security).

eg:

You have to manually renew and download the latest set of provisioning profiles every time you add a new device or a certificate expires. Additionally this requires spending a lot of time when setting up a new machine that will build your app.

Unless there is a security concern, we do not see a big administration hassle so far with 'automatic signing'.

  1. Are the above concerns not relevant anymore in a world where people predominantly use 'automatic signing?
  2. Or have we missed something in our setup and doing it all wrong?
  3. Is it safe to have contractors added to developer account (App Store Connect) and let them access their own developer certificates
  4. If we share a git repo with contractors as suggested in Match, they will get access to the distribution certificates as well. Isn't it a security risk? Or should we only manage development certificates using Match

Personal Team is not enrolled in the Apple Developer Program

$
0
0

I am trying to upload the app to app store but getting this error on validating the app or distribution.

Team "Username (Personal Team)" is not enrolled in the Apple Developer Program. Distribution requires enrollment in the Apple Developer Program. Visit https://developer.apple.com/account to enroll.

I am new iOS development and app built with the react native framework and publishing the app using XCode 11.2.1. I am using a team member account as an app manager.

I find this Apple Developer link for the known issue but I don't understand the solution they are providing. Can any body explain it.



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