I have referred this link on stack overflow still unable to migrate to version v2.
Link Referred from stack overflow
After doing changes as suggested in the below link i am getting this error.
Link Referred
Could not find method google() for arguments [] on repository container.
Here is my project level gradle file
buildscript {
repositories {
jcenter()
google()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.0.0-alpha8'
classpath "com.google.cloud.tools:endpoints-framework-gradle-plugin:1.0.0"
classpath 'com.google.guava:guava:19.0'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
jcenter()
google()
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
App level build.gradle
apply plugin: 'com.android.application'
apply plugin: 'com.google.cloud.tools.endpoints-framework-client'
android {
compileSdkVersion 26
buildToolsVersion "26.0.1"
defaultConfig {
applicationId "com.xxx.migrationv2"
minSdkVersion 16
targetSdkVersion 26
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
configurations {
compile.exclude group: "org.apache.httpcomponents", module: "httpclient"
}
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation 'com.android.support:appcompat-v7:26.0.0'
implementation 'com.android.support.constraint:constraint-layout:1.0.2'
compile 'com.google.code.findbugs:jsr305:2.0.1'
testImplementation 'junit:junit:4.12'
androidTestImplementation 'com.android.support.test:runner:1.0.0'
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.0'
endpointsServer project(path: ':backend', configuration: 'endpoints')
compile 'com.google.api-client:google-api-client:1.21.0'
}
Backend build.gradle
buildscript {
repositories {
jcenter()
}
dependencies {
classpath 'com.google.cloud.tools:appengine-gradle-plugin:+'
classpath 'com.google.cloud.tools:endpoints-framework-gradle-plugin:+'
}
}
repositories {
jcenter();
}
apply plugin: 'java'
apply plugin: 'war'
apply plugin: 'com.google.cloud.tools.appengine'
apply plugin: 'com.google.cloud.tools.endpoints-framework-server'
sourceCompatibility = JavaVersion.VERSION_1_7
targetCompatibility = JavaVersion.VERSION_1_7
dependencies {
// appengineSdk 'com.google.appengine:appengine-java-sdk:1.9.42'
// compile 'com.google.appengine:appengine-endpoints:1.9.42'
// compile 'com.google.appengine:appengine-endpoints-deps:1.9.42'
// compile 'javax.servlet:servlet-api:2.5'
compile group: 'com.google.endpoints', name: 'endpoints-framework', version: '+'
compile 'javax.inject:javax.inject:1'
}
endpointsServer {
// Endpoints Framework Plugin server-side configuration
hostname = "xxx.appspot.com"
}
//appengine {
// downloadSdk = true
// appcfg {
// oauth2 = true
// }
// endpoints {
// getClientLibsOnBuild = true
// getDiscoveryDocsOnBuild = true
// }
//}
Please let me know what am i doing wrong in this migration any suggestions will be helpful.