RobertSasak / react-native-openalpr

An open-source React Native automatic license plate recognition package for OpenALPR
https://medium.freecodecamp.com/license-plate-recognition-in-react-native-b4f790d3a160#.jngb9oclt
MIT License
497 stars 167 forks source link

Error when running run-ios #99

Closed arinconc closed 3 years ago

arinconc commented 4 years ago

Hello guys! I just installed this component in a new application and when running run-ios I have this error:

The iOS Simulator deployment target 'IPHONEOS_DEPLOYMENT_TARGET' is set to 6.0, but the range of supported deployment target versions is 9.0 to 14.0.99. (in target 'OpenSSL-Universal' from project 'Pods') The iOS Simulator deployment target 'IPHONEOS_DEPLOYMENT_TARGET' is set to 4.0, but the range of supported deployment target versions is 9.0 to 14.0.99. (in target 'OpenCV' from project 'Pods') The iOS Simulator deployment target 'IPHONEOS_DEPLOYMENT_TARGET' is set to 8.0, but the range of supported deployment target versions is 9.0 to 14.0.99. (in target 'CocoaLibEvent' from project 'Pods') The iOS Simulator deployment target 'IPHONEOS_DEPLOYMENT_TARGET' is set to 8.0, but the range of supported deployment target versions is 9.0 to 14.0.99. (in target 'boost-for-react-native' from project 'Pods') The iOS Simulator deployment target 'IPHONEOS_DEPLOYMENT_TARGET' is set to 8.0, but the range of supported deployment target versions is 9.0 to 14.0.99. (in target 'Flipper' from project 'Pods') The iOS Simulator deployment target 'IPHONEOS_DEPLOYMENT_TARGET' is set to 8.0, but the range of supported deployment target versions is 9.0 to 14.0.99. (in target 'Flipper-Glog' from project 'Pods') The iOS Simulator deployment target 'IPHONEOS_DEPLOYMENT_TARGET' is set to 7.0, but the range of supported deployment target versions is 9.0 to 14.0.99. (in target 'TesseractOCRiOS' from project 'Pods') The iOS Simulator deployment target 'IPHONEOS_DEPLOYMENT_TARGET' is set to 8.0, but the range of supported deployment target versions is 9.0 to 14.0.99. (in target 'Flipper-Folly' from project 'Pods') Skipping duplicate build file in Copy Headers build phase: /Users/company/Projects/Matriculas/app/node_modules/react-native-openalpr/ios/Frameworks/opencv2.framework/Headers/flann/config.h (in target 'react-native-openalpr' from project 'Pods') Skipping duplicate build file in Copy Headers build phase: /Users/company/Projects/Matriculas/app/node_modules/react-native-openalpr/ios/Frameworks/opencv2.framework/Headers/flann/heap.h (in target 'react-native-openalpr' from project 'Pods') Skipping duplicate build file in Copy Headers build phase: /Users/company/Projects/Matriculas/app/node_modules/react-native-openalpr/ios/Frameworks/opencv2.framework/Headers/imgproc/types_c.h (in target 'react-native-openalpr' from project 'Pods') The iOS Simulator deployment target 'IPHONEOS_DEPLOYMENT_TARGET' is set to 8.4, but the range of supported deployment target versions is 9.0 to 14.0.99. (in target 'Flipper-PeerTalk' from project 'Pods') The iOS Simulator deployment target 'IPHONEOS_DEPLOYMENT_TARGET' is set to 8.0, but the range of supported deployment target versions is 9.0 to 14.0.99. (in target 'Flipper-DoubleConversion' from project 'Pods') The iOS Simulator deployment target 'IPHONEOS_DEPLOYMENT_TARGET' is set to 5.0, but the range of supported deployment target versions is 9.0 to 14.0.99. (in target 'CocoaAsyncSocket' from project 'Pods') The iOS Simulator deployment target 'IPHONEOS_DEPLOYMENT_TARGET' is set to 8.0, but the range of supported deployment target versions is 9.0 to 14.0.99. (in target 'YogaKit' from project 'Pods') The iOS Simulator deployment target 'IPHONEOS_DEPLOYMENT_TARGET' is set to 8.0, but the range of supported deployment target versions is 9.0 to 14.0.99. (in target 'Flipper-RSocket' from project 'Pods') no rule to process file '/Users/company/Projects/Matriculas/app/ios/Pods/Flipper-RSocket/rsocket/benchmarks/CMakeLists.txt' of type 'text' for architecture 'x86_64' (in target 'Flipper-RSocket' from project 'Pods') no rule to process file '/Users/company/Projects/Matriculas/app/ios/Pods/Flipper-RSocket/rsocket/benchmarks/README.md' of type 'net.daringfireball.markdown' for architecture 'x86_64' (in target 'Flipper-RSocket' from project 'Pods') no rule to process file '/Users/company/Projects/Matriculas/app/ios/Pods/Flipper-RSocket/rsocket/README.md' of type 'net.daringfireball.markdown' for architecture 'x86_64' (in target 'Flipper-RSocket' from project 'Pods')

This is my package.json: { "name": "app", "version": "0.0.1", "private": true, "scripts": { "android": "react-native run-android", "ios": "react-native run-ios", "start": "react-native start", "test": "jest", "lint": "eslint ." }, "dependencies": { "react": "16.13.1", "react-native": "0.63.2", "react-native-openalpr": "^2.1.1" }, "devDependencies": { "@babel/core": "^7.11.6", "@babel/runtime": "^7.11.2", "@react-native-community/eslint-config": "^2.0.0", "babel-jest": "^26.3.0", "eslint": "^7.9.0", "jest": "^26.4.2", "metro-react-native-babel-preset": "^0.63.0", "react-test-renderer": "16.13.1" }, "jest": { "preset": "react-native" } } Thanks in advance, Antonio

RobertSasak commented 4 years ago

What is the error? I suggest that you start with example project and try it first. Once you get it to work, you can try to move to your own repo.

arinconc commented 4 years ago

Thanks for your quick response. I tell you the steps I have followed: 1 I have created a new react-native project: $ react-native init app 2 I have run the project in the simulator and it works:

$ cd app
$ react-native run-ios

3 I have added react-native-openalpr: $ yarn add react-native-openalpr 4 Following the steps to run on iOS I have added react-native-permissions $ yarn add react-native-permissions 5 I have edited the pod file:

require_relative '../node_modules/react-native/scripts/react_native_pods'
require_relative '../node_modules/@react-native-community/cli-platform-ios/native_modules'

platform :ios, '10.0'

target 'app' do
  config = use_native_modules!

  use_react_native!(:path => config["reactNativePath"])
  pod 'Permission-Camera', :path => "../node_modules/react-native-permissions/ios/Camera.podspec"

  target 'appTests' do
    inherit! :complete
    # Pods for testing
  end

  # Enables Flipper.
  #
  # Note that if you have use_frameworks! enabled, Flipper will not work and
  # you should disable these next few lines.
  use_flipper!
  post_install do |installer|
    flipper_post_install(installer)
  end
end

target 'app-tvOS' do
  # Pods for app-tvOS

  target 'app-tvOSTests' do
    inherit! :search_paths
    # Pods for testing
  end
end

6 I have run pod install 7 I have added the key to the info.plist file:

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
    <key>CFBundleDevelopmentRegion</key>
    <string>en</string>
    <key>CFBundleDisplayName</key>
    <string>app</string>
    <key>CFBundleExecutable</key>
    <string>$(EXECUTABLE_NAME)</string>
    <key>CFBundleIdentifier</key>
    <string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
    <key>CFBundleInfoDictionaryVersion</key>
    <string>6.0</string>
    <key>CFBundleName</key>
    <string>$(PRODUCT_NAME)</string>
    <key>CFBundlePackageType</key>
    <string>APPL</string>
    <key>CFBundleShortVersionString</key>
    <string>1.0</string>
    <key>CFBundleSignature</key>
    <string>????</string>
    <key>CFBundleVersion</key>
    <string>1</string>
    <key>LSRequiresIPhoneOS</key>
    <true/>
    <key>NSAppTransportSecurity</key>
    <dict>
        <key>NSAllowsArbitraryLoads</key>
        <true/>
        <key>NSExceptionDomains</key>
        <dict>
            <key>localhost</key>
            <dict>
                <key>NSExceptionAllowsInsecureHTTPLoads</key>
                <true/>
            </dict>
        </dict>
    </dict>
    <key>NSLocationWhenInUseUsageDescription</key>
    <string></string>
    <key>UILaunchStoryboardName</key>
    <string>LaunchScreen</string>
    <key>UIRequiredDeviceCapabilities</key>
    <array>
        <string>armv7</string>
    </array>
    <key>UISupportedInterfaceOrientations</key>
    <array>
        <string>UIInterfaceOrientationPortrait</string>
        <string>UIInterfaceOrientationLandscapeLeft</string>
        <string>UIInterfaceOrientationLandscapeRight</string>
    </array>
    <key>UIViewControllerBasedStatusBarAppearance</key>
    <false/>
    <key>NSCameraUsageDescription</key>
    <string>We use your camera for license plate recognition to make it easier for you to add your vehicle.</string>
</dict>
</plist>

8 In Build Settings → Build Options I have configured Enable Bitcode and set it to No (in release) 9 Finally I run the app in the simulator and I get some warnings:

ld: building for iOS Simulator, but linking in dylib built for macOS, file '/usr/lib/libstdc++.6.0.9.dylib' for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)

warning: The iOS Simulator deployment target 'IPHONEOS_DEPLOYMENT_TARGET' is set to 8.0, but the range of supported deployment target versions is 9.0 to 14.0.99. (in target 'Flipper-DoubleConversion' from project 'Pods')
warning: The iOS Simulator deployment target 'IPHONEOS_DEPLOYMENT_TARGET' is set to 5.0, but the range of supported deployment target versions is 9.0 to 14.0.99. (in target 'CocoaAsyncSocket' from project 'Pods')
warning: The iOS Simulator deployment target 'IPHONEOS_DEPLOYMENT_TARGET' is set to 8.0, but the range of supported deployment target versions is 9.0 to 14.0.99. (in target 'CocoaLibEvent' from project 'Pods')
warning: The iOS Simulator deployment target 'IPHONEOS_DEPLOYMENT_TARGET' is set to 8.0, but the range of supported deployment target versions is 9.0 to 14.0.99. (in target 'Flipper' from project 'Pods')
warning: The iOS Simulator deployment target 'IPHONEOS_DEPLOYMENT_TARGET' is set to 8.4, but the range of supported deployment target versions is 9.0 to 14.0.99. (in target 'Flipper-PeerTalk' from project 'Pods')
warning: The iOS Simulator deployment target 'IPHONEOS_DEPLOYMENT_TARGET' is set to 7.0, but the range of supported deployment target versions is 9.0 to 14.0.99. (in target 'TesseractOCRiOS' from project 'Pods')
warning: The iOS Simulator deployment target 'IPHONEOS_DEPLOYMENT_TARGET' is set to 8.0, but the range of supported deployment target versions is 9.0 to 14.0.99. (in target 'boost-for-react-native' from project 'Pods')
warning: The iOS Simulator deployment target 'IPHONEOS_DEPLOYMENT_TARGET' is set to 6.0, but the range of supported deployment target versions is 9.0 to 14.0.99. (in target 'OpenSSL-Universal' from project 'Pods')
warning: The iOS Simulator deployment target 'IPHONEOS_DEPLOYMENT_TARGET' is set to 8.0, but the range of supported deployment target versions is 9.0 to 14.0.99. (in target 'Flipper-Glog' from project 'Pods')
warning: The iOS Simulator deployment target 'IPHONEOS_DEPLOYMENT_TARGET' is set to 4.0, but the range of supported deployment target versions is 9.0 to 14.0.99. (in target 'OpenCV' from project 'Pods')
warning: The iOS Simulator deployment target 'IPHONEOS_DEPLOYMENT_TARGET' is set to 8.0, but the range of supported deployment target versions is 9.0 to 14.0.99. (in target 'Flipper-RSocket' from project 'Pods')
warning: no rule to process file '/Users/company/Projects/Matriculas/app/ios/Pods/Flipper-RSocket/rsocket/benchmarks/CMakeLists.txt' of type 'text' for architecture 'x86_64' (in target 'Flipper-RSocket' from project 'Pods')
warning: no rule to process file '/Users/company/Projects/Matriculas/app/ios/Pods/Flipper-RSocket/rsocket/benchmarks/README.md' of type 'net.daringfireball.markdown' for architecture 'x86_64' (in target 'Flipper-RSocket' from project 'Pods')
warning: no rule to process file '/Users/company/Projects/Matriculas/app/ios/Pods/Flipper-RSocket/rsocket/README.md' of type 'net.daringfireball.markdown' for architecture 'x86_64' (in target 'Flipper-RSocket' from project 'Pods')
warning: The iOS Simulator deployment target 'IPHONEOS_DEPLOYMENT_TARGET' is set to 8.0, but the range of supported deployment target versions is 9.0 to 14.0.99. (in target 'YogaKit' from project 'Pods')
warning: Skipping duplicate build file in Copy Headers build phase: /Users/company/Projects/Matriculas/app/node_modules/react-native-openalpr/ios/Frameworks/opencv2.framework/Headers/flann/config.h (in target 'react-native-openalpr' from project 'Pods')
warning: Skipping duplicate build file in Copy Headers build phase: /Users/company/Projects/Matriculas/app/node_modules/react-native-openalpr/ios/Frameworks/opencv2.framework/Headers/flann/heap.h (in target 'react-native-openalpr' from project 'Pods')
warning: Skipping duplicate build file in Copy Headers build phase: /Users/company/Projects/Matriculas/app/node_modules/react-native-openalpr/ios/Frameworks/opencv2.framework/Headers/imgproc/types_c.h (in target 'react-native-openalpr' from project 'Pods')

** BUILD FAILED **

The following build commands failed:
    Ld /Users/company/Library/Developer/Xcode/DerivedData/app-ddggpwxohxghteetjdkonnbwetoz/Build/Products/Debug-iphonesimulator/app.app/app normal
(1 failure)

10 And 1 error: image

I hope I can give you more information.

Thanks for your effort, Antonio

RobertSasak commented 4 years ago

Linking errors are hard to debug as every computer has its own enviroment. You will save hours of debugging by starting with example folder. Once you get that one running you will quickly see what is missing in your repo.

arinconc commented 4 years ago

Ok Robert. I'll try it.

Thanks!

Sohailbhutto commented 4 years ago

@arinconc any update ? @RobertSasak

richiepreece commented 3 years ago

@arinconc @Sohailbhutto @RobertSasak

I was having the same issue, and have found the solution:

With new versions of react native, you DO NOT want to run the yarn add react-native-permissions command OR the pod 'Permission-Camera', :path => "../node_modules/react-native-permissions/ios/Camera.podspec" command.

Those are automatically applied via the podspec file. I'm going to open a PR to try and clear up the issues.

RobertSasak commented 3 years ago

@richiepreece Thank you for looking into it. Let me know if I can be any help.

richiepreece commented 3 years ago

@RobertSasak I've created a pull request in #102

RobertSasak commented 3 years ago

There is a workaround in Podfile for this in example folder. Closing for now