There are build errors generating in my RNGestureHandler.h file under ExpoKit. Unknown type name 'RNGestureHandlerState'. This issue occurred after I detached expo from the project.
I tried fixes I saw such changing the #import <XXX.h> to import "XXX.h" but the errors still remain .
#import <RNGestureHandlerState.h>
#import <RNGestureHandlerDirection.h>
#import <RNGestureHandlerEvents.h>
#import <Foundation/Foundation.h>
#import <UIKit/UIKit.h>
#import <React/RCTConvert.h>
#define VEC_LEN_SQ(pt) (pt.x * pt.x + pt.y * pt.y)
#define TEST_MIN_IF_NOT_NAN(value, limit) \
(!isnan(limit) && ((limit < 0 && value <= limit) || (limit >= 0 && value >= limit)))
#define TEST_MAX_IF_NOT_NAN(value, max) \
(!isnan(max) && ((max < 0 && value < max) || (max >= 0 && value > max)))
#define APPLY_PROP(recognizer, config, type, prop, propName) do { \
id value = config[propName]; \
if (value != nil) recognizer.prop = [RCTConvert type:value]; \
} while(0)
#define APPLY_FLOAT_PROP(prop) do { APPLY_PROP(recognizer, config, CGFloat, prop, @#prop); } while(0)
#define APPLY_INT_PROP(prop) do { APPLY_PROP(recognizer, config, NSInteger, prop, @#prop); } while(0)
#define APPLY_NAMED_INT_PROP(prop, propName) do { APPLY_PROP(recognizer, config, NSInteger, prop, propName); } while(0)
@protocol RNGestureHandlerEventEmitter
- (void)sendTouchEvent:(nonnull RNGestureHandlerEvent *)event;
- (void)sendStateChangeEvent:(nonnull RNGestureHandlerStateChange *)event;
@end
@protocol RNRootViewGestureRecognizerDelegate <UIGestureRecognizerDelegate>
- (void)gestureRecognizer:(nullable UIGestureRecognizer *)gestureRecognizer
didActivateInRootView:(nullable UIView *)rootView;
@end
@interface RNGestureHandler : NSObject <UIGestureRecognizerDelegate> {
@protected UIGestureRecognizer *_recognizer;
@protected RNGestureHandlerState _lastState; //Error in this line: Unknown type name 'RNGestureHandlerState'
}
+ (nullable RNGestureHandler *)findGestureHandlerByRecognizer:(nonnull UIGestureRecognizer *)recognizer;
- (nonnull instancetype)initWithTag:(nonnull NSNumber *)tag;
@property (nonatomic, readonly, nonnull) NSNumber *tag;
@property (nonatomic, weak, nullable) id<RNGestureHandlerEventEmitter> emitter;
@property (nonatomic, readonly, nullable) UIGestureRecognizer *recognizer;
@property (nonatomic) BOOL enabled;
@property(nonatomic) BOOL shouldCancelWhenOutside;
- (void)bindToView:(nonnull UIView *)view;
- (void)unbindFromView;
- (void)configure:(nullable NSDictionary *)config NS_REQUIRES_SUPER;
- (void)handleGesture:(nonnull id)recognizer;
- (BOOL)containsPointInView;
- (RNGestureHandlerState)state; //Error in this line: Expected a type
- (nullable RNGestureHandlerEventExtraData *)eventExtraData:(nonnull id)recognizer;
- (void)reset;
- (void)sendEventsInState:(RNGestureHandlerState)state //Error in this line: Expected a type
forViewWithTag:(nonnull NSNumber *)reactTag
withExtraData:(RNGestureHandlerEventExtraData *)extraData;
@end
I don't know if you fixed this but I had the same issue and I fixed it by updating all my modules using
yarn upgrade
I then tried to reinstall pods but was told my version of cocoapods was outdated and to use the following to update it:
sudo gem install cocoapods --pre
I could then install pods as required with
pod install
In xcode I then cleaned my build dir and did a fresh build and run and my app fired up fine again.