I'm trying to add Google Calendar integration with my app. I followed the Android quickstart guide here https://developers.google.com/google-apps/calendar/quickstart/android
I was having problems integrating this into my existing project, so I tried making a fresh project and copy and pasting the code. However, I'm still getting this error:
403 Forbidden
{
"code": 403,
"errors": [
{
"domain": "usageLimits",
"message": "Access Not Configured. The API (Calendar API) is not enabled for your project. Please use the Google Developers Console to update your configuration.",
"reason": "accessNotConfigured",
"extendedHelp": "https://console.developers.google.com"
}
],
"message": "Access Not Configured. The API (Calendar API) is not enabled for your project. Please use the Google Developers Console to update your configuration."
}
at com.google.api.client.googleapis.services.json.AbstractGoogleJsonClientRequest.newExceptionOnError(AbstractGoogleJsonClientRequest.java:113)
at com.google.api.client.googleapis.services.json.AbstractGoogleJsonClientRequest.newExceptionOnError(AbstractGoogleJsonClientRequest.java:40)
at com.google.api.client.googleapis.services.AbstractGoogleClientRequest$1.interceptResponse(AbstractGoogleClientRequest.java:321)
at com.google.api.client.http.HttpRequest.execute(HttpRequest.java:1056)
at com.google.api.client.googleapis.services.AbstractGoogleClientRequest.executeUnparsed(AbstractGoogleClientRequest.java:419)
at com.google.api.client.googleapis.services.AbstractGoogleClientRequest.executeUnparsed(AbstractGoogleClientRequest.java:352)
at com.google.api.client.googleapis.services.AbstractGoogleClientRequest.execute(AbstractGoogleClientRequest.java:469)
at com.gdosheriii.android.calendartest.ApiAsyncTask.getDataFromApi(ApiAsyncTask.java:72)
at com.gdosheriii.android.calendartest.ApiAsyncTask.doInBackground(ApiAsyncTask.java:39)
at com.gdosheriii.android.calendartest.ApiAsyncTask.doInBackground(ApiAsyncTask.java:19)
at android.os.AsyncTask$2.call(AsyncTask.java:288)
at java.util.concurrent.FutureTask.run(FutureTask.java:237)
at android.os.AsyncTask$SerialExecutor$1.run(AsyncTask.java:231)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1112)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:587)
at java.lang.Thread.run(Thread.java:841)
What am I doing wrong? I've been googling for an answer for the past two hours, but nothing seems to fix it. Yes, I did create a client id inside the Google Developers Console. I copied and pasted the package (com.gdosheriii.android.calendartest) and the SHA1 key. I have the Calendar API enabled.
What is the correct way to do it?
Thanks for the help!
you need to change application name in code de google quistart, you can do that by following this next steps:
private class MakeRequestTask extends AsyncTask<Void, Void, List<String>> {
private com.google.api.services.calendar.Calendar mService = null;
private Exception mLastError = null;
public MakeRequestTask(GoogleAccountCredential credential) {
HttpTransport transport = AndroidHttp.newCompatibleTransport();
JsonFactory jsonFactory = JacksonFactory.getDefaultInstance();
mService = new com.google.api.services.calendar.Calendar.Builder(
transport, jsonFactory, credential)
.setApplicationName("YOUR APPLICATION NAME IN GOOGLE CONSOLE")
.build();
}
Related
I am trying to upload a file to Dropbox using Sync API, but while uploading getting Error
W/libDropboxSync.so(status): REQUEST: api_core.cpp:264: HTTP request error 400: v1_retired [dc166c5befd76df2]
W/com.dropbox.sync.android.DbxAccount: Failed to update account info.
com.dropbox.sync.android.DbxException$Request: _jobject* dropboxsync::Java_com_dropbox_sync_android_NativeApp_nativeGetAccountInfo(JNIEnv*, jobject, jlong, jobject) - Invalid server request: HTTP request error 400: v1_retired [dc166c5befd76df2]
at com.dropbox.sync.android.DbxError.exceptionFrom(DbxError.java:296)
at com.dropbox.sync.android.NativeLib.exceptionFrom(NativeLib.java:254)
at com.dropbox.sync.android.NativeLib.throwFrom(NativeLib.java:242)
at com.dropbox.sync.android.NativeApp.nativeGetAccountInfo(Native Method)
at com.dropbox.sync.android.NativeApp.getAccountInfo(NativeApp.java:175)
at com.dropbox.sync.android.DbxAccount.fetchAccountInfo(DbxAccount.java:559)
at com.dropbox.sync.android.DbxAccount.backgroundUpdateAccountInfo(DbxAccount.java:540)
at com.dropbox.sync.android.CoreBackgroundProcessor$RunAccountInfoUpdate.attemptRun(CoreBackgroundProcessor.java:209)
at com.dropbox.sync.android.CoreBackgroundProcessor$BackgroundRunner.run(CoreBackgroundProcessor.java:239)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:428)
at java.util.concurrent.FutureTask.run(FutureTask.java:237)
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:272)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1133)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:607)
at java.lang.Thread.run(Thread.java:761)
Below Code, I am using for file uploading. Stuck in this from 2 days.
DbxFileSystem dbxFs = DbxFileSystem.forAccount(HomeActivity.mDbxAcctMgr.getLinkedAccount());
DbxPath path = new DbxPath(recordingData.filePath);
DbxFile mFile;
try {
mFile = dbxFs.open(path);
} catch (DbxException.NotFound e) {
mFile = dbxFs.create(path);
}
mFile.addListener(mChangeListener);
The SDK you're trying to use is built on Dropbox API v1, which is retired: https://blogs.dropbox.com/developers/2016/06/api-v1-deprecated/
You should instead switch to API v2: https://www.dropbox.com/developers
To use API v2 from Java/Android, we recommend using the official Dropbox API v2 Java SDK: https://github.com/dropbox/dropbox-sdk-java
Calling
final AuthCredential credential = GoogleAuthProvider.getCredential(acct.getIdToken(), null);
results in
com.google.firebase.FirebaseException: An internal error has occurred. [ Bad Request ]
at com.google.android.gms.internal.zzeaw.zzaw(Unknown Source)
at com.google.android.gms.internal.zzdzu.zza(Unknown Source)
at com.google.android.gms.internal.zzebh.zzax(Unknown Source)
at com.google.android.gms.internal.zzebk.onFailure(Unknown Source)
at com.google.android.gms.internal.zzeay.onTransact(Unknown Source)
at android.os.Binder.execTransact(Binder.java:453)
OAuth 2.0: I do have correct SHA-1 in Google developer console as well as Firebase console.
I do have an up-to-date google-services.json file included in project.
We use Firebase and FirebaseUI-Auth with email accounts in one of our Android apps.
When we try to log in using FirebaseUI-Auth with a specific email account, the progress dialog (progress_dialog_checking_accounts) hides without showing an error and what we see in logcat is the following:
W/CheckEmailFragment: Error fetching providers for email
com.google.firebase.c: An internal error has occurred. [ Backend Error ]
at com.google.android.gms.c.eg.a(Unknown Source)
at com.google.android.gms.c.ed$f.a(Unknown Source)
at com.google.android.gms.c.eo.a(Unknown Source)
at com.google.android.gms.c.eo$a.a(Unknown Source)
at com.google.android.gms.c.ej$a.onTransact(Unknown Source)
at android.os.Binder.execTransact(Binder.java:453)
The results of the following curl request are not very informative either:
curl 'https://www.googleapis.com/identitytoolkit/v3/relyingparty/createAuthUri?key=${MyFirebaseAPIKey}' -H 'Content-Type: application/json' --data-binary '{"identifier": "${ProblematicEmailAddress}","continueUri":"http://localhost"}'
{
"error": {
"errors": [
{
"domain": "global",
"reason": "backendError",
"message": "Backend Error"
}
],
"code": 500,
"message": "Backend Error"
}
}
I get a good response with another email address (also a registered account):
{
"kind": "identitytoolkit#CreateAuthUriResponse",
"allProviders": [
"password"
],
"registered": true,
"sessionId": "${replaced}"
}
Does anyone know what is happening and how we can solve this error? We are concerned, that this might occur for other email accounts as well, thus preventing users from signing in.
I created live streaming application using https://github.com/youtube/yt-watchme. And its installed on android phone.If I logged into this app.I's still shows the "Not Signed in" Message. After login its showing the following error in android studio console
09-16 16:48:01.970 25937-3107/com.google.android.apps.watchme E/WatchMe﹕ com.google.api.client.googleapis.json.GoogleJsonResponseException: 403 Forbidden
{
"code": 403,
"errors": [
{
"domain": "usageLimits",
"message": "Access Not Configured. The API (YouTube Data API) is not enabled for your project. Please use the Google Developers Console to update your configuration.",
"reason": "accessNotConfigured",
"extendedHelp": "https://console.developers.google.com"
}
],
"message": "Access Not Configured. The API (YouTube Data API) is not enabled for your project. Please use the Google Developers Console to update your configuration."
}
at com.google.api.client.googleapis.services.json.AbstractGoogleJsonClientRequest.newExceptionOnError(AbstractGoogleJsonClientRequest.java:113)
at com.google.api.client.googleapis.services.json.AbstractGoogleJsonClientRequest.newExceptionOnError(AbstractGoogleJsonClientRequest.java:40)
at com.google.api.client.googleapis.services.AbstractGoogleClientRequest$1.interceptResponse(AbstractGoogleClientRequest.java:321)
at com.google.api.client.http.HttpRequest.execute(HttpRequest.java:1056)
at com.google.api.client.googleapis.services.AbstractGoogleClientRequest.executeUnparsed(AbstractGoogleClientRequest.java:419)
at com.google.api.client.googleapis.services.AbstractGoogleClientRequest.executeUnparsed(AbstractGoogleClientRequest.java:352)
at com.google.api.client.googleapis.services.AbstractGoogleClientRequest.execute(AbstractGoogleClientRequest.java:469)
at com.google.android.apps.watchme.util.YouTubeApi.getLiveEvents(YouTubeApi.java:155)
at com.google.android.apps.watchme.MainActivity$GetLiveEventsTask.doInBackground(MainActivity.java:312)
at com.google.android.apps.watchme.MainActivity$GetLiveEventsTask.doInBackground(MainActivity.java:295)
at android.os.AsyncTask$2.call(AsyncTask.java:288)
at java.util.concurrent.FutureTask.run(FutureTask.java:237)
at android.os.AsyncTask$SerialExecutor$1.run(AsyncTask.java:231)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1112)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:587)
at java.lang.Thread.run(Thread.java:841)
How can i solve this issue please help.
This application is connecting to YouTube Watch Me project.Is it possible to connect my project using client Id and client secret(How can i configure my client id to this app?)?
Please suggest
I followed all steps listen under https://developers.google.com/drive/quickstart-android
It works!
But if im going to merge the given code/package to an other project, im getting
W/System.err(793): com.google.android.gms.auth.UserRecoverableAuthException: NeedPermission
W/System.err(793): at com.google.android.gms.auth.GoogleAuthUtil.getToken(Unknown Source)
W/System.err(793): at com.google.android.gms.auth.GoogleAuthUtil.getToken(Unknown Source)
W/System.err(793): at com.drive.main.MainActivity$GetToken.doInBackground(MainActivity.java:139)
W/System.err(793): at com.drive.main.MainActivity$GetToken.doInBackground(MainActivity.java:1)
W/System.err(793): at java.util.concurrent.FutureTask.run(FutureTask.java:234)
W/System.err(793): at android.os.AsyncTask$SerialExecutor$1.run(AsyncTask.java:230)
W/System.err(793): at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1080)
W/System.err(793): at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:573)
W/System.err(793): at java.lang.Thread.run(Thread.java:856)
I/System.out(793): An error occurred: com.google.api.client.googleapis.extensions.android.gms.auth.UserRecoverableAuthIOException
Am I doing something wrong in the Manifest or should i change something in the Api Console?
Found only one thread under stackoverflow without any answer
Google Drive Authentication Exception - Needs Permission? (v2)
Any ideas would be helpful. Thank you.
You should catch the UserRecoverableAuthException and in the catch block, you recover the Intent from the exception by calling UserRecoverableAuthException#getIntent(). Start that intent to take user to the OAuth2 permission page for your app.
Sample code -
try {
Drive service = Drive.Builder(AndroidHttp.newCompatibleTransport(), new GsonFactory(), credential)
.build();
// Do whatever you want with the Drive service
} catch (UserRecoverableAuthIOException e) {
startActivityForResult(e.getIntent(), REQUEST_AUTHORIZATION);
}