{"record":{"id":"37efec6f935f3c27","repo":"microg/GmsCore","slug":"would-not-sign-in","errorCode":null,"errorMessage":"Would not sign in","messagePattern":"Would not sign in","errorType":"exception","errorClass":"RuntimeException","httpStatus":null,"severity":"error","filePath":"vending-app/src/main/java/org/microg/vending/billing/ui/WebViewHelper.kt","lineNumber":102,"sourceCode":"    private fun addLanguageParam(url: String): String {\n        val language = Locale.getDefault().language\n        return if (language.isNotEmpty()) {\n            Uri.parse(url).buildUpon().appendQueryParameter(\"hl\", language).toString()\n        } else {\n            url\n        }\n    }\n\n    private fun openWebWithAccount(account: Account, url: String) {\n        try {\n            val service = \"weblogin:continue=\" + URLEncoder.encode(url, \"utf-8\")\n            val accountManager: AccountManager = AccountManager.get(activity)\n            val future = accountManager.getAuthToken(account, service, null, null, null, null)\n            val bundle = future.getResult(20, TimeUnit.SECONDS)\n            val authUrl = bundle.getString(AccountManager.KEY_AUTHTOKEN)\n                ?: throw RuntimeException(\"authUrl is null\")\n            if (authUrl.contains(\"WILL_NOT_SIGN_IN\")) {\n                throw RuntimeException(\"Would not sign in\")\n            }\n            if (Log.isLoggable(TAG, Log.DEBUG)) Log.d(TAG, \"Opening $authUrl\")\n            webView.post {\n                if (SDK_INT >= 21) {\n                    CookieManager.getInstance().removeAllCookies {\n                        if (Log.isLoggable(TAG, Log.DEBUG)) Log.d(TAG, \"Cookies removed\")\n                        loadWebViewUrl(authUrl)\n                    }\n                } else {\n                    CookieManager.getInstance().removeAllCookie()\n                    loadWebViewUrl(authUrl)\n                }\n\n            }\n        } catch (e: Exception) {\n            if (Log.isLoggable(TAG, Log.DEBUG)) Log.d(TAG, \"Failed to get weblogin auth.\", e)\n            activity.finish()\n        }","sourceCodeStart":84,"sourceCodeEnd":120,"githubUrl":"https://github.com/microg/GmsCore/blob/157c9d86ac46c195a86c2f15ab55c84036223f95/vending-app/src/main/java/org/microg/vending/billing/ui/WebViewHelper.kt#L84-L120","documentation":"WebViewHelper.openWebWithAccount throws with this message when the AccountManager auth-token future fails or returns no usable result, meaning the silent web-login could not be completed for the given account.","triggerScenarios":"Thrown at vending-app/src/main/java/org/microg/vending/billing/ui/WebViewHelper.kt:102 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Ensure the account is registered and signed in before invoking the flow","Retry the token request or prompt the user to re-authenticate"],"exampleFix":null,"handlingStrategy":"retry","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"157c9d86ac46c195a86c2f15ab55c84036223f95","analyzedAt":"2026-09-06T17:27:33.892Z","contentChangedAt":"2026-09-06T17:27:33.892Z","schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}