0
03-30 15:20:53.422: W/System.err(25384): "message": "Access Not Configured. Please use Google Developers Console to activate the API for your project."
我在嘗試在任務列表上執行GET時出現此錯誤。任務API 403訪問被禁止
GoogleAccountCredential credential = GoogleAccountCredential.usingOAuth2(context, TasksScopes.all());
SharedPreferences settings = PreferenceManager.getDefaultSharedPreferences(context);
String accountName = settings.getString(GoogleIntegrationUtilities.GTASK_ACCOUNT_NAME, "None");
// assume accountname is always defined properly
credential.setSelectedAccountName(accountName);
httpTransport = AndroidHttp.newCompatibleTransport();
jsonFactory = GsonFactory.getDefaultInstance();
tasksServiceBuilder = new Tasks.Builder(httpTransport, jsonFactory, credential).setApplicationName("App name");
tasksService = tasksServiceBuilder.build();
在開發者控制檯,任務API與0%的使用率啓用。在憑據中,我從用debug.keystore定義的包含SHA1定義的Android應用程序的OAuth2客戶端ID以及定義的包名稱。
我錯過了什麼嗎?我也在我的應用程序中獲得了一個權限彈出窗口,我接受了這個窗口 - 但它不出於任何原因在https://security.google.com/settings/security/permissions中顯示。