Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

345
Vistas
package com.google.android.gms.samples.wallet does not exist import com.google.android.gms.samples.wallet.Constants

I'm new Android and more new to the payment part of it , i'm going through this link to implement the Gpay into my app

https://developers.google.com/pay/api/android/guides/tutorial#checkoutactivity.java

so i copy the code as is , the version i implemented is

    implementation 'com.android.support:design:28.0.0'
    implementation 'com.google.android.gms:play-services-wallet:18.1.2'
    implementation 'com.android.support:appcompat-v7:28.0.0'

but when i run i keep getting this error

package com.google.android.gms.samples.wallet does not exist import com.google.android.gms.samples.wallet.Constants

how can i resolve this error?

over 4 years ago · Santiago Trujillo
2 Respuestas
Responde la pregunta

0

I had a similar problem with a reference to com.google.android.gms.samples.wallet.Constants.PAYMENTS_ENVIRONMENT appearing in the createPaymentsClient method in that tutorial. The code being referred to can be found at https://github.com/google-pay/android-quickstart/blob/master/java/app/src/main/java/com/google/android/gms/samples/wallet/Constants.java, so you can either refactor this into your codebase directly, and change the import statement in paymentsUtil.java to refer to your new location for this file, or you can simply copy following the key line over into paymentsUtil.java and remove the import altogether:

public static final int PAYMENTS_ENVIRONMENT = WalletConstants.ENVIRONMENT_TEST;

The second option is probably easier for when you want to move to a live production environment.

Let me know if this is helpful.

over 4 years ago · Santiago Trujillo Denunciar

0

I fixed by using the Constants class in the sample application in here enter link description here. Just download as zip, open and copy the Constant class in your project.

over 4 years ago · Santiago Trujillo Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda