I'm trying to follow the tutorial for the Google Payment API found here: https://developers.google.com/payments/setup
I'm getting the following errors when I sync the gradle
Mainly - I get the error:
Failed to resolve: com.google.android.gms:play-services-wallet:11.4.0
There is a link under the error to "Install Repository and sync project"
but when I click that, nothing happens.
Is there a way to manually install the necessary repository? Is there something else that I'm missing? What repository do I even need to install? I've tried to update everything.
Gradle:
{
apply plugin: 'com.android.application'
android {
compileSdkVersion 26
buildToolsVersion "26.0.2"
defaultConfig {
applicationId "com.google.android.gms.samples.wallet"
minSdkVersion 26
targetSdkVersion 26
versionCode 1
versionName "1.0"
}
buildTypes {
release {
shrinkResources true
minifyEnabled true
proguardFiles getDefaultProguardFile('proguard-android.txt'),
'proguard-rules.pro'
}
}
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile 'com.android.support:appcompat-v7:26.0.2'
compile 'com.google.android.gms:play-services-wallet:11.4.0'
compile 'com.google.android.gms:play-services-tasks:11.4.0'
compile 'com.google.android.gms:play-services-base:11.4.0'
compile 'com.google.android.gms:play-services-basement:11.4.0'
}
Top Level Gradle
buildscript {
repositories {
jcenter()
maven {
url "https://maven.google.com"
}
}
dependencies {
classpath 'com.android.tools.build:gradle:2.3.3'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
jcenter()
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
Manifest
<?xml version="1.0" encoding="utf-8"?>
<application
android:allowBackup="true"
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
android:roundIcon="@mipmap/ic_launcher_round"
android:supportsRtl="true"
android:theme="@style/AppTheme">
<activity android:name="MainActivity">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<!-- Enables the Google Payment API -->
<meta-data
android:name="com.google.android.gms.wallet.api.enabled"
android:value="true" />
</application>
I've been trying to get this to run for about a week, and can't get the the gradle to sync whenever I include google wallet. I've followed the tutorial as closely as I can. I've tried it with their sample app from github, from my own app, from a couple apps from scratch. I have no idea how to get this repository to work.
Thanks. John