I am trying to install apollo graphql plugin in my Android project for Kotlin.
As per the instruction from Apollographql installation for Kotlin, I am trying the installation process using the legacy syntax.
My build.gradle(app) file:
apply plugin: 'com.android.application'
apply plugin: 'kotlin-android'
apply plugin: 'kotlin-android-extensions'
apply plugin: 'com.apollographql.apollo'
android {
compileSdkVersion 29
defaultConfig {
applicationId "com.example.goonlinepackagescanner"
minSdkVersion 26
targetSdkVersion 29
versionCode 1
versionName "1.0"
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
implementation fileTree(dir: "libs", include: ["*.jar"])
implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
implementation 'androidx.core:core-ktx:1.3.1'
implementation 'androidx.appcompat:appcompat:1.2.0'
implementation 'androidx.constraintlayout:constraintlayout:2.0.1'
testImplementation 'junit:junit:4.12'
androidTestImplementation 'androidx.test.ext:junit:1.1.2'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.3.0'
implementation "com.apollographql.apollo:apollo-gradle-plugin:2.3.1"
implementation "com.apollographql.apollo:apollo-runtime:2.3.1"
implementation "com.apollographql.apollo:apollo-coroutines-support:2.3.1"
}
My build.gradle(project) file:
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
ext.kotlin_version = '1.4.10'
repositories {
google()
jcenter()
}
dependencies {
classpath "com.android.tools.build:gradle:4.0.0"
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
google()
jcenter()
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
It gives the following error when I try to sync the gradle file:
Plugin with id 'com.apollographql.apollo' not found.
I have been trying to figure out what has went wrong but couldn't do so. Any help on this will be appreciated.