> For the complete documentation index, see [llms.txt](https://docs.payments.thalescloud.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.payments.thalescloud.io/classic-push-provisioning/developer-guide/troubleshooting/android.md).

# Android

### Retrieving logs <a href="#retrieving-logs" id="retrieving-logs"></a>

#### Prerequisites for Logcat <a href="#prerequisites-for-logcat" id="prerequisites-for-logcat"></a>

Before you retrieve log files from an Android device, complete this setup:

* Android Debug Bridge (ADB) is installed on the host system.
* The USB debugging option is enabled on the device under test.
* The Android device is connected to the host system with a USB cable, and the USB driver is installed.

Run the following command to verify your setup:

```
adb devices
```

Output similar to the following indicates that ADB can reach the device:

```
List of devices attached228b0e100d047ece device
```

If this is not the case, check that the prerequisites are met as specified above.

There are online guides covering these steps.

For an end-to-end setup, see <https://support.citrix.com/article/CTX232375>.

> <i class="fa-exclamation-circle">:exclamation-circle:</i>
>
> #### Warning <a href="#warning" id="warning"></a>
>
> Some devices require you to enable device logging from a vendor-specific menu.
>
> For example, on Huawei devices this is under a menu you can open by dialing `*#*#2846579#*#*`. For details, see <https://stackoverflow.com/questions/18124334/huawei-logcat-not-showing-the-log-for-my-app>.

#### Recommended steps for capturing logs <a href="#recommended-steps-for-capturing-logs" id="recommended-steps-for-capturing-logs"></a>

* Open the command prompt and clear all the log buffers in the device:

```
adb logcat -b all -c
```

* Start the log capturing:

```
adb logcat> TestLogFileName.txt
```

* Perform the use case(s).
* Press `CTRL+C` in the command prompt to stop log capturing.
* Locate `TestLogFileName.txt` in the directory where you ran the command in step 2.

> <i class="fa-info-circle">:info-circle:</i>
>
> #### SDK variant and log filters <a href="#sdk-variant-and-log-filters" id="sdk-variant-and-log-filters"></a>
>
> * To capture the most detailed logs, use an app build that uses the `debug` SDK variant.
> * Avoid [log filters](https://developer.android.com/studio/command-line/logcat#filteringOutput) that limit captured messages. These messages are useful for troubleshooting.
> * Keep logs small by limiting capture time. Start capturing just before the use case. Stop capturing right after it completes.

#### Retrieving Google Pay logs <a href="#retrieving-google-pay-logs" id="retrieving-google-pay-logs"></a>

1. Request that Google add your test accounts to the allowlist. Submit the request using the [provisioning contact form](https://support.google.com/faqs/contact/pp_api_general?authuser=1).
2. After Google grants access, filter logs in [Logcat](https://developer.android.com/studio/debug/am-logcat) using `TapAndPay`.

#### Retrieving Samsung Pay logs <a href="#retrieving-samsung-pay-logs" id="retrieving-samsung-pay-logs"></a>

To retrieve logs for the Samsung Pay API, configure the **Debug API key** as described in [Issuer onboarding](/classic-push-provisioning/developer-guide/issuer-onboarding.md).

### Server errors <a href="#server-errors" id="server-errors"></a>

If you receive a server-related error, you may be able to get the API request ID from `TPCSDKException`'s `getRequestId()` method. Use this request ID when you report the issue to the support team.

### Common errors <a href="#common-errors" id="common-errors"></a>

#### Incorrect mode <a href="#incorrect-mode" id="incorrect-mode"></a>

This error occurs when the device is in the wrong mode. Switch the device from `SANDBOX` mode to `PROD` mode. For details, see [Sandbox testing](/classic-push-provisioning/developer-guide/sandbox-testing.md). The error typically looks like:

```
Internal Error: CheckEligibility error in CardNetworkTokenService vendor layer: code: 14
```

#### Invalid field length - cardholderName <a href="#invalid-field-length---cardholdername" id="invalid-field-length---cardholdername"></a>

This error occurs on the Mastercard payment network when the length of `cardHolderName` exceeds the allowed maximum. The maximum length for `cardHolderName` is 27 characters (per Mastercard policy). For details, see the [Mastercard documentation](https://developer.mastercard.com/mdes-pre-digitization/documentation/use_case/issuer-tokenization/#reference-api-implementation). The error typically looks like:

{% code overflow="wrap" %}

```
Invalid Field Length - cardholderName"Internal Error: CheckEligibility error in CardNetworkTokenService vendor layer: code: 3
```

{% endcode %}

#### Incorrect API key credentials <a href="#incorrect-credentials-of-api-key" id="incorrect-credentials-of-api-key"></a>

This error indicates that the project is not configured on the payment network side. Configure the project with the payment network. The error typically looks like:

```
card_network_token_error_code: "AUTHENTICATION_ERROR"
```

#### Google Pay unavailable <a href="#googlepay-unavailable" id="googlepay-unavailable"></a>

This error occurs if one of these conditions is met:

* Your device is in a [country where you can use Google Wallet](https://support.google.com/wallet/answer/12060037#zippy=%2Cuse-google-wallet-for-payments).
* The application is running on the emulator.
* The device does not have Google Play services installed. Google Play services can be [downloaded](https://play.google.com/store/apps/details?id=com.google.android.gms\&hl=en\&gl=US).
* The application package name is not registered to use Google's Push Provisioning API. Refer to [Google's documentation](https://developers.google.com/pay/issuers/apis/push-provisioning/android/allowlist) for more information.
* The application [fingerprint](https://developers.google.com/pay/issuers/apis/push-provisioning/android/allowlist#how_to_get_your_apps_fingerprint) has changed compared to the one on Google's allowlist.
* The Sandbox may be temporarily unavailable. Wait a few days and retry intermittently. If the issue persists, or if it happens in `PPROD` or `PROD`, contact <pushprov-api-support@google.com>.

#### Compile error due to duplicate entry of `R.txt` <a href="#compile-error-due-to-duplicate-entry-of-rtxt" id="compile-error-due-to-duplicate-entry-of-rtxt"></a>

This usually happens when the application sets `android.enableJetifier=true` in `gradle.properties`. To fix it, either disable Jetifier or exclude the Push Provisioning SDK from Jetifier transforms:

```
android.jetifier.blacklist=tpcsdk-release-1.3.0-220421.aar
```

The details of a typical compilation error are shown as follows:

{% code overflow="wrap" %}

```
> Failed to transform tpcsdk-debug-1.3.0-210421.aar (project :tpcsdk-debug) to match attributes {artifactType=android-res}.> Execution failed for JetifyTransform: <omitted>/tpcsdk-debug/tpcsdk-debug-1.3.0-210421.aar.> Failed to transform '/Users/abc/Documents/Projects/TPC_SDK/Delivery/TPC_SDK/TPC_SDK_ANDROID_1_2_0/demo/libs/tpcsdk-debug-1.3.0-210421.aar' using Jetifier. Reason: duplicate entry: R.txt. (Run with --stacktrace for more details.)
```

{% endcode %}

#### Push Provisioning launching new app <a href="#push-provisioning-launching-new-app" id="push-provisioning-launching-new-app"></a>

In rare cases, the push provisioning flow opens in an external application. When this happens, the launched app cannot receive the Google Pay result.

<figure><img src="/files/rSLal8YMmyZfYzYqc4sq" alt=""><figcaption><p>Example of the push provisioning flow opening outside the issuer application.</p></figcaption></figure>

<figure><img src="blob:https://thales-dis-dbp.stoplight.io/18df4a00-07ab-4fd6-8dd8-31292bb4d319" alt=""><figcaption><p>Result screen shown by Google Pay when control is not returned to the issuer application.</p></figcaption></figure>


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.payments.thalescloud.io/classic-push-provisioning/developer-guide/troubleshooting/android.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
