Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

349
Views
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 answers
Answer question

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 Report

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 Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!