Friday, 23 December 2022

Which library contains `com.google.android.voicesearch.DetailsReceiver` nowadays?

I finally migrated an old project of mine from Eclipse/ADT to Android Studio (2021.3.1.17).

In the course of this migration, I fixed numerous issues stemming from outdated and deprecated methods and keywords that used to work perfectly on Android 2.2 (API 8) and did not produce any warnings on Eclipse/ADT.

But now, on Android Studio 2021.3, target SDK 33, I am getting this error in AndroidManifest.xml:

Class referenced in the manifest, 
`com.google.android.voicesearch.DetailsReceiver`, 
was not found in the project or the libraries

I combed Google for clues on how to fix this but apparently this DetailsReceiver is so old that there really is no reference to it anymore.

How do eliminate this error in Android Studio? Is there a reference I can add to the module to make it go away?

Update: The package that used to include this DetailsReceiver used be downloadable from market://details?id=com.google.android.voicesearch. It no longer exists on Google Play.

If you search Google Play for com.google.android.voicesearch you will get the following matches associated with Google LLC:

  1. Google Assistant
  2. Google Assistant Go
  3. Google
  4. Google Access
  5. Google Go
  6. Assistant
  7. I may have missed one...

I am confused. So many candidates for a direct replacement of com.google.android.voicesearch but unclear documentation or information about this. Which downloadable package replaced it?

I am emphasizing "downloadable" because, on an out-of-box Google Pixel 4a (Android 11), PackagManager cannot find RecognizerIntent.ACTION_RECOGNIZE_SPEECH when queried.

The closest clue I have been able to find is in this SO thread: how to show up the google voice recognition settings in my app?

But I need a definitive clearer answer.

Any idea?



from Which library contains `com.google.android.voicesearch.DetailsReceiver` nowadays?

google sheet API Request had insufficient authentication scopes

I'm trying to follow the Google Sheet API from its documentation here: https://developers.google.com/sheets/api/guides/values

I'm trying to run the snippets of the codes mentioned there, for example, Python code on Reading a single range

Here is an example of a snippet of code that I ran, sheets_get_values.py

from __future__ import print_function

import google.auth
from googleapiclient.discovery import build
from googleapiclient.errors import HttpError


def get_values(spreadsheet_id, range_name):
    creds, _ = google.auth.default()
    try:
        service = build('sheets', 'v4', credentials=creds)

        result = service.spreadsheets().values().get(
            spreadsheetId=spreadsheet_id, range=range_name).execute()
        rows = result.get('values', [])
        print(f"{len(rows)} rows retrieved")
        return result
    except HttpError as error:
        print(f"An error occurred: {error}")
        return error


if __name__ == '__main__':
    get_values("1CM29gwKIzeXsAppeNwrc8lbYaVMmUclprLuLYuHog4k", "A1:C2")

python3 sheets_get_values.py

But I got this message:

An error occurred: <HttpError 403 when requesting https://sheets.googleapis.com/v4/spreadsheets/1CM29gwKIzeXsAppeNwrc8lbYaVMmUclprLuLYuHog4k/values/A1%3AC2?alt=json returned "Request had insufficient authentication scopes.". Details: "[{'@type': 'type.googleapis.com/google.rpc.ErrorInfo', 'reason': 'ACCESS_TOKEN_SCOPE_INSUFFICIENT', 'domain': 'googleapis.com', 'metadata': {'method': 'google.apps.sheets.v4.SpreadsheetsService.GetValues', 'service': 'sheets.googleapis.com'}}]">

I have tried to set the GOOGLE_APPLICATION_CREDENTIALS environment:

export GOOGLE_APPLICATION_CREDENTIALS='/home/myUser/.config/gcloud/application_default_credentials.json'

I also already enable application default credentials:

gcloud auth application-default login

gcloud config set project project_name

I also try to solve this by following a few instructions related to Request had insufficient authentication scopes by Googling, for example this one

I try to modify the default snippet of code by Google documentation be like this:

SCOPES = [
    'https://www.googleapis.com/auth/drive',
    'https://www.googleapis.com/auth/drive.file',
    'https://www.googleapis.com/auth/spreadsheets',
]

def append_values(spreadsheet_id, range_name, value_input_option,
                  _values):
    creds, _ = google.auth.default(scopes=SCOPES)
    ...
    ...

But the error still appear when I ran the snippet of the code.

So, what should I do to solve this error?



from google sheet API Request had insufficient authentication scopes

Nest.js bundle size too large by default

Upon running nest build command, I was expecting that the build would pick up only the imported modules from node_module folder.

However, the command did not pick up the releavent files and minifined them. Instead it picked up the node_modules directly from the root folder.

As a result, the final build size of the application is extreamely large.

I need help to reduce the build size.



from Nest.js bundle size too large by default