5

After adding this pod to my react-native project (RN 0.42) the shaking gesture doesn't work anymore on iOS. I can't debug my code besides building it in xcode which is very annoying. It really slows down development so it would be appreciated if someone has a solution.

source 'https://github.com/CocoaPods/Specs.git'

platform :ios, '8.0'
use_frameworks!

def available_pods
    project ‘rrnf’, 'Debug' => :debug

    react_path = '../node_modules/react-native'
    yoga_path = File.join(react_path, 'ReactCommon/yoga')


    pod 'React', path: react_path, :subspecs => [
    'Core',
    'RCTActionSheet',
    'RCTGeolocation',
    'RCTImage',
    'RCTLinkingIOS',
    'RCTNetwork',
    'RCTSettings',
    'RCTText',
    'RCTVibration',
    'RCTWebSocket',
    ]
    pod 'Yoga', :path => yoga_path

    [
    'Firebase',
    'Firebase/Core',
    'Firebase/Auth',
    'Firebase/Storage',
    'Firebase/Database',
    'Firebase/RemoteConfig',
    'Firebase/Messaging'
    ].each do |lib|
        pod lib
    end

    pod 'react-native-camera', path: '../node_modules/react-native-camera'

end

target 'rrnf' do
    available_pods
end

target 'rrnfTests' do
    available_pods
end
2
  • 1
    are you still in debug mode and not compiling it as release version? Mar 21, 2017 at 20:28
  • Yes it is in debug mode. When the app crashes I get the red screens where I can reload. However I cannot access the prompt with debug options
    – Jab
    Mar 21, 2017 at 20:39

2 Answers 2

4

I know this is an old question, but I could not find a solution anywhere.

And I got temporary solution for this.

  1. Find RCTDefines.h in your React Pod directory

(Pods > Development Pods > React > Core > Base > RCTDefines.h)

enter image description here

  1. Find #define RCT_DEV

You can find this explanation.

The RCT_DEV macro can be used to enable or disable development tools such as the debug executors, dev menu, red box, etc.

So, turn on RCT_DEV flag to 1.

#define RCT_DEV 1

Also, this flag is used for DevSupport. So, you need to turn on these two flag.

#define RCT_ENABLE_INSPECTOR 1

#define ENABLE_PACKAGER_CONNECTION 1

Final code looks like this.

final

0
3

This awnser solved my problem How do i use the iOS shake gesture with react native?

Adding RCT_DEV=0 to the preprocessor macros did fix the shaking gesture.

You can either change the value [of RCT_DEV] in RCTDefines.h, or in the build settings for the React lib project, search for "Preprocessor Macros" and add RCT_DEV=0 to the section where DEBUG=1 is currently defined.

Your Answer

Reminder: Answers generated by Artificial Intelligence tools are not allowed on Stack Overflow. Learn more

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.