简体   繁体   English

在React Native中获取``PhotoEditorSDK / PhotoEditorSDK.h''文件未找到错误

[英]Getting 'PhotoEditorSDK/PhotoEditorSDK.h' file not found' error in react native

I'm trying to install this -- PhotoEditorSDK , I followed the documentation exactly but keep getting 'PhotoEditorSDK/PhotoEditorSDK.h' file not found error that causes build to be failed. 我正在尝试安装文件PhotoEditorSDK ,我完全按照文档进行操作,但'PhotoEditorSDK/PhotoEditorSDK.h' file not found错误,导致构建失败。 Just to be clear, this is exactly how I tried to install this framework: 需要明确的是,这正是我尝试安装此框架的方式:

(1) Inside my ios folder, I run command pod init (1)在ios文件夹中,运行命令pod init

(2) I edit my Podfile like so: (2)我像这样编辑Podfile

  platform :ios, '9.0'

  target 'nearbie' do
      pod 'PhotoEditorSDK'
  end

(3) Run pod install command (3)运行pod install命令

(4) This is what my .xcworkspace looks like after step (3), and I also created PESDKModule.h & PESDKModule.m files as well as draged ios_license license file there, as circled in the picture: (4)这是步骤(3)之后我的.xcworkspace样子,并且我还创建了PESDKModule.hPESDKModule.m文件,以及在那里ios_license许可证文件,如图所示:

在此处输入图片说明

(5) The content of PESDKModule.h & PESDKModule.m are copied from demo app's .xcworkspace file like this: (5)从演示应用程序的.xcworkspace文件复制PESDKModule.hPESDKModule.m的内容,如下所示:

PESDKModule.h: PESDKModule.h:

#import <React/RCTBridgeModule.h>
#import <React/RCTEventEmitter.h>

@interface PESDKModule : RCTEventEmitter <RCTBridgeModule>

@end

PESDKModule.m: PESDKModule.m:

#import "PESDKModule.h"
#import <React/RCTUtils.h>
#import <PhotoEditorSDK/PhotoEditorSDK.h>

@interface PESDKModule () <PESDKPhotoEditViewControllerDelegate>
@end

@implementation PESDKModule

RCT_EXPORT_MODULE(PESDK);

RCT_EXPORT_METHOD(present:(NSString *)path) {
    PESDKPhotoEditViewController *photoEditViewController =
 [[PESDKPhotoEditViewController alloc] initWithData:[NSData dataWithContentsOfFile:path] configuration:[[PESDKConfiguration alloc] init]];
  photoEditViewController.delegate = self;
  UIViewController *currentViewController = RCTPresentedViewController();

  dispatch_async(dispatch_get_main_queue(), ^{
[currentViewController presentViewController:photoEditViewController animated:YES completion:NULL];
  });
}

#pragma mark - IMGLYPhotoEditViewControllerDelegate

- (void)photoEditViewController:(PESDKPhotoEditViewController *)photoEditViewController didSaveImage:(UIImage *)image imageAsData:(NSData *)data {
  [photoEditViewController.presentingViewController dismissViewControllerAnimated:YES completion:^{
    [self sendEventWithName:@"PhotoEditorDidSave" body:@{ @"image": [UIImageJPEGRepresentation(image, 1.0) base64EncodedStringWithOptions: 0], @"data": [data base64EncodedStringWithOptions:0] }];
  }];
}

- (void)photoEditViewControllerDidCancel:(PESDKPhotoEditViewController *)photoEditViewController {
  [photoEditViewController.presentingViewController dismissViewControllerAnimated:YES completion:^{
[self sendEventWithName:@"PhotoEditorDidCancel" body:@{}];
  }];
}

- (void)photoEditViewControllerDidFailToGeneratePhoto:(PESDKPhotoEditViewController *)photoEditViewController {
  [self sendEventWithName:@"PhotoEditorDidFailToGeneratePhoto" body:@{}];
}

#pragma mark - RCTEventEmitter

- (NSArray<NSString *> *)supportedEvents {
  return @[ @"PhotoEditorDidSave", @"PhotoEditorDidCancel", @"PhotoEditorDidFailToGeneratePhoto" ];
}

@end

But when I try to build the project, I get error like this (located inside PESDKModule.m file): 但是,当我尝试构建项目时,出现如下错误(位于PESDKModule.m文件中):

在此处输入图片说明

I'm not sure about the use of Cocoapods within React Native. 我不确定在React Native中使用Cocoapods。 Our demo used the manual installation steps, described in our docs . 我们的演示使用了docs中描述的手动安装步骤。 Could you try linking the PhotoEditor SDK using these steps instead of Cocoapods? 您可以尝试使用以下步骤而不是Cocoapods链接PhotoEditor SDK吗?

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 React-Native:构建错误找不到GeneratedInfoPlistDotEnv.h文件 - React-Native: Build error GeneratedInfoPlistDotEnv.h file not found IOS 上的 React Native 上找不到 RCTConvert+AirMap.h 文件错误 - RCTConvert+AirMap.h file not found Error on React Native on IOS 带PhotoEditorSDK的图像构建框架 - Building Frames for Images w/ PhotoEditorSDK React Native ios 构建错误 'React/RCTBridgeModule.h' 文件未找到 react-native-document-picker - React Native ios build error 'React/RCTBridgeModule.h' file not found with react-native-document-picker 未找到 React Native ios 构建错误“React/RCTBridgeModule.h”文件 - React Native ios build error 'React/RCTBridgeModule.h' file not found React Native - BVLinearGradient - 找不到“React/RCTViewManager.h”文件 - React Native - BVLinearGradient - 'React/RCTViewManager.h' file not found 'React/RCTBridgeDelegate.h' 文件未找到 - React Native - 'React/RCTBridgeDelegate.h' file not found - React Native 在 React Native 中找不到“react/bridging/CallbackWrapper.h”文件 - 'react/bridging/CallbackWrapper.h' file not found in React Native PhotoEditorSDK:从服务器添加自定义叠加 - PhotoEditorSDK: Add custom overlays from server 找不到iOS版本中的React Native Maps集成构建错误&#39;RCTPackagerClient.h&#39;文件 - React Native Maps integration in iOS build error 'RCTPackagerClient.h' file not found
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM