title: Google InApp Update Not working - Always returns UPDATE_NOT_AVAILABLE
body: <p>I am not able to see the Google In-App Updates working in my application. Here is the way I have implemented my code, but it appUpdateInfo always returns UPDATE_NOT_AVAILABLE (1).</p>
  
  <p><strong>onCreate Method</strong></p>
  
  <pre><code>appUpdateManager = AppUpdateManagerFactory.create(this)
          appUpdateManager.registerListener(this)
          val appUpdateInfoTask = appUpdateManager.appUpdateInfo
  
      appUpdateInfoTask.addOnSuccessListener {appUpdateInfo -&gt;
          try {
              if(appUpdateInfoTask.isComplete){
                  if (appUpdateInfo.updateAvailability() == UPDATE_AVAILABLE) {
                      ToastUtils.showShort("Update Available" + appUpdateInfo.isUpdateTypeAllowed(FLEXIBLE))
                      if(appUpdateInfo.isUpdateTypeAllowed(FLEXIBLE)){
                          ToastUtils.showShort("Flexi Update")
                          requestAppUpdate(appUpdateManager.appUpdateInfo.getResult(), FLEXIBLE)
                      }else if(appUpdateInfo.isUpdateTypeAllowed(IMMEDIATE)){
                          ToastUtils.showShort("Immediate Update")
                          requestAppUpdate(appUpdateManager.appUpdateInfo.getResult(), IMMEDIATE)
                      }
                  }
              }
          } catch (e: Exception) {
              Log.e("Update Exception", e.message)
          }
      }
  </code></pre>
  
  <p><strong>onResume Method</strong></p>
  
  <pre><code>override fun onResume() {
          super.onResume()
          val appUpdateInfoTask = appUpdateManager.appUpdateInfo
          appUpdateInfoTask.addOnCompleteListener {
              Log.e("Update Complete", "Complete")
          }
          appUpdateInfoTask.addOnSuccessListener {
              if(appUpdateInfoTask.isComplete){
                  if (it.installStatus() == DOWNLOADED) {
                      showUpdateSnackbar()
                  }
              }
          }
      }
  </code></pre>
  
  <p><strong>onDestroy Method</strong></p>
  
  <pre><code>override fun onDestroy() {
          super.onDestroy()
          appUpdateManager.unregisterListener(this)
      }
  </code></pre>
  
  <p><strong>onActivityResult Method</strong></p>
  
  <pre><code>override fun onActivityResult(requestCode: Int, resultCode: Int, data: Intent?) {
          super.onActivityResult(requestCode, resultCode, data)
          if (requestCode == REQUEST_CODE_TO_FETCH_UPDATES) {
              when (resultCode) {
                  Activity.RESULT_OK -&gt; {
                      ToastUtils.showShort("Access to Update Granted")
                  }
                  Activity.RESULT_CANCELED -&gt; {
                      ToastUtils.showShort("Access to Update Cancelled")
                  }
                  ActivityResult.RESULT_IN_APP_UPDATE_FAILED -&gt; {
                      ToastUtils.showShort("Access to Update Failed")
                  }
              }
          }
      }
  </code></pre>
  
  <p><strong>Key Points</strong></p>
  
  <ol>
  <li>Uploaded my app on the internal test track with Android App Bundle Format</li>
  <li>App Update is available on the store(on internal track) when my code written above in onCreate returns  UPDATE_NOT_AVAILABLE.</li>
  <li>I have uploaded the using Google Play Developers API, and have set the <strong>inAppUpdatePriority</strong> as <strong>5</strong></li>
  </ol>
  
  <p>QUERIES:</p>
  
  <ol>
  <li>I have tried updating the app many times on the store and I can never see an update on my app via this code.WHY?</li>
  <li>How can I see actual FLEXIBLE or IMMEDIATE Update by testing from the Internal test track? Where is the way to set that configuration?</li>
  </ol>