Google Speech to Text iOS app example: could not build module 'googleapis' - swift

Has anyone been able to successfully build Google's Speech to Text iOS example in Swift 4?
The swift project posted to the Github repo: GoogleCloudPlatform/ios-docs-samples does not seem to be well-maintained. When I open the workspace example, I immediately get 3 build errors in locating header files and "could not build module googleapis."
On installing googleapis
I looked up documentation on pod install for pod 'googleapis', :path=> "." but this produces the following error: [!] No podspec found for googleapis in . I found the googleapis.podspec and downloaded the .zip file and when I did a pod install, got this error:
[!] /bin/bash -c
set -e
Pods/!ProtoCompiler/protoc --plugin=protoc-gen-grpc=Pods/!ProtoCompiler-gRPCPlugin/grpc_objective_c_plugin --objc_out=. --grpc_out=. -I . -I Pods/!ProtoCompiler google//.proto google////.proto google//.proto: No such file or directory
On $ npm install googleapis, I get errors:
npm WARN saveError ENOENT: no such file or directory, open '/Users/grehce/package.json'
npm notice created a lockfile as package-lock.json. You should commit this file.
npm WARN enoent ENOENT: no such file or directory, open '/Users/grehce/package.json'
npm WARN grehce No description
npm WARN grehce No repository field.
npm WARN grehce No README data
npm WARN grehce No license field.
On locating Header files
Even after pointing it to the correct path in Build Settings > Header Search Paths, the headers are still unable to be found.
missing header file even though it exists
added Header Search Paths
If someone can help correct those above 2 issues OR provide a working iOS example of the Google Speech to Text integrated .xcodeproj example, would be much appreciated!
Github: https://github.com/GoogleCloudPlatform/ios-docs-samples/issues/89

I had problems getting this sample to work as well until I realised that that you are supposed to run the script ./INSTALL-COCOAPODS instead of just doing a regular pod install. This fixes up some paths after installing the pods. Alternatively, you can follow the instructions in the BUILDFIXES file in the repo.
It's annoying that it doesn't just work like any other project, but at least, once you read the manual, it is an easy enough fix.

This is very annoying and bears better documentation from Google's part.
On installing googleapis
You must add the "google" folder from the iOS example project into the same folder as your xcodeproj (sort of alluded to here: https://github.com/GoogleCloudPlatform/ios-docs-samples/issues/19)
You must ignore the "Cannot load underlying module for googleapis" and force build after the googleapis pod install has succeeded. Apparently, "Cannot load underlying module for x" is an xcode bug (Cocoapods + Cannot load underlying module for 'x')
note:
pod 'googleapis', :path=> "."

Related

I was trying to install react-query. But it is not installed. How to solve it

Heading
yarn add v1.22.18
warning package-lock.json found. Your project contains lock files generated by tools other than Yarn. It is advised not to mix package managers in order to avoid resolution inconsistencies
caused by unsynchronized lock files. To clear this warning, remove package-lock.json.
[1/4] Resolving packages...
error An unexpected error occurred: "https://registry.yarnpkg.com/#tanstack%2freact-query: Not found".
info If you think this is a bug, please open a bug report with
the information provided in "G:\Projects\74\doctors-portal-client\yarn-error.log".
info Visit https://yarnpkg.com/en/docs/cli/add for documentation about this command.
As suggested by the error message, you can try to delete your package-lock.json file to get rid of the warning. As stated in the npm documentation, package-lock.json is automatically generated by npm for any operation that modifies the node_modules tree or package.json, so don't worry about breaking anything by removing this file, as it will be generated the next time you make some changes to your project.

Magento 2.3.5 fresh installtion using composer results in error

I am trying to install Magento 2.3.5 using composer.
muk#muk:/var/www/html$ composer create-project --repository-url=https://repo.magento.com/ magento/project-community-edition=2.3.5 magento23
Creating a "magento/project-community-edition" project at "./magento23"
Installing magento/project-community-edition (2.3.5-p1)
- Installing magento/project-community-edition (2.3.5-p1): Loading from cache
Created project in /var/www/html/magento23
Loading composer repositories with package information
Updating dependencies (including require-dev)
Package operations: 463 installs, 0 updates, 0 removals
- Installing magento/magento-composer-installer (0.1.13): Loading from cache
- Installing laminas/laminas-dependency-plugin (1.0.3): Loading from cache
Plugin installation failed (include(/var/www/html/magento23/vendor/laminas/laminas-dependency-plugin/src/DependencyRewriterPlugin.php): failed to open stream: No such file or directory), rolling back
- Removing laminas/laminas-dependency-plugin (1.0.3)
[ErrorException]
include(/var/www/html/magento23/vendor/laminas/laminas-dependency-plugin/src/DependencyRewriterPlugin.php): failed to open stream: No such file or directory
create-project [-s|--stability STABILITY] [--prefer-source] [--prefer-dist] [--repository REPOSITORY] [--repository-url REPOSITORY-URL] [--add-repository] [--dev] [--no-dev] [--no-custom-installers] [--no-scripts] [--no-progress] [--no-secure-http] [--keep-vcs] [--remove-vcs] [--no-install] [--ignore-platform-reqs] [--] [<package>] [<directory>] [<version>]
I am getting following error.
Plugin installation failed (include(/var/www/html/magento23/vendor/laminas/laminas-dependency-plugin/src/DependencyRewriterPlugin.php): failed to open stream: No such file or directory), rolling back
- Removing laminas/laminas-dependency-plugin (1.0.3)
My Composer version
muk#muk:/var/www/html$ composer --version
Composer version 1.10.5 2020-04-10 11:44:22
I am using VirtualBox with Shared folder.
How can I fix it?
Note: To fix it I stopped using shared folder. Now I keep the entire code in the VM and do not use shared folder. For file synching I am using mutagen.
if anyone runs into this issue, it looks to be a problem with virtualBox and shared folders. when unzipping files, they are not immediately available in the environment.
the solution is by rkamp and is also available here:
https://stackoverflow.com/a/66413857/1470145
in short, one needs to override unzip to add a brief delay after unzipping.
I thought I had the same issue, but turned out it was something else.
The upgrade went OK for me, for a sandbox/clean 2.3.4 install, and a client project running 2.3.4.
A few things:
This could possibly be an issue with your cache, try to clear your composer laminas cache (~/.composer/cache/files/laminas usually)
Although it would complain about that, you've possibly got unmet platform requirements (php version, etc.)
Try clearing your entire composer cache (~/.composer)
Double-check the repository URL (should it be 2.3.5 or 2.3.5-p1?)
Hope that helps

IBM Cloud Node-RED Manage Palette doesn't install items

I'm on IBM Cloud trying to install node-red-node-smooth from the manage palette, and I'm getting an error. I've tried several other packages as well. The error that I get in my debug log shows:
npm WARN saveError ENOENT: no such file or directory, open '/home/vcap/app/.node-red/package.json'
npm WARN enoent ENOENT: no such file or directory, open '/home/vcap/app/.node-red/package.json'
npm WARN .node-red No description
npm WARN .node-red No repository field.
npm WARN .node-red No README data
npm WARN .node-red No license field.
+ node-red-node-smooth#0.1.0
updated 1 package in 4.726s
npm ERR! Object.entries is not a function
npm ERR! A complete log of this run can be found in:
npm ERR! /home/vcap/app/.npm/_logs/2018-05-10T15_01_53_296Z-debug.log
The log file has a stack trace that starts with this:
106 verbose stack TypeError: Object.entries is not a function
Is there something obvious that I'm doing wrong?
instances deployed in the last few days got npm 6.0.0. This version of npm contained a bug that caused the Object.entries is not a function error.
npm released 6.0.1 that fixed this issue today (Thursday May 10th 2018)
You have three possible ways to fix your instance:
deploy a new instance and copy your flows over
or, set the NPM_CONFIG_AUDIT environment variable* to false - which stops npm 6.0.0 going down the code path containing the bug.
or, set the NODE_MODULE_CACHE environment variable* to false and trigger a restage of your application - that will get npm 6.0.1 installed.
If you don't have much in the way of flows at this point, deleting and creating a new instance is the easiest option.
If you want to 'repair' your existing instance, option 2 is probably the easiest as it just requires an automatic restart of the app, rather than a restage which requires the cf command-line tool to trigger manually.
To set an environment variable within your IBM Cloud application, go to your application's dashboard page. Go to the Runtime section in the left-hand navigation. Select 'Environment Variables' in the tabs across the top and scroll down to the 'User defined' section of the page. Click 'Add' - enter the env var details and click 'Save'. Your app will be restarted with the variable set.

Firebase SDK pod installation linker error

I wanted to implement Firebase SDK in my Swift project. I followed the instructions and installed pods, created a Podfile as follows:
platform :ios, '7.0'
target 'MyApp' do
pod 'Firebase'
project '/Users/MyName/Desktop/MyApp/MyApp.xcodeproj'
end
Then as I do install pods, it comes out with the following in terminal:
Analyzing dependencies
Downloading dependencies
Using Firebase (3.9.0)
Using FirebaseAnalytics (3.5.1)
Using FirebaseCore (3.4.4)
Using FirebaseInstanceID (1.0.8)
Using GoogleInterchangeUtilities (1.2.2)
Using GoogleSymbolUtilities (1.1.2)
Using GoogleToolboxForMac (2.1.0)
Generating Pods project
Integrating client project
Sending stats
Pod installation complete! There is 1 dependency from the Podfile and 7 total pods installed.
So I thought it worked but after reading various posts online apparently this is supposed to produce a xcworkspace file which I'm supposde to use instead of xcodeproj- is that correct? And if so why hasn't it generated it? I don't understand what is going wrong.
It might also be relevant info that I added all the bits to my xcodeproj file (before realising I should be working with xcworkspace instead) so the pods had come up in my xcodeproj, I added the import Firebase header file, the Google service info, plist and the import+ FIRApp.configure() in delegate and added $(inherited) in other linkers and when I try to use simulator it comes up with an error saying:
Library not found for GoogleToolBoxForMac
Linker command code failed with exit code 1 (use -v to see invocation).
How come it allowed me to do all this if the initial install was incorrect? And where do I go from here?
Can I please get some help about what is going wrong? And how can I solve this problem? Or at least am I able to go back to step one and reverse all these changes smoothly?
If possible please use examples, I am a newbie.
Incase someone else is having this error. The problem was that I was in the wrong directory and had attempted to put a Podfile with the directory leading to 'MyApp.xcodeproj'. This is incorrect as the Podfile should just be in the folder. Initially I was not able to locate this folder (even though it was on my Desktop) so I used in terminal:
cd ~/Desktop
then
cd ~/Desktop/MyApp
and then
pod init
and edited the Podfile followed by
pod install...

Unable to build ScanApiSdk with error ScanApiHelper.h file not found

I am attempting to add in the Socket Mobile ScanApiSdk into my project but it is failing to build with the error 'ScanApiHelper.h' file not found. I have installed it into my project workspace using the CocoaPods method. Unzipped the SDK into a folder at the same folder level as my project folder. Adding the following line to my Podfile.
pod 'ScanAPI', :path => '../scanapisdk'
Then ran the pod install command at prompt. Launched project from the xcworkspace file and then added the following line to my bridging header.
#import "ScanApiHelper.h"
Build fails at this line in the bridging header.
Xcode Version 8.0 (8A218a)
gem --version 2.0.14.1
pod --version 1.0.1
ScanAPI SDK Version 10.3.55
I was able to download the sample SingleEntrySwift project from Github, build it, and load it on my iPhone for testing.
Can someone help point out what I am doing wrong in my own project or troubleshooting steps?
I had this issue too and this solution worked for me.
Basically, you don't need a bridging header if you use use_frameworks!. Instead you just import ScanAPI in any swift files that use ScanAPI.