NeutrinosPlatform / cordova-plugin-mobile-ocr

A cordova plugin that can accept image URI or Base64 data and returns the text present in the image as string without need for network. You can also try :- https://github.com/NeutrinosPlatform/cordova-plugin-ml-text
MIT License
49 stars 30 forks source link

Pod Problem with build ios #30

Open a0fzide opened 4 years ago

a0fzide commented 4 years ago

First build with error : warning: The iOS Simulator deployment target 'IPHONEOS_DEPLOYMENT_TARGET' is set to 7.0, but the range of supported deployment target versions is 8.0 to 13.2.99. (in target 'GTMSessionFetcher' from project 'Pods')

I put this code in podfile

post_install do |pi| pi.pods_project.targets.each do |t| t.build_configurations.each do |config| config.build_settings['IPHONEOS_DEPLOYMENT_TARGET'] = '9.0' end end end

after that I build again.

This error apprears after build ios

Build/Products/Debug-iphonesimulator/GoogleMobileVision/GoogleMVTextDetectorResources.bundle" not found. Run 'pod install' to update the copy resources script.

ChrisTomAlx commented 4 years ago

Hey @a0fzide

You need to follow these steps as mentioned in Readme after adding the plugin and before doing a build :-

For iOS please also follow the steps below.

  • Once the iOS platform is added in command line, change directory to where podfile is found. Example location :- (myapp/platforms/ios).
  • Make sure you have cocoapods installed then in command line do pod update.
  • Now open myapp.xcworkspace which is usually found in the same directory as the podfile, then build and run.
    Note :- if you use myapp.xcodeproj to build and run, it will not work and it will show a linker error.
    Note :- if you manually create the podfile, please refer to issue #2

Cheers, Chris Neutrinos

Catscratch commented 3 years ago

I wanna re-open this issue.

I have the same problem. The solution above works once. But how may I continuously develop on iOS using this plugin? I need cordova build to work for testing and production environment. Also things like live reload seem not to work as long as the usual XCode command line build is not working.

Can you fix the command line build?

ChrisTomAlx commented 3 years ago

You can use build flags to build via cli after the pod install step. Refer to the cordova official website to learn about build flags.

Here is an example build cli command with build flags :-

cordova build ios --device --codeSignIdentity="iPhone Developer" --developmentTeam="<yourTeamId>" --buildFlag="-allowProvisioningUpdates" --buildFlag="-UseModernBuildSystem=0"

You might have to change some things based on your setup.

Cheers, Chris Neutrinos

Catscratch commented 3 years ago

Problem is that the build is still not working. I get either the "GoogleMVTextDetectorResources.bundle not found" error or when I run pod install/update manually I get the "'IPHONEOS_DEPLOYMENT_TARGET' is set to 7.0" error.

So my question is how may we achieve a working build without errors?

ChrisTomAlx commented 3 years ago

So I think the min IPHONEOS_DEPLOYMENT_TARGET should be raised for the project or lowered for the pods, but I am not entirely sure how.

You can try editing the podfile to lower the deployment target in platforms/ios and see if that helps.

Cheers, Chris Neutrinos

Catscratch commented 3 years ago

Ok. I played around a bit but have no real progress here.

I found out that the version mismatch for IOS comes from the Google implementation because it's simply too old. But it's only a warning. So it doesn't block the build.

But the build still fails because it can't find the bundle. The file is available in the platform/ios/build/emulator directory but the build itself fails because xcode is searching the file in kind of a temporary build directory from which the build will run. So it seems like whatever is triggering the build doesn't copy over the .bundle file. So it's missing in the actual build and therefore the build is failing.

And it doesn't matter if you run "pod install" and/or "pod update".

So it seems like there is something wrong with the build process of cordova itself. I'm not sure who's responsible for this file preparation.

But considering all these problems I would say the plugin (or any plugin based on cacoapods?) is not compatible to iOS.

Is there anyone out there with a working iOS build solution for current iOS, xcode and MacOS version?

ChrisTomAlx commented 3 years ago

Could you try the following