Is Having Trouble With Google Play Services. Please Try Again
Even the nearly experienced developer rarely writes code correctly on the get-go attempt, making troubleshooting an of import part of the evolution process. In this section we'll cover some techniques that can assistance you find, empathise, and debug errors in your scripts.
Error messages
When your script encounters an error, an error message is displayed. The message is accompanied by a line number used for troubleshooting. There are two basic types of errors displayed in this way: syntax errors and runtime errors.
Syntax errors
Syntax errors are caused by writing lawmaking that doesn't follow the JavaScript grammar, and the errors are detected as soon as you try to save the script. For example, the following code snippet contains a syntax mistake:
function emailDataRow(rowNumber) { var sail = SpreadsheetApp.getActiveSheet(); var data = canvass.getDataRange().getValues(); var rowData = data[rowNumber-1].bring together(" "; MailApp.sendEmail('john@example.com', 'Data in row ' + rowNumber, rowData); }
The syntax problem here is a missing )
grapheme at the stop of the 4th line. When you endeavor to relieve the script you'll go the following mistake:
Missing ) after argument list. (line 4)
These types of errors are commonly simple to troubleshoot, since they are institute right away and typically have uncomplicated causes. You aren't able to save a file that contains syntax errors, meaning that only valid code is saved into your projection.
Runtime errors
These errors are caused by using a role or course incorrectly, and tin can only be detected once the script has been run. For example, the following code causes a runtime error:
function emailDataRow(rowNumber) { var canvas = SpreadsheetApp.getActiveSheet(); var data = sheet.getDataRange().getValues(); var rowData = data[rowNumber-i].join(" "); MailApp.sendEmail('john', 'Data in row ' + rowNumber, rowData); }
The code is formatted correctly, but we are passing the value "john" for the electronic mail address when calling MailApp.sendEmail
. Since this is not a valid email address the following error is thrown when running the script:
Invalid electronic mail: john (line 5)
What makes these errors more challenging to troubleshoot is that oftentimes the data yous are passing into a function is non written in the code, but instead pulled from a spreadsheet, form, or other external data source. Using the debugging techniques below can help you to place the cause of these errors.
Common errors
Below is a listing of mutual errors and their causes.
Service invoked too many times: <action name>
This mistake indicates that you lot have exceeded your daily quota for a given action. For example, you might run across this error if y'all send too many emails in a unmarried day. The quotas are set at dissimilar levels for consumer, domain, and premier accounts and are subject to change at any time without a prior annunciation by Google. You can view the quota limits for various deportment in the Apps Script quota documentation.
Server not available. or Server mistake occurred, delight try again.
There are a few possible causes for these errors:
- A Google server or system is temporarily unavailable. Await for a few moments and endeavour running the script again.
- There is an error in your script that doesn't have a corresponding error message. Endeavor debugging your script and come across if you can isolate the problem.
- There is a issues in Google Apps Script that is causing this error. For instructions on searching for and filing problems reports, run into the Bugs. Before filing a new bug, search to see if others take already reported it.
This error indicates that the script is lacking the authorization needed to run. When a script is run in the Script Editor or from a custom menu item an authorization dialog is presented to the user. However, when a script is run from a trigger, embedded with a Google Sites page, or run every bit a service, the dialog cannot be presented and this error is shown.
To authorize the script, open the Script Editor and run whatsoever function. The authorisation prompt appears and so y'all can authorize the script project. If the script contains new unauthorized services, you must re-authorize the script.
This error is frequently acquired by triggers that are firing before the user has authorized them. If you don't have access to the script project (considering the mistake is occurring for an addition y'all utilize, for example), you can usually authorize the script by using the add together-on again. If a trigger continues to fire and cause this error, you can remove your triggers past doing the post-obit:
New editor
- At the left of the Apps Script projection, click Triggers .
- At the correct of the trigger you desire to remove, click More > Delete trigger.
Legacy editor
- Select Edit > All your triggers in the Apps Script editor. The resulting dialog shows all active triggers running on your account.
- Find the offending trigger in the list.
- Click the icon next to the trigger name to remove information technology.
- Click Save to tape the deletion.
You lot can besides remove problematic improver triggers past uninstalling the addition.
Access denied: DriveApp or The domain policy has disabled third-party Drive apps
Administrators of Google Workspace domains have the power to disable the Drive SDK for their domain, which prevents their users from installing and using Google Drive apps. This setting also prevents the users from being able to use Apps Script add together-ons that employ the Drive service or Avant-garde Drive Service (even if the script was authorized prior to the admin disabling Bulldoze SDK).
Even so, if an add-on or web app using the Drive service is published for domain-wide installation and is installed by the administrator for some or all users in the domain, the script functions for those users even if the Drive SDK is disabled in the domain.
The script does not have permission to get the active user'southward identity.
Indicates that the active user'southward identity and electronic mail are not available to the script. This warning results from a call to Session.getActiveUser()
. It can also result from a call to Session.getEffectiveUser()
if the script is running in an potency mode other than AuthMode.FULL
. If this alert is signaled, subsequent calls to User.getEmail()
just return "".
There are a number of ways to troubleshoot this warning, depending on the authorization mode the script is running under. The authorization fashion is exposed in triggered functions equally the authMode
belongings of the e
event parameter.
- In
AuthMode.Total
, consider usingSession.getEffectiveUser()
instead. - In
AuthMode.LIMITED
, ensure that the possessor has authorized the script. - In other authorization modes, avert calling either method.
- If y'all are a Google Workspace client newly experiencing this warning from an installable trigger, ensure that the trigger is running every bit a user inside your organization.
Library is missing
If you add together a popular library to your script, you might receive an fault message stating that it'south missing, even though the library is listed equally a dependency for your script. The reason might be that too many people are accessing the library at the same fourth dimension. To avoid this fault, endeavor i of the following solutions:
- Copy and paste the library'south code into your script and remove the library dependency.
- Copy the library script and deploy it as a library from your account. Exist certain to update the dependency in your original script to the new library instead of the public one.
Debugging
Not all mistakes cause an error message to be displayed. There might be a more subtle error where the code is technically correct and tin execute, but the results are not what you expect. Here are some strategies for handling such situations and further investigating a script that is not running the way you wait.
Logging
While debugging it's often helpful to tape information as a script projection executes. Google Apps Script has ii methods for logging information: the Cloud logging service and the more bones Logger and console services that are congenital in to the Apps Script editor.
Encounter the Logging guide for more than details.
Error Reporting
Exceptions that occur because of runtime errors are automatically recorded using the Google Cloud Error Reporting service. This service lets you search and filter exception letters your script projection creates.
New editor
To admission Error Reporting, see View Deject logs and error reports in the Google Cloud Platform console.
Legacy editor
You can enable Error Reporting the showtime time you select View > Stackdriver Logging or View > Stackdriver Error Reporting in a new script.
Once enabled, exceptions that occur because of runtime errors are automatically recorded using the Google Deject Stackdriver service. This service lets you lot search and filter exception letters your script projection creates. You can reach the Stackdriver Fault Reporting interface past selecting View > Stackdriver Error Reporting in the Apps Script editor.
Executions
New editor
Every fourth dimension you run a script, Apps Script makes a record of the execution, including the Cloud logs. These records can assist you lot empathise which actions your script performed.
To view the executions of your script in the Apps Script projection, at the left, click Executions .
Legacy editor
Every time you lot run a script, Apps Script makes a record of the execution, including the Cloud logs. These records tin assist you to understand which actions your script performed. To view the executions of your script, select View > Executions in the Apps Script editor. This opens the Executions panel for the script in the Apps Script dashboard.
Checking Apps Script service status
Although rare, sometimes specific Google Workspace services (such equally Gmail or Bulldoze) meet temporary problems that can lead to service outages. When this occurs, Apps Script projects that interact with these services may non function as expected.
You can check if in that location is a Google Workspace service outage by viewing the Google Workspace Status Dashboard. If an outage is currently being experienced, you lot either look for it to be resolved or seek additional help in the Google Workspace Aid Center or the Google Workspace Known Issues documentation.
Use the debugger and breakpoints
To locate problems in your script, you can run it in debug manner. When run in debug mode, a script pauses when it hits a breakpoint, which is a line y'all've highlighted in your script that you lot think may have a problem. When a script pauses it displays the value of each variable at that point in time, allowing yous to inspect the inner workings of a script without having to add a lot of logging statements.
Add a breakpoint
New editor
To add a breakpoint, hover over the line number of the line you lot desire to add the breakpoint to. At the left of the line number, click the circumvolve. The beneath image shows an instance of a breakpoint added to a script:
Legacy editor
To add a breakpoint click on the line number for the line y'all want to interruption at.
Run a script in debug fashion
New editor
To run the script in debug style, at the meridian of the editor click Debug.
Before the script runs the line with the breakpoint it pauses and displays a table of debug information. You can utilise this table to audit data like the values of parameters and the information stored in objects.
To control how the script is run, at the top of the Debugger panel, utilise the "Step in", "Step over", and "Step out" buttons. These let you run the script one line at a time and inspect how values change over fourth dimension.
Legacy editor
To run the script in debug mode, click the bug icon () in the toolbar. Before the script runs the line with the breakpoint information technology pauses and displays a table of debug information.
This table allows you to inspect the values of the parameters like row
and email
, as well as the information stored in the data
object. Discover that the rowData
variable doesn't have a value assigned however, because the script paused before that line was executed.
When the script is paused, an extra set of buttons are displayed in the toolbar which allow you to control how the script is run. Using the "step in", "step over", and "pace out" buttons you can run the script 1 line at a fourth dimension, allowing y'all to audit how values alter over time.
Issues with multiple Google Accounts
If yous're logged into multiple Google Accounts at the same fourth dimension, you might accept problem accessing your Apps Script projects, add-ons, and web apps. Multi-login, or beingness logged into multiple Google Accounts at once, isn't supported for Apps Script, add-ons, or web apps.
To fix issues from multi-login, try 1 of the following solutions:
- Log out of all your Google Accounts and but log in to the one that has the Apps Script project, add together-on, or web app you need to access.
- Open up an incognito window in Google Chrome, or an equivalent private browsing window, and log in to the Google Account that has the Apps Script project, add-on, or web app yous need to admission.
Getting help
Debugging a problem using the tools and techniques listed in a higher place can solve a variety of problems, just there may be issues you run into that crave some extra help to solve. See our Support page for information on where to ask questions and file bugs.
fosternottlentimen.blogspot.com
Source: https://developers.google.com/apps-script/guides/support/troubleshooting
0 Response to "Is Having Trouble With Google Play Services. Please Try Again"
Postar um comentário