How to integrate react-native-text-detector successfully? - xcode

The documentation for this library's install has been followed step for step.
npm install react-native-text-detector --save
added pod "RNTextDetector", path: '../node_modules/react-native-text-detector/ios to pod file
did not manually link binary or add file to library in Xcode
However the build continually fails. it fails in the same way when trying to integrate react-native-tesseract-ocr, one of the dependencies for this library.
the build error:
-weak_library and -bitcode_bundle (Xcode setting ENABLE_BITCODE=YES) cannot be used together

I was having the same problem...
After some more research, I looked into a few things regarding tesseract-ocr for iOS that helped get everything up and running as expected.
Install react-native-text-detector per the repo's README
Added the linker flag -lstdc++ in Xcode build settings
Set the build setting Enable Bitcode to NO in Xcode build settings
Followed the README in this repo, https://github.com/Kila2/libstdc-.6.0.9.tbd/blob/master/README.md
After that I was able to build and run both on the iOS simulator and on a test device.

I have 11.3, the latest stable version.

Related

Cocoapods Pod Packages Version Checking - Flutter

I just recently updated my MacOS BigSur to 11.6 to accommodate the new iOS 15 release. I also updated my XCode to 13. To make sure my Flutter packages are using the most up to date version, I checked and confirmed that the package/s versions in pubsec.yaml is indeed the newest via pub.dev. I then updated Flutter, reinstalled Cocoapods and ran 'pod repo remove trunk', 'pod repo update' and 'pod update'. I then tried checking whether the pod packages are the most up to date. However, when I try visiting cocoapods.org via browser, I am getting an internal server error. How do I verify that I do have the most recent versions which are in sync with the version showing in pub.dev of Flutter? Is it correct to assume that the pub.dev build version showing for a specific package should be the same when I check the package in Pods of XCode?
FYI. The reason I am asking this is because I am getting a lot of build errors due to pods with deprecation errors. So I wish to rule out any version discrepancies before tshooting further.
Thanks in advance.
I'm not sure about the first problem, but for the problem "a lot of build errors due to pods with deprecation errors" I always use this steps to solve it.... try it might work for you too:
delete: podfile, pods folder, and podfile.lock
cd ios
pod install --repo-update (this will take time)
cd ..
flutter clean
flutter pub get
Thanks Remoo. Unfortunately your recommendation didn't work. What worked is: 1. Deleted my project. 2. Copied original saved copy fresh to MacOS. 3. Ran flutter clean and then flutter packages get and then in ios dir, did pod install. 4. Flutter run and flutter build ios --release were successful. 5. I just ran archive via XCode but still saw a lot of deprecation errors but it went through. Also performed Validate and Distribute. I will see if the app works on my iphone.

Add DCMTK library and compile for Xcode 12.4+

I'm trying to install and add the DCMTK library to my Xcode project. The library can be found here https://dicom.offis.de/training.php.en
I ran the command to install via home-brew brew install dcmtk but I'm not sure how to add the library and start using it in my project. I have no idea how to add this to my dependencies in Xcode. I managed to successfully compile Horus which uses the framework, but it gives a BAD_ACCESS error after running and I'm not sure how they managed to get it to work? It appears they run it as a build target that then runs CMake behind the scenes? I'm not familiar with this style of doing it. This is the link to the Horos Project that uses the library in the way I need to (https://github.com/horosproject/horos)
I see many questions regarding this with older versions of Xcode that no longer compile with the newest Xcode which is why I'm asking this question here. Any help is greatly appreciated!

React-native AwesomeProject buid failure

I am learning react-native from a Udemy course. I have followed the exact steps used by both my instructor as well as the RN documentation. However, I get 105 errors when I open in XCode (v6.4 on OSX 10.10.1). I tried targeting different builds, but to no avail. A few of the errors I get include
Expected '>'
Expected '}'
All the errors here seem to originate in the external files such as
RCTVibration.m
RCTAssert.h
And so on.
The build tools I used are the ones recommended by fb.
brew install node
npm install -g react-native-cli
react-native init AwesomeProject
cd AwesomeProject
react-native run-ios (Even tried opening it using Xcode in the finder)
On a side note, using Node v4.4.5, react-native cli 1.0.0, Homebrew 0.9.9.
Right up till I build the project, I encounter nothing unusual (Creating the project did take quite long and threw a few warnings at me.) Are there any dependencies I have failed to install? Help is appreciated!
EDIT: I either hadn't observed this before, or this appeared now. Here's the image.
From the React Native Getting Started prerequisites:
Xcode 7.0 or higher. Open the App Store or go to https://developer.apple.com/xcode/downloads/. This will also install git as well.
So you should update your XCode.

Phonegap/Cordova Build error - Apple Mach-O Linker Error: no such file or directory: libCordova.a

I am getting an error after creating a new Cordova 2.1.0 project and updating the www folder with some code from a previous PhoneGap application.
clang: error: no such file or directory: '/Users/peterbanjo/Library/Developer/Xcode/DerivedData/OpuzMobile-bhwawiqfaptmxvfosawfabudgbkj/Build/Products/Debug-iphoneos/libCordova.a'
The error only occurs when I try and run the application on a device - in the simulator it works fine.
I am running Xcode 4.5 and iOS6 on the target iPad. I have tried a clean build and libCordova.a appears in the Build Phases > Link Library With Libraries tab but it is in red.
What I found confusing with PhoneGap/Cordova 2.1.0 by upgrading from 1.4 is that there are TWO projects in my application. There is MyApplication.xcodeproj and CordovaLib.xcodeproj. The changes to resolve this issue need to be applied to the CordovaLib project.
Change "Build Active Architecture Only" to "YES"
Update the text file project.pbxproj to these values
Toggle between the build schema for the simulator and the device (Use the select menu next to the stop button. Somehow this seems to cause the changes to be detected).
Did this work for you? Did I miss something?
PS: For a better understanding of the problem take a look at this Google Forum thread
I'm using Cordova/Phonegap 2.9 and this solved my issue. Didn't touch any of the arch stuff. Everything is set to armv7 armv7s on mine.
Follow these steps to fix this problem:
Go to project settings and Build Tab.
Search for "Other Linker Flags"
Double click on the linker flags for Release and Change ${TARGET_BUILD_DIR}/libCordova.a to ${BUILT_PRODUCTS_DIR}/libCordova.a
Do the same for Debug Clean and build archive again
I had the same error and fixed it by reverting to an older version of cordova ios.
Steps to fix the issue:
Uninstall cordova-ios first, with npm uninstall cordova-ios
Install old version of cordova-ios with npm install cordova-ios#4.4.0
Remove existing ios platform with ionic cordova platform rm ios or ionic platform rm ios
After that we should add platform with ionic cordova platform add ios#4.4.0 or ionic platform add ios#4.4.0
Run ionic cordova build ios.
Instructions came from here.
Only need to remove armv6 from both YourProject and CordovaLib:
The consequences of doing this? Apparently, it's still working on iPhone 3GS, but not the previous versions..
To make it work I downloaded from http://connect.apple.com stand alone Xcode 4.4.1. With this version I can build my phonegap Application with armv6 :)
Yes, in this case you need to have two Xcode on your computer.
Look at this https://groups.google.com/forum/?fromgroups=#!topic/phonegap/ywoc9wNydZ8
works for me
--
OS X 10.8.2
XCode 4.5
iOS 6.0
PhoneGap 2.1.0
DO NOT assume that having Standard (armv7,armv7s) - $(ARCHS_STANDARD_32_BIT)
is the same as the fix above.
Manually change this value to only armv7 and that fixed it for me.
I was very frustrated.
If you did everything here and it is still not working and you have separate configuration aside from Release and Debug - for this example is Production. Make sure that 'Production' Build Configuration exists in Cordova project. Build the Cordova Project and Build + Archive your main project again.

CMake Xcode generator uses no longer supported options

I'm trying to make a Xcode project from the Insight Toolkit (ITK, itk.org). I issued the following command into the terminal:
ccmake -DCMAKE_C_COMPILER=/Applications/Xcode.app/Contents/Developer/usr/bin/gcc -DCMAKE_CXX_COMPILER=/Applications/Xcode.app/Contents/Developer/usr/bin/g++ -GXcode /<path to source>
When I try to generate the project it fails with this error:
CMake Error at /Applications/CMake 2.8-7.app/Contents/share/cmake-2.8/Modules/CMakeTestCCompiler.cmake:52 (MESSAGE):
The C compiler "/Applications/Xcode.app/Contents/Developer/usr/bin/gcc" is not able to compile a simple test program.
It fails with the following output:
Change Dir: /<path to destination folder>/CMakeFiles/CMakeTmp
Run Build Command:/Applications/CMake\ 2.8-7.app/Contents/bin/cmakexbuild -project CMAKE_TRY_COMPILE.xcode build -target cmTryCompileExec -buildstyle Development
xcodebuild: error: option '-buildstyle' is no longer supported
How can I configure the call to cmakexbuild? I haven't found a respective entry in the CMake configuration menu.
I have found similar problems from other users with other projects so I assume it's a problem with the CMake configuration.
I'm using Xcode 4.3 and CMake 2.8.7 on Mac OS X Lion 10.7.3.
Thanks for your help,
Paul
It's a CMake bug and it seem to be been fixed in development version:
http://public.kitware.com/Bug/view.php?id=12621
You can fix this by telling OSX which version of Xcode you want to use. If you installed 4.3, it has moved to the Apps folder, along with all the tools. Previously they were all in /Developer. Do the following and try again.
sudo /usr/bin/xcode-select -switch /Applications/Xcode.app/Contents/Developer
You may also have to install the command-line tools. I already installed these so I don't know what will happen without them.
cmake 2.8.8 rc1 is out now. Perhaps try that. I think it has solved my problem. :)

Resources