Saturday, April 13, 2024

Fix React Native atomic_notify_one is unavailable

Resolving React Native 'atomic_notify_one' Unavailability Issue in Xcode 12.5

React Native is a powerful framework for building cross-platform mobile applications, but like any technology, it's not without its challenges. One such challenge arises when working with Xcode 12.5, where an issue related to atomic_notify_one can disrupt the development process. In this article, we'll explore how to address this problem and keep your React Native projects running smoothly.

Issue Details:

The error stems from a discrepancy in the usage of atomic_notify_one within the DistributedMutex-inl.h file. Specifically, the absence of the folly:: namespace qualifier triggers errors during compilation.

Solution:

To resolve this issue, follow these steps:

  1. Update DistributedMutex-inl.h:
    Navigate to {project-name}/ios/Pods/Flipper-Folly/folly/synchronization/DistributedMutex-inl.h. Locate the instances of atomic_notify_one and prepend folly:: to the function call. For example:
    atomic_notify_one(state); // Change to
    folly::atomic_notify_one(state);
        
  2. Update RCTCxxBridge.mm and RCTTurboModuleManager.mm:
    After making the changes in DistributedMutex-inl.h, errors may surface in RCTCxxBridge.mm and RCTTurboModuleManager.mm files. To address these:
    • RCTCxxBridge.mm (line 770): Modify the parameter type from:
      (NSArray<id<RCTBridgeModule>> *)modules
      to:
      (NSArray<Class> *)modules
    • RCTTurboModuleManager.mm (line 300): Adjust the line from:
      RCTBridgeModuleNameForClass(module))
      to:
      RCTBridgeModuleNameForClass(Class(module)));

Conclusion:

By implementing the above changes, you can successfully overcome the 'atomic_notify_one' unavailability issue encountered in React Native projects running on Xcode 12.5. These adjustments ensure compatibility with the latest Xcode version, enabling you to continue development with confidence and efficiency.

Remember to regularly check for updates and patches from the React Native community, as staying informed about potential issues and their solutions is crucial for maintaining a smooth development workflow.

Stay proactive, stay coding!

Wednesday, April 3, 2024

React Native run ios specific device commands

These are the available devices for iOS 14.0

    npx react-native run-ios --simulator="iPhone 8"
    npx react-native run-ios --simulator="iPhone 8 Plus"
    npx react-native run-ios --simulator="iPhone 11"
    npx react-native run-ios --simulator="iPhone 11 Pro"
    npx react-native run-ios --simulator="iPhone 11 Pro Max"
    npx react-native run-ios --simulator="iPhone SE (2nd generation)"
    npx react-native run-ios --simulator="iPhone 12 mini"
    npx react-native run-ios --simulator="iPhone 12"
    npx react-native run-ios --simulator="iPhone 12 Pro"
    npx react-native run-ios --simulator="iPhone 12 Pro Max"
    npx react-native run-ios --simulator="iPod touch (7th generation)"
    npx react-native run-ios --simulator="iPad Pro (9.7-inch)"
    npx react-native run-ios --simulator="iPad Pro (11-inch) (2nd generation)"
    npx react-native run-ios --simulator="iPad Pro (12.9-inch) (4th generation)"
    npx react-native run-ios --simulator="iPad (8th generation)"
    npx react-native run-ios --simulator="iPad Air (4th generation)"



List all available iOS devices:
    xcrun simctl list devices



Saturday, July 16, 2022

how to show datepicker in input focus or entire area click

 Your input should be position:relative> and the input DATE type :


input[type="date"]::-webkit-calendar-picker-indicator {
background: transparent;
bottom: 0;
color: transparent;
cursor: pointer;
height: auto;
left: 0;
position: absolute;
right: 0;
top: 0;
width: auto;
}

Wednesday, July 21, 2021

Flutter pod install error

This happens when we change the plugins versions or flutter pub package.

I was getting a similar error, so I used many different things but still nothing happened but finally I got an exact solution For the solution follow the below steps

  1. Delete the podfile.lock file from the ios folder.
  2. Open the terminal, go to the ios folder directory and run pod install. It could take some time to install. If pod install gives any error then try this  pod install --repo-update
  3. After everything is done run your project again flutter run

Sunday, September 13, 2020

how to fix Please enter a commit message to explain why this merge is necessary, especially if it merges an updated upstream into a topic branch

Please enter a commit message to explain why this merge is necessary, especially if it merges an updated upstream into a topic branch

New git users scared about this message 😳, don't worry, actually it's not a Git error message, it's the editor as git uses your default editor.





To solve this:

  1. Press "i" (i for insert)
  2. write your merge message
  3. Press "ESC" (escape)
  4. write ":wq" (write & quit)
  5. then press enter

Sunday, July 26, 2020

Flutter Provider simple counter example




Sunday, October 6, 2019

jquery filter element by menu

Filter elements by jquery, here i used data attribute for filter elements and used bootstrap4 for grid.
menu items like this :

<a class="nav-link" data-filter="Events">Events</a>
<div class="col-12 col-sm-6 col-md-4 filtr-item" data-category="Media,News">
            <img src="https://via.placeholder.com/150?text=1" class="img-fluid" alt="sample">
        </div>

and the thumnail item data like this:

Saturday, October 5, 2019

bootstrap 4 material checkbox and radio button




Saturday, July 20, 2019

How to create a awesome Flutter material login screen



Awesome Flutter material login screen sample code:


Saturday, February 2, 2019

You don't have permission to access, Server unable to read htaccess file, denying access to be safe - Fix Godaddy

Error : You don't have permission to access, Server unable to read htaccess file, denying access to be safe.

Solution: chmod -R 755 <site_top_folder>

Tuesday, July 17, 2018

CircleTransform for Picasso


Friday, July 6, 2018

PHRETS create mysql tables for torontomls.net

using phrets to create mysql tables from rets for torontomls.net


Wednesday, June 27, 2018

PHRETS sample code for torontomls





Results Like: