인프런 커뮤니티 질문&답변

위펀님의 프로필 이미지
위펀

작성한 질문수

배달앱 클론코딩 [with React Native]

patch-package 수행하기

[ios] react-native-crop-picker moviePath build error 문의

작성

·

446

0

moviePath를 찾지 못하는 에러를 발생합니다..

버전이 달라서 생긴 문제일까요..

  • 버전

xcode: Version 14.1 (14B47b)

"react-native-image-crop-picker": "^0.38.1",

  • 코딩

- (void)imagePickerController:(UIImagePickerController *)picker didFinishPickingMediaWithInfo:(NSDictionary *)info {
    NSString* mediaType = [info objectForKey:UIImagePickerControllerMediaType];

    if (CFStringCompare ((__bridge CFStringRef) mediaType, kUTTypeMovie, 0) == kCFCompareEqualTo) {
        NSURL *url = [info objectForKey:UIImagePickerControllerMediaURL];
        AVURLAsset *asset = [AVURLAsset assetWithURL:url];
        NSString *moviePath = [url path];
        NSString *fileName = [[asset.URL path] lastPathComponent];

        if ([[self.options objectForKey:@"saveToPhotos"] boolValue]) {
            if (UIVideoAtPathIsCompatibleWithSavedPhotosAlbum(moviePath)) {
                UISaveVideoAtPathToSavedPhotosAlbum(moviePath, nil, nil, nil);
            }
        }

        [self handleVideo:asset
             withFileName:fileName
      withLocalIdentifier:nil
               completion:^(NSDictionary* video) {
            dispatch_async(dispatch_get_main_queue(), ^{
                if (video == nil) {
                    [picker dismissViewControllerAnimated:YES completion:[self waitAnimationEnd:^{
                        self.reject(ERROR_CANNOT_PROCESS_VIDEO_KEY, ERROR_CANNOT_PROCESS_VIDEO_MSG, nil);
                    }]];
                    return;
                }

                [picker dismissViewControllerAnimated:YES completion:[self waitAnimationEnd:^{
                    self.resolve(video);
                }]];
            });
        }
         ];
    } else {
//        UIImage *chosenImage = [info objectForKey:UIImagePickerControllerOriginalImage];
//        NSURL *url = [info objectForKey:UIImagePickerControllerMediaURL];
//        AVURLAsset *asset = [AVURLAsset assetWithURL:url];
//        NSString *moviePath = [url path];
        
        NSDictionary *exif;
        if([[self.options objectForKey:@"includeExif"] boolValue]) {
            exif = [info objectForKey:UIImagePickerControllerMediaMetadata];
        }

        if ([[self.options objectForKey:@"saveToPhotos"] boolValue]) {
            // TODO: 문제 사항
            UIImageWriteToSavedPhotosAlbum(moviePath, nil, nil, nil);
        }
        
        [self processSingleImagePick:chosenImage withExif:exif withViewController:picker withSourceURL:self.croppingFile[@"sourceURL"] withLocalIdentifier:self.croppingFile[@"localIdentifier"] withFilename:self.croppingFile[@"filename"] withCreationDate:self.croppingFile[@"creationDate"] withModificationDate:self.croppingFile[@"modificationDate"]];
    }
}
  • 에러 내용

info Building (using "xcodebuild -workspace FoodDeliveryApp.xcworkspace -configuration Debug -scheme FoodDeliveryApp -destination id=66BF5043-E45F-46DA-9B84-EBDB63EA58BF")
error Failed to build iOS project. We ran "xcodebuild" command but it exited with error code 65. To debug build logs further, consider building your app with Xcode.app, by opening FoodDeliveryApp.xcworkspace.
    Command line invocation:
    /Applications/Xcode.app/Contents/Developer/usr/bin/xcodebuild -workspace FoodDeliveryApp.xcworkspace -configuration Debug -scheme FoodDeliveryApp -destination id=66BF5043-E45F-46DA-9B84-EBDB63EA58BF

User defaults from command line:
    IDEPackageSupportUseBuiltinSCM = YES

Prepare packages

Computing target dependency graph and provisioning inputs

Create build description
Build description signature: 0c8000121eeafd63a74888e775bdfe5a
Build description path: /Library/Developer/Xcode/DerivedData/FoodDeliveryApp-bvdueivcuebfnfaveqcmcylricfm/Build/Intermediates.noindex/XCBuildData/0c8000121eeafd63a74888e775bdfe5a-desc.xcbuild

note: Building targets in dependency order
CompileC /Library/Developer/Xcode/DerivedData/FoodDeliveryApp-bvdueivcuebfnfaveqcmcylricfm/Build/Intermediates.noindex/Pods.build/Debug-iphonesimulator/RNImageCropPicker.build/Objects-normal/x86_64/ImageCropPicker.o /IdeaProjects/food-delivery-app/FoodDeliveryApp/node_modules/react-native-image-crop-picker/ios/src/ImageCropPicker.m normal x86_64 objective-c com.apple.compilers.llvm.clang.1_0.compiler (in target 'RNImageCropPicker' from project 'Pods')
cd /IdeaProjects/food-delivery-app/FoodDeliveryApp/ios/Pods
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang -x objective-c -target x86_64-apple-ios11.0-simulator -fmessage-length\=0 -fdiagnostics-show-note-include-stack -fmacro-backtrace-limit\=0 -std\=gnu11 -fobjc-arc -fobjc-weak -fmodules -fmodules-cache-path\=/Library/Developer/Xcode/DerivedData/ModuleCache.noindex -fmodules-prune-interval\=86400 -fmodules-prune-after\=345600 -fbuild-session-file\=/Library/Developer/Xcode/DerivedData/ModuleCache.noindex/Session.modulevalidation -fmodules-validate-once-per-build-session -Wnon-modular-include-in-framework-module -Werror\=non-modular-include-in-framework-module -Wno-trigraphs -fpascal-strings -O0 -fno-common -Wno-missing-field-initializers -Wno-missing-prototypes -Werror\=return-type -Wdocumentation -Wunreachable-code -Wno-implicit-atomic-properties -Werror\=deprecated-objc-isa-usage -Wno-objc-interface-ivars -Werror\=objc-root-class -Wno-arc-repeated-use-of-weak -Wimplicit-retain-self -Wduplicate-method-match -Wno-missing-braces -Wparentheses -Wswitch -Wunused-function -Wno-unused-label -Wno-unused-parameter -Wunused-variable -Wunused-value -Wempty-body -Wuninitialized -Wconditional-uninitialized -Wno-unknown-pragmas -Wno-shadow -Wno-four-char-constants -Wno-conversion -Wconstant-conversion -Wint-conversion -Wbool-conversion -Wenum-conversion -Wno-float-conversion -Wnon-literal-null-conversion -Wobjc-literal-conversion -Wshorten-64-to-32 -Wpointer-sign -Wno-newline-eof -Wno-selector -Wno-strict-selector-match -Wundeclared-selector -Wdeprecated-implementations -Wno-implicit-fallthrough -DPOD_CONFIGURATION_DEBUG\=1 -DDEBUG\=1 -DCOCOAPODS\=1 -DOBJC_OLD_DISPATCH_PROTOTYPES\=0 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator16.1.sdk -fasm-blocks -fstrict-aliasing -Wprotocol -Wdeprecated-declarations -g -Wno-sign-conversion -Winfinite-recursion -Wcomma -Wblock-capture-autoreleasing -Wstrict-prototypes -Wno-semicolon-before-method-body -Wunguarded-availability -fobjc-abi-version\=2 -fobjc-legacy-dispatch -index-store-path /Library/Developer/Xcode/DerivedData/FoodDeliveryApp-bvdueivcuebfnfaveqcmcylricfm/Index.noindex/DataStore -iquote /Library/Developer/Xcode/DerivedData/FoodDeliveryApp-bvdueivcuebfnfaveqcmcylricfm/Build/Intermediates.noindex/Pods.build/Debug-iphonesimulator/RNImageCropPicker.build/RNImageCropPicker-generated-files.hmap -I/Library/Developer/Xcode/DerivedData/FoodDeliveryApp-bvdueivcuebfnfaveqcmcylricfm/Build/Intermediates.noindex/Pods.build/Debug-iphonesimulator/RNImageCropPicker.build/RNImageCropPicker-own-target-headers.hmap -I/Library/Developer/Xcode/DerivedData/FoodDeliveryApp-bvdueivcuebfnfaveqcmcylricfm/Build/Intermediates.noindex/Pods.build/Debug-iphonesimulator/RNImageCropPicker.build/RNImageCropPicker-all-non-framework-target-headers.hmap -ivfsoverlay /Library/Developer/Xcode/DerivedData/FoodDeliveryApp-bvdueivcuebfnfaveqcmcylricfm/Build/Intermediates.noindex/Pods.build/Debug-iphonesimulator/RNImageCropPicker.build/all-product-headers.yaml -iquote /Library/Developer/Xcode/DerivedData/FoodDeliveryApp-bvdueivcuebfnfaveqcmcylricfm/Build/Intermediates.noindex/Pods.build/Debug-iphonesimulator/RNImageCropPicker.build/RNImageCropPicker-project-headers.hmap -I/Library/Developer/Xcode/DerivedData/FoodDeliveryApp-bvdueivcuebfnfaveqcmcylricfm/Build/Products/Debug-iphonesimulator/RNImageCropPicker/include -I/IdeaProjects/food-delivery-app/FoodDeliveryApp/ios/Pods/Headers/Private -I/IdeaProjects/food-delivery-app/FoodDeliveryApp/ios/Pods/Headers/Private/RNImageCropPicker -I/IdeaProjects/food-delivery-app/FoodDeliveryApp/ios/Pods/Headers/Public -I/IdeaProjects/food-delivery-app/FoodDeliveryApp/ios/Pods/Headers/Public/DoubleConversion -I/IdeaProjects/food-delivery-app/FoodDeliveryApp/ios/Pods/Headers/Public/FBLazyVector -I/IdeaProjects/food-delivery-app/FoodDeliveryApp/ios/Pods/Headers/Public/RCT-Folly -I/IdeaProjects/food-delivery-app/FoodDeliveryApp/ios/Pods/Headers/Public/RCTRequired -I/IdeaProjects/food-delivery-app/FoodDeliveryApp/ios/Pods/Headers/Public/RCTTypeSafety -I/IdeaProjects/food-delivery-app/FoodDeliveryApp/ios/Pods/Headers/Public/RNImageCropPicker -I/IdeaProjects/food-delivery-app/FoodDeliveryApp/ios/Pods/Headers/Public/React-Codegen -I/IdeaProjects/food-delivery-app/FoodDeliveryApp/ios/Pods/Headers/Public/React-Core -I/IdeaProjects/food-delivery-app/FoodDeliveryApp/ios/Pods/Headers/Public/React-bridging -I/IdeaProjects/food-delivery-app/FoodDeliveryApp/ios/Pods/Headers/Public/React-callinvoker -I/IdeaProjects/food-delivery-app/FoodDeliveryApp/ios/Pods/Headers/Public/React-cxxreact -I/IdeaProjects/food-delivery-app/FoodDeliveryApp/ios/Pods/Headers/Public/React-jsi -I/IdeaProjects/food-delivery-app/FoodDeliveryApp/ios/Pods/Headers/Public/React-jsiexecutor -I/IdeaProjects/food-delivery-app/FoodDeliveryApp/ios/Pods/Headers/Public/React-jsinspector -I/IdeaProjects/food-delivery-app/FoodDeliveryApp/ios/Pods/Headers/Public/React-logger -I/IdeaProjects/food-delivery-app/FoodDeliveryApp/ios/Pods/Headers/Public/React-perflogger -I/IdeaProjects/food-delivery-app/FoodDeliveryApp/ios/Pods/Headers/Public/React-runtimeexecutor -I/IdeaProjects/food-delivery-app/FoodDeliveryApp/ios/Pods/Headers/Public/ReactCommon -I/IdeaProjects/food-delivery-app/FoodDeliveryApp/ios/Pods/Headers/Public/TOCropViewController -I/IdeaProjects/food-delivery-app/FoodDeliveryApp/ios/Pods/Headers/Public/Yoga -I/IdeaProjects/food-delivery-app/FoodDeliveryApp/ios/Pods/Headers/Public/fmt -I/IdeaProjects/food-delivery-app/FoodDeliveryApp/ios/Pods/Headers/Public/glog -I/IdeaProjects/food-delivery-app/FoodDeliveryApp/ios/Pods/Headers/Public/libevent -I/IdeaProjects/food-delivery-app/FoodDeliveryApp/ios/Pods/Headers/Private/React-bridging/react/bridging -I/Library/Developer/Xcode/DerivedData/FoodDeliveryApp-bvdueivcuebfnfaveqcmcylricfm/Build/Products/Debug-iphonesimulator/React-bridging/react_bridging.framework/Headers -I/Library/Developer/Xcode/DerivedData/FoodDeliveryApp-bvdueivcuebfnfaveqcmcylricfm/Build/Intermediates.noindex/Pods.build/Debug-iphonesimulator/RNImageCropPicker.build/DerivedSources-normal/x86_64 -I/Library/Developer/Xcode/DerivedData/FoodDeliveryApp-bvdueivcuebfnfaveqcmcylricfm/Build/Intermediates.noindex/Pods.build/Debug-iphonesimulator/RNImageCropPicker.build/DerivedSources/x86_64 -I/Library/Developer/Xcode/DerivedData/FoodDeliveryApp-bvdueivcuebfnfaveqcmcylricfm/Build/Intermediates.noindex/Pods.build/Debug-iphonesimulator/RNImageCropPicker.build/DerivedSources -F/Library/Developer/Xcode/DerivedData/FoodDeliveryApp-bvdueivcuebfnfaveqcmcylricfm/Build/Products/Debug-iphonesimulator/RNImageCropPicker -fmodule-map-file\=/IdeaProjects/food-delivery-app/FoodDeliveryApp/ios/Pods/Headers/Public/RCTTypeSafety/RCTTypeSafety.modulemap -fmodule-map-file\=/IdeaProjects/food-delivery-app/FoodDeliveryApp/ios/Pods/Headers/Public/React/React-Core.modulemap -fmodule-map-file\=/IdeaProjects/food-delivery-app/FoodDeliveryApp/ios/Pods/Headers/Public/ReactCommon/ReactCommon.modulemap -fmodule-map-file\=/IdeaProjects/food-delivery-app/FoodDeliveryApp/ios/Pods/Headers/Public/React_Codegen/React-Codegen.modulemap -fmodule-map-file\=/IdeaProjects/food-delivery-app/FoodDeliveryApp/ios/Pods/Headers/Public/folly/RCT-Folly.modulemap -fmodule-map-file\=/IdeaProjects/food-delivery-app/FoodDeliveryApp/ios/Pods/Headers/Public/yoga/Yoga.modulemap -include /IdeaProjects/food-delivery-app/FoodDeliveryApp/ios/Pods/Target\ Support\ Files/RNImageCropPicker/RNImageCropPicker-prefix.pch -MMD -MT dependencies -MF /Library/Developer/Xcode/DerivedData/FoodDeliveryApp-bvdueivcuebfnfaveqcmcylricfm/Build/Intermediates.noindex/Pods.build/Debug-iphonesimulator/RNImageCropPicker.build/Objects-normal/x86_64/ImageCropPicker.d --serialize-diagnostics /Library/Developer/Xcode/DerivedData/FoodDeliveryApp-bvdueivcuebfnfaveqcmcylricfm/Build/Intermediates.noindex/Pods.build/Debug-iphonesimulator/RNImageCropPicker.build/Objects-normal/x86_64/ImageCropPicker.dia -c /IdeaProjects/food-delivery-app/FoodDeliveryApp/node_modules/react-native-image-crop-picker/ios/src/ImageCropPicker.m -o /Library/Developer/Xcode/DerivedData/FoodDeliveryApp-bvdueivcuebfnfaveqcmcylricfm/Build/Intermediates.noindex/Pods.build/Debug-iphonesimulator/RNImageCropPicker.build/Objects-normal/x86_64/ImageCropPicker.o -index-unit-output-path /Pods.build/Debug-iphonesimulator/RNImageCropPicker.build/Objects-normal/x86_64/ImageCropPicker.o
/IdeaProjects/food-delivery-app/FoodDeliveryApp/node_modules/react-native-image-crop-picker/ios/src/ImageCropPicker.m:243:44: error: use of undeclared identifier 'moviePath'
UIImageWriteToSavedPhotosAlbum(moviePath, nil, nil, nil);
^
/IdeaProjects/food-delivery-app/FoodDeliveryApp/node_modules/react-native-image-crop-picker/ios/src/ImageCropPicker.m:246:38: error: use of undeclared identifier 'chosenImage'
    [self processSingleImagePick:chosenImage withExif:exif withViewController:picker withSourceURL:self.croppingFile[@"sourceURL"] withLocalIdentifier:self.croppingFile[@"localIdentifier"] withFilename:self.croppingFile[@"filename"] withCreationDate:self.croppingFile[@"creationDate"] withModificationDate:self.croppingFile[@"modificationDate"]];
^
2 errors generated.

    warning: Run script build phase 'Bundle React Native code and images' will be run during every build because it does not specify any outputs. To address this warning, 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 'FoodDeliveryApp' from project 'FoodDeliveryApp')
warning: Run script build phase 'Start Packager' will be run during every build because it does not specify any outputs. To address this warning, 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 'FoodDeliveryApp' from project 'FoodDeliveryApp')

** BUILD FAILED **


The following build commands failed:
    CompileC /Library/Developer/Xcode/DerivedData/FoodDeliveryApp-bvdueivcuebfnfaveqcmcylricfm/Build/Intermediates.noindex/Pods.build/Debug-iphonesimulator/RNImageCropPicker.build/Objects-normal/x86_64/ImageCropPicker.o /IdeaProjects/food-delivery-app/FoodDeliveryApp/node_modules/react-native-image-crop-picker/ios/src/ImageCropPicker.m normal x86_64 objective-c com.apple.compilers.llvm.clang.1_0.compiler (in target 'RNImageCropPicker' from project 'Pods')
(1 failure)

 

답변 1

0

제로초(조현영)님의 프로필 이미지
제로초(조현영)
지식공유자

주석처리한 부분 때문인데요. 왜 주석처리하셨나요??

위펀님의 프로필 이미지
위펀
질문자

주석 처리는 오류가 나서 제가 임의로 넣은 부분이고 원본 소스에는 없는 내용입니다!
patches 내용을 봐도 따로 없던거 같은데, 주석 부분이 있는게 맞다는 말씀이실까요?

제로초(조현영)님의 프로필 이미지
제로초(조현영)
지식공유자

네 코드상 있어야할 것 같습니다.

위펀님의 프로필 이미지
위펀
질문자

넵! 확인 감사합니다!

위펀님의 프로필 이미지
위펀

작성한 질문수

질문하기