0

I'm trying to use Apollo's SQLNormalizedCacheFactory in my project. But even after adding the dependencies, I cannot import the SQLNormalizedCacheFactory class in my project. But I'm able to import NormalizedCacheFactory class in my project.

app.gradle (Project level)

buildscript {
  dependencies {
    classpath 'com.android.tools.build:gradle:4.2.0'
    classpath "com.apollographql.apollo3:apollo-gradle-plugin:3.7.4"
  }

app.gradle (Project level)

apply plugin: 'com.android.application'
apply plugin: 'com.apollographql.apollo3'

android {
  compileSdkVersion 30
  useLibrary 'org.apache.http.legacy'


  defaultConfig {
    applicationId "com.example.android"
    minSdkVersion 21
    targetSdkVersion 31

    versionCode 1
    versionName "1.0.0"
  }

  compileOptions {
    sourceCompatibility JavaVersion.VERSION_1_8
    targetCompatibility JavaVersion.VERSION_1_8
  }

  flavorDimensions "mode"

  productFlavors {
    debug {
      applicationId 'com.example.android.internal'
      resValue "string", "app_name", "SampleDebug"
      dimension "mode"
    }

    production {
      applicationId 'com.example.android'
      resValue "string", "app_name", "Sample"
      dimension "mode"
    }

  }

  buildTypes {
    debug {
      minifyEnabled false
      versionNameSuffix '-DEBUG'
      aaptOptions.cruncherEnabled = false
    }

    release {
      minifyEnabled true
      shrinkResources true
      proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
    }
  }
}

apollo {
  service("service") {
    packageName.set("com.example.android")
  }
}

dependencies {

  // Android
  implementation 'androidx.appcompat:appcompat:1.2.0'

  // Apollo
  def apollo3GraphqlVersion = '3.7.4'
  implementation "com.apollographql.apollo3:apollo-runtime:$apollo3GraphqlVersion"
  implementation "com.apollographql.apollo3:apollo-rx2-support:$apollo3GraphqlVersion"
  implementation "com.apollographql.apollo3:apollo-normalized-cache-sqlite:$apollo3GraphqlVersion"

}

NOTE: I'm using the Apollo-kotlin library in my android project uses Java

nandha-dev
  • 153
  • 1
  • 3
  • 11

0 Answers0