title: Android java.lang.NoSuchFieldError when using the AWS Amplify API
body: <p>I am writing an app using both the aws android api and the aws Amplify api. The issue occurs when I am using methods from <code>AWSKinesisVideoClient</code> (look at the line starting with <code>Caused by</code>).</p>
  <pre><code>E/AndroidRuntime: FATAL EXCEPTION: AsyncTask #1
  Process: com.appliedstructures.myapp_v002, PID: 32474
  java.lang.RuntimeException: An error occurred while executing doInBackground()
      at android.os.AsyncTask$4.done(AsyncTask.java:399)
      at java.util.concurrent.FutureTask.finishCompletion(FutureTask.java:383)
      at java.util.concurrent.FutureTask.setException(FutureTask.java:252)
      at java.util.concurrent.FutureTask.run(FutureTask.java:271)
      at android.os.AsyncTask$SerialExecutor$1.run(AsyncTask.java:289)
      at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167)
      at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641)
      at java.lang.Thread.run(Thread.java:919)
   Caused by: java.lang.NoSuchFieldError: No instance field timeOffset of type I in class Lcom/amazonaws/services/kinesisvideo/AWSKinesisVideoClient; or its superclasses (declaration of 'com.amazonaws.services.kinesisvideo.AWSKinesisVideoClient' appears in /data/app/com.appliedstructures.myapp_v002-ktjX0i0uX6YfDy0RwrPWFA==/base.apk)
      at com.amazonaws.services.kinesisvideo.AWSKinesisVideoClient.invoke(AWSKinesisVideoClient.java:1532)
      at com.amazonaws.services.kinesisvideo.AWSKinesisVideoClient.describeSignalingChannel(AWSKinesisVideoClient.java:653)
      at com.appliedstructures.myapp_v002.ui.home.HomeFragment$InfoUpdaterTask.doInBackground(HomeFragment.java:141)
      at com.appliedstructures.myapp_v002.ui.home.HomeFragment$InfoUpdaterTask.doInBackground(HomeFragment.java:102)
  </code></pre>
  <p>However, when I manually inspect the code in that class, there is clearly a field called <code>timeOffset</code>. I read online that a source of this issue might be android's ProGuard (since it can remove unused code and accidentally remove this field as well). However, in my <code>gradle.build</code> I directly specified <code>minifyEnabled false</code> in both release and debug.</p>
  <p>here is my <code>gradle.build (root)</code>:</p>
  <pre><code>// Top-level build file where you can add configuration options common to all sub-projects/modules.
  buildscript {
      repositories {
          google()
          jcenter()
          mavenCentral()
      }
      dependencies {
          classpath &quot;com.android.tools.build:gradle:7.0.3&quot;
  
          // NOTE: Do not place your application dependencies here; they belong
          // in the individual module build.gradle files
      }
  }
  
  task clean(type: Delete) {
      delete rootProject.buildDir
  }
  </code></pre>
  <p>And here is <code>gradle.build (app)</code>:</p>
  <pre><code>plugins {
      id 'com.android.application'
  }
  
  android {
      compileSdk 30
  
      defaultConfig {
          applicationId &quot;com.appliedstructures.myapp_v002&quot;
          minSdk 24
          targetSdk 30
          versionCode 1
          versionName &quot;1.0&quot;
          android
          testInstrumentationRunner &quot;androidx.test.runner.AndroidJUnitRunner&quot;
      }
  
      packagingOptions {
          exclude 'com/fasterxml/jackson/databind/cfg/VERSION.txt'
          exclude 'com/fasterxml/jackson/core/json/VERSION.txt'
          exclude 'META-INF/DEPENDENCIES'
      }
  
      buildTypes {
          release {
              minifyEnabled false
              //proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
              proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
          }
          debug {
              minifyEnabled false
          }
      }
      compileOptions {
          coreLibraryDesugaringEnabled true
          sourceCompatibility JavaVersion.VERSION_1_8
          targetCompatibility JavaVersion.VERSION_1_8
      }
      buildFeatures {
          viewBinding true
      }
  }
  
  dependencies {
      //builAmplify dependencies
      implementation 'com.amplifyframework:core:1.28.1'
      implementation 'com.amplifyframework:aws-auth-cognito:1.28.1'
  
      //aws dependencies
      def aws_version = '2.16.13'
      implementation (&quot;com.amazonaws:aws-android-sdk-kinesisvideo:$aws_version@aar&quot;) { transitive = true }
      implementation (&quot;com.amazonaws:aws-android-sdk-kinesisvideo-signaling:$aws_version@jar&quot;) { transitive = true }
      implementation (&quot;com.amazonaws:aws-android-sdk-mobile-client:$aws_version@aar&quot;) { transitive = true }
      implementation (&quot;com.amazonaws:aws-android-sdk-auth-userpools:$aws_version@aar&quot;) { transitive = true }
  
      //android default dependencies
      implementation 'androidx.appcompat:appcompat:1.3.1'
      implementation 'com.google.android.material:material:1.4.0'
      implementation 'androidx.constraintlayout:constraintlayout:2.1.1'
      implementation 'androidx.lifecycle:lifecycle-livedata-ktx:2.3.1'
      implementation 'androidx.lifecycle:lifecycle-viewmodel-ktx:2.3.1'
      implementation 'androidx.navigation:navigation-fragment:2.3.5'
      implementation 'androidx.navigation:navigation-ui:2.3.5'
      testImplementation 'junit:junit:4.+'
      androidTestImplementation 'androidx.test.ext:junit:1.1.3'
      androidTestImplementation 'androidx.test.espresso:espresso-core:3.4.0'
  
      //support for Java 8 features
      coreLibraryDesugaring 'com.android.tools:desugar_jdk_libs:1.1.5'
  }
  </code></pre>
  <p>So what is the source of the problem and how can it be fixed (refreshing gradle, and restarting android studio did not work)?</p>
  <p>Edit:
  Here is the exact code snippet that causes the issue:</p>
  <pre><code>AWSKinesisVideoClient client;
  
  try {
      client = getAwsKinesisVideoClient();
  } catch (Exception e) {
      return FAILED;
  }
  
  DescribeSignalingChannelResult describeResult = client.describeSignalingChannel(
          new DescribeSignalingChannelRequest().withChannelARN(channelName));
              
  </code></pre>